diff --git a/ChangeLog b/ChangeLog index 99bb56884c..e58efbbce9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Sep 20 11:01:55 2004 Minero Aoki + + * parse.y [ripper]: adjust line number for heredoc. [ruby-dev:24272] + Mon Sep 20 04:49:22 2004 Minero Aoki * ext/ripper/ripper.rb.in: new const Ripper::PARSER_EVENT_TABLE. @@ -14,9 +18,10 @@ Mon Sep 20 04:13:00 2004 Minero Aoki Mon Sep 20 03:46:54 2004 Minero Aoki * parse.y [ripper]: spaces before heredoc marker was lost. + [ruby-dev:24272] * keywords: rb_reserved_word() should be defined only in ruby - core. + core. [ruby-dev:24272] * lex.c: sync with keywords. diff --git a/parse.y b/parse.y index e749d49cd3..46de788925 100644 --- a/parse.y +++ b/parse.y @@ -4938,8 +4938,22 @@ parser_tokadd_string(parser, func, term, paren, nest) return c; } -#define NEW_STRTERM(func, term, paren) \ +#define NEW_STRTERM0(func, term, paren) \ rb_node_newnode(NODE_STRTERM, (func), (term) | ((paren) << (CHAR_BIT * 2)), 0) +#ifndef RIPPER +#define NEW_STRTERM(func, term, paren) NEW_STRTERM0(func, term, paren) +#else +#define NEW_STRTERM(func, term, paren) ripper_new_strterm(parser, func, term, paren) +static NODE * +ripper_new_strterm(parser, func, term, paren) + struct parser_params *parser; + VALUE func, term, paren; +{ + NODE *node = NEW_STRTERM0(func, term, paren); + nd_set_line(node, ruby_sourceline); + return node; +} +#endif static int parser_parse_string(parser, quote) @@ -5055,6 +5069,7 @@ parser_heredoc_identifier(parser) rb_str_new(tok(), toklen()), /* nd_lit */ len, /* nd_nth */ lex_lastline); /* nd_orig */ + nd_set_line(lex_strterm, ruby_sourceline); parser_clear_token(parser); return term == '`' ? tXSTRING_BEG : tSTRING_BEG; }