summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-21 22:25:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-21 22:25:28 +0000
commit8c18a183c9eea6bbb4ae9255d835c8f7f9011f5e (patch)
tree06aa4379213459c0314ae436ed352bc42b0ddcc3 /parse.y
parent7e70ac99dee1fc4d5988cc8f3e05480ab6d8fd8c (diff)
* parse.y (parser_yylex): identfier after dot must not be a variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y11
1 files changed, 6 insertions, 5 deletions
diff --git a/parse.y b/parse.y
index 1f3daf72cb..353a19883b 100644
--- a/parse.y
+++ b/parse.y
@@ -2619,7 +2619,7 @@ primary : literal
$$ = dispatch2(while, $3, $6);
%*/
}
- | kUNTIL {COND_PUSH(1);} expr_value do {COND_POP();}
+ | kUNTIL {COND_PUSH(1);} expr_value do {COND_POP();}
compstmt
kEND
{
@@ -4446,7 +4446,7 @@ lex_io_gets(parser, io)
struct parser_params *parser;
VALUE io;
{
- return rb_io_gets(io);
+ return rb_io_gets(io);
}
NODE*
@@ -5037,7 +5037,7 @@ parser_heredoc_identifier(parser)
uc = (unsigned int)c;
len = mbclen(uc);
do {tokadd(c);} while (--len > 0 && (c = nextc()) != -1);
- } while ((c = nextc()) != -1 &&
+ } while ((c = nextc()) != -1 &&
(uc = (unsigned char)c, is_identchar(uc)));
pushback(c);
break;
@@ -5430,7 +5430,7 @@ parser_yylex(parser)
if (c == '<' &&
lex_state != EXPR_END &&
lex_state != EXPR_DOT &&
- lex_state != EXPR_ENDARG &&
+ lex_state != EXPR_ENDARG &&
lex_state != EXPR_CLASS &&
(!IS_ARG() || space_seen)) {
int token = heredoc_identifier();
@@ -6326,6 +6326,7 @@ parser_yylex(parser)
{
int result = 0;
+ enum lex_state_e last_state = lex_state;
switch (tok()[0]) {
case '$':
@@ -6421,7 +6422,7 @@ parser_yylex(parser)
ID ident = rb_intern(tok());
set_yylval_id(ident);
- if (is_local_id(ident) && lvar_defined(ident)) {
+ if (last_state != EXPR_DOT && is_local_id(ident) && lvar_defined(ident)) {
lex_state = EXPR_END;
}
}