ruby-changes:3300
From: ko1@a...
Date: 30 Dec 2007 13:56:36 +0900
Subject: [ruby-changes:3300] nobu - Ruby:r14793 (trunk): * parse.y (program): clear input strings after all process.
nobu 2007-12-30 13:56:17 +0900 (Sun, 30 Dec 2007) New Revision: 14793 Modified files: trunk/ChangeLog trunk/parse.y Log: * parse.y (program): clear input strings after all process. * parse.y (parser_nextc, parser_yylex): should not drop lex_lastline while lex_p is valid. [ruby-dev:32896] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/parse.y?r1=14793&r2=14792 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14793&r2=14792 Index: ChangeLog =================================================================== --- ChangeLog (revision 14792) +++ ChangeLog (revision 14793) @@ -1,3 +1,10 @@ +Sun Dec 30 13:56:15 2007 Nobuyoshi Nakada <nobu@r...> + + * parse.y (program): clear input strings after all process. + + * parse.y (parser_nextc, parser_yylex): should not drop lex_lastline + while lex_p is valid. [ruby-dev:32896] + Sun Dec 30 10:54:49 2007 NARUSE, Yui <naruse@r...> * configure.in: rm largefile.h. Index: parse.y =================================================================== --- parse.y (revision 14792) +++ parse.y (revision 14793) @@ -765,6 +765,8 @@ $$ = $2; parser->result = dispatch1(program, $$); %*/ + lex_p = lex_pbeg = lex_pend = 0; + lex_lastline = lex_nextline = 0; } ; @@ -4851,6 +4853,8 @@ return str; } +#define lex_goto_eol(parser) (parser->parser_lex_p = parser->parser_lex_pend) + static inline int parser_nextc(struct parser_params *parser) { @@ -4865,7 +4869,7 @@ if (!lex_input || NIL_P(v = lex_getline(parser))) { parser->eofp = Qtrue; - lex_lastline = 0; + lex_goto_eol(parser); return -1; } } @@ -4918,7 +4922,6 @@ } } -#define lex_goto_eol(parser) (parser->parser_lex_p = parser->parser_lex_pend) #define was_bol() (lex_p == lex_pbeg + 1) #define peek(c) (lex_p != lex_pend && (c) == *lex_p) @@ -6064,14 +6067,14 @@ if ((c = nextc()) != '.') { pushback(c); pushback('.'); - goto retry; + goto retry; } } default: --ruby_sourceline; + lex_nextline = lex_lastline; case -1: /* EOF no decrement*/ - lex_nextline = lex_lastline; - lex_p = lex_pend; + lex_goto_eol(parser); #ifdef RIPPER if (c != -1) { parser->tokp = lex_p; @@ -7094,7 +7097,7 @@ case '_': if (was_bol() && whole_match_p("__END__", 7, 0)) { ruby__end__seen = 1; - lex_lastline = 0; + parser->eofp = Qtrue; #ifndef RIPPER return -1; #else -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml