* parse.y (yylex): exclude kDO_BLOCK too much by false condition.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1514 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2001-06-07 08:29:59 +00:00
parent 85d105cf8c
commit 4c6b76c1e4
3 changed files with 14 additions and 7 deletions

View File

@ -1,4 +1,8 @@
Wed Jun 6 23:02:36 2001 Keiju Ishitsuka <keiju@ishitsuka.com> Thu Jun 7 17:28:00 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (yylex): exclude kDO_BLOCK too much by false condition.
Wed Jun 6 23:02:36 2001 Keiju Ishitsuka <keiju@ishitsuka.com>
* lib/sync.rb: bug fix if obj.initialize has parameters when * lib/sync.rb: bug fix if obj.initialize has parameters when
obj.extend(Sync_m) obj.extend(Sync_m)

11
parse.y
View File

@ -426,6 +426,9 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
} }
| lhs '=' mrhs_basic | lhs '=' mrhs_basic
{ {
if (nd_type($3) == NODE_RESTARGS) {
nd_set_type($3, NODE_REXPAND);
}
$$ = node_assign($1, $3); $$ = node_assign($1, $3);
} }
| mlhs '=' mrhs | mlhs '=' mrhs
@ -1147,7 +1150,7 @@ mrhs_basic : args ',' arg
| tSTAR arg | tSTAR arg
{ {
value_expr($2); value_expr($2);
$$ = NEW_REXPAND($2); $$ = NEW_RESTARGS($2);
} }
primary : literal primary : literal
@ -1212,8 +1215,9 @@ primary : literal
} }
| tLBRACK aref_args ']' | tLBRACK aref_args ']'
{ {
if ($2 == 0) if ($2 == 0) {
$$ = NEW_ZARRAY(); /* zero length array*/ $$ = NEW_ZARRAY(); /* zero length array*/
}
else { else {
$$ = $2; $$ = $2;
} }
@ -3719,8 +3723,7 @@ yylex()
} }
if (kw->id[0] == kDO) { if (kw->id[0] == kDO) {
if (COND_P()) return kDO_COND; if (COND_P()) return kDO_COND;
if (CMDARG_P() && state != EXPR_CMDARG && state != EXPR_ARG) if (CMDARG_P()) return kDO_BLOCK;
return kDO_BLOCK;
return kDO; return kDO;
} }
if (state == EXPR_BEG) if (state == EXPR_BEG)

View File

@ -1,4 +1,4 @@
#define RUBY_VERSION "1.7.1" #define RUBY_VERSION "1.7.1"
#define RUBY_RELEASE_DATE "2001-06-06" #define RUBY_RELEASE_DATE "2001-06-07"
#define RUBY_VERSION_CODE 171 #define RUBY_VERSION_CODE 171
#define RUBY_RELEASE_CODE 20010606 #define RUBY_RELEASE_CODE 20010607