From d4e341c43d435c42a9da85beb1c999b721c9dffb Mon Sep 17 00:00:00 2001 From: aamine Date: Tue, 14 Sep 2004 13:11:29 +0000 Subject: [PATCH] * parse.y [ripper]: Add rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6908 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ parse.y | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5b88c29acb..37c816a405 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Sep 14 22:11:08 2004 Minero Aoki + + * parse.y [ripper]: Add rdoc. + Tue Sep 14 20:24:49 2004 Minero Aoki * parse.y [ripper]: space event is on__sp, not on__lwsp. diff --git a/parse.y b/parse.y index 59eb20afd1..9301a45c32 100644 --- a/parse.y +++ b/parse.y @@ -8567,6 +8567,16 @@ obj_respond_to(obj, mid) #define ripper_initialized_p(r) ((r)->ripper_lex_input != 0) +/* + * call-seq: + * Ripper.new(src, filename="(ripper)", lineno=1) -> ripper + * + * Create a new Ripper object. + * _src_ must be a String, a IO, or an Object which has #gets method. + * + * This method does not starts parsing. + * See also Ripper#parse and Ripper.parse. + */ static VALUE ripper_initialize(argc, argv, self) int argc; @@ -8595,6 +8605,8 @@ ripper_initialize(argc, argv, self) } parser->ripper_ruby_sourcefile = fname; parser->ripper_ruby_sourceline = NIL_P(lineno) ? 0 : NUM2INT(lineno) - 1; + parser->current_position = 0; + parser->current_column = 0; parser->result = Qnil; parser->toplevel_p = Qtrue; @@ -8624,6 +8636,12 @@ ripper_initialize(argc, argv, self) return Qnil; } +/* + * call-seq: + * Ripper.yydebug -> true or false + * + * Get yydebug. + */ static VALUE ripper_s_get_yydebug(self) VALUE self; @@ -8631,6 +8649,12 @@ ripper_s_get_yydebug(self) return ripper_yydebug ? Qtrue : Qfalse; } +/* + * call-seq: + * Ripper.yydebug = flag + * + * Set yydebug. + */ static VALUE ripper_s_set_yydebug(self, flag) VALUE self, flag; @@ -8669,6 +8693,12 @@ ripper_ensure(parser_v) return Qnil; } +/* + * call-seq: + * ripper#parse + * + * Start parsing and returns the value of the root action. + */ static VALUE ripper_parse(self) VALUE self; @@ -8691,6 +8721,13 @@ ripper_parse(self) return parser->result; } +/* + * call-seq: + * ripper#pos -> Integer + * + * Return the byte index of the current lexer pointer in whole input. + * This number starts from 0. + */ static VALUE ripper_pos(self) VALUE self; @@ -8705,6 +8742,13 @@ ripper_pos(self) return LONG2NUM(parser->current_position); } +/* + * call-seq: + * ripper#column -> Integer + * + * Return column number of current parsing line. + * This number starts from 0. + */ static VALUE ripper_column(self) VALUE self; @@ -8719,6 +8763,13 @@ ripper_column(self) return LONG2NUM(parser->current_column); } +/* + * call-seq: + * ripper#lineno -> Integer + * + * Return line number of current parsing line. + * This number starts from 1. + */ static VALUE ripper_lineno(self) VALUE self;