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
commit5426142e072a60f09c90509d4b49d4c929918fc4 (patch)
tree3f115b8ee4024e759d7e48d181f4a3de85e1c9cc /parse.y
parentf3f68873a10c7037e12472d40bb4cec3d575eb35 (diff)
* parse.y (parser_yylex): identfier after dot must not be a variable.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@8008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 790105c..2b41cd5 100644
--- a/parse.y
+++ b/parse.y
@@ -1554,7 +1554,7 @@ primary : literal
nd_set_type($$, NODE_UNTIL);
}
}
- | kUNTIL {COND_PUSH(1);} expr_value do {COND_POP();}
+ | kUNTIL {COND_PUSH(1);} expr_value do {COND_POP();}
compstmt
kEND
{
@@ -3458,7 +3458,7 @@ yylex()
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();
@@ -4334,6 +4334,7 @@ yylex()
{
int result = 0;
+ enum lex_state last_state = lex_state;
switch (tok()[0]) {
case '$':
@@ -4419,6 +4420,7 @@ yylex()
}
yylval.id = rb_intern(tok());
if (is_local_id(yylval.id) &&
+ last_state != EXPR_DOT &&
((dyna_in_block() && rb_dvar_defined(yylval.id)) || local_id(yylval.id))) {
lex_state = EXPR_END;
}