1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* parse.y (value_expr_gen): reverted r12880. [ruby-dev:33388]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-01-27 13:55:29 +00:00
parent 7889fdd1e6
commit 526ab1f0d1
3 changed files with 10 additions and 3 deletions

View file

@ -1,3 +1,7 @@
Sun Jan 27 22:55:27 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* parse.y (value_expr_gen): reverted r12880. [ruby-dev:33388]
Sun Jan 27 22:33:39 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sprintf.c (rb_str_format): fix for octal with precision.

View file

@ -540,8 +540,8 @@ assert_equal %q{1}, %q{
class << (ary=[]); def []; 0; end; def []=(x); super(0,x);end;end; ary[]+=1
}, '[ruby-dev:31110]'
assert_syntax_error "Can't set variable $1", %q{0..$1=1}, '[ruby-dev:31118]'
assert_syntax_error "void value expression", %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
assert_syntax_error "void value expression", %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
assert_valid_syntax %q{1.times{1+(1&&next)}}, '[ruby-dev:31119]'
assert_valid_syntax %q{x=-1;loop{x+=1&&redo if (x+=1).zero?}}, '[ruby-dev:31119]'
assert_syntax_error %q{syntax error, unexpected $end}, %q{!}, '[ruby-dev:31243]'
assert_equal %q{[nil]}, %q{[()]}, '[ruby-dev:31252]'
assert_equal %q{true}, %q{!_=()}, '[ruby-dev:31263]'

View file

@ -7831,6 +7831,8 @@ node_assign_gen(struct parser_params *parser, NODE *lhs, NODE *rhs)
static int
value_expr_gen(struct parser_params *parser, NODE *node)
{
int cond = 0;
if (!node) {
rb_warning0("empty expression");
}
@ -7846,7 +7848,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
case NODE_NEXT:
case NODE_REDO:
case NODE_RETRY:
yyerror("void value expression");
if (!cond) yyerror("void value expression");
/* or "control never reach"? */
return Qfalse;
@ -7868,6 +7870,7 @@ value_expr_gen(struct parser_params *parser, NODE *node)
case NODE_AND:
case NODE_OR:
cond = 1;
node = node->nd_2nd;
break;