diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-02 22:16:55 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-06-02 22:16:55 +0000 |
| commit | 24ea1221df05e344e3cd985dbe1aa30c628942dc (patch) | |
| tree | fb2b65897448cfcc8279a346b4c519b680e6790f /parse.y | |
| parent | 8b8dc0d3f950b6c017c5707495c6d73dcc640e55 (diff) | |
| download | ruby-24ea1221df05e344e3cd985dbe1aa30c628942dc.tar.gz ruby-24ea1221df05e344e3cd985dbe1aa30c628942dc.tar.xz ruby-24ea1221df05e344e3cd985dbe1aa30c628942dc.zip | |
* parse.y (here_document): check if identifier is terminated.
(ruby-bugs-ja:PR#239)
* parse.y (yylex): should pushback proper char after '**'.
(ruby-bugs-ja:PR#240)
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
| -rw-r--r-- | parse.y | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -2897,6 +2897,14 @@ here_document(term, indent) case '"': case '`': while ((c = nextc()) != term) { + switch (c) { + case -1: + rb_compile_error("unterminated here document identifier meets end of file"); + return 0; + case '\n': + rb_compile_error("unterminated here document identifier meets end of line"); + return 0; + } tokadd(c); } if (term == '\'') term = 0; @@ -2929,8 +2937,8 @@ here_document(term, indent) error: ruby_sourceline = linesave; rb_compile_error("can't find string \"%s\" anywhere before EOF", eos); - free(eos); - return 0; + free(eos); + return 0; } ruby_sourceline++; p = RSTRING(line)->ptr; @@ -3069,7 +3077,7 @@ yylex() case '*': if ((c = nextc()) == '*') { - if (nextc() == '=') { + if ((c = nextc()) == '=') { lex_state = EXPR_BEG; yylval.id = tPOW; return tOP_ASGN; |
