mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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:
parent
85d105cf8c
commit
4c6b76c1e4
3 changed files with 14 additions and 7 deletions
|
@ -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
|
||||
obj.extend(Sync_m)
|
||||
|
|
11
parse.y
11
parse.y
|
@ -426,6 +426,9 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
|
|||
}
|
||||
| lhs '=' mrhs_basic
|
||||
{
|
||||
if (nd_type($3) == NODE_RESTARGS) {
|
||||
nd_set_type($3, NODE_REXPAND);
|
||||
}
|
||||
$$ = node_assign($1, $3);
|
||||
}
|
||||
| mlhs '=' mrhs
|
||||
|
@ -1147,7 +1150,7 @@ mrhs_basic : args ',' arg
|
|||
| tSTAR arg
|
||||
{
|
||||
value_expr($2);
|
||||
$$ = NEW_REXPAND($2);
|
||||
$$ = NEW_RESTARGS($2);
|
||||
}
|
||||
|
||||
primary : literal
|
||||
|
@ -1212,8 +1215,9 @@ primary : literal
|
|||
}
|
||||
| tLBRACK aref_args ']'
|
||||
{
|
||||
if ($2 == 0)
|
||||
if ($2 == 0) {
|
||||
$$ = NEW_ZARRAY(); /* zero length array*/
|
||||
}
|
||||
else {
|
||||
$$ = $2;
|
||||
}
|
||||
|
@ -3719,8 +3723,7 @@ yylex()
|
|||
}
|
||||
if (kw->id[0] == kDO) {
|
||||
if (COND_P()) return kDO_COND;
|
||||
if (CMDARG_P() && state != EXPR_CMDARG && state != EXPR_ARG)
|
||||
return kDO_BLOCK;
|
||||
if (CMDARG_P()) return kDO_BLOCK;
|
||||
return kDO;
|
||||
}
|
||||
if (state == EXPR_BEG)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#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_RELEASE_CODE 20010606
|
||||
#define RUBY_RELEASE_CODE 20010607
|
||||
|
|
Loading…
Reference in a new issue