summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-13 05:48:35 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2001-03-13 05:48:35 +0000
commitdfaeaa7f5396c9f6e146e884baf26a77d46ffb19 (patch)
treeba4f9495a33fe062cb3d17c6381b01bbd0fc8f14 /parse.y
parent08aeee61b15fcbd31cd600ea09a1b7991bc82da7 (diff)
* io.c (argf_seek): wrong calling sequence of rb_io_seek().
* parse.y (stmt): while/until modifier must work for empty body. * ruby.c (ruby_set_argv): clear ARGV contents before adding args. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y22
1 files changed, 6 insertions, 16 deletions
diff --git a/parse.y b/parse.y
index 1a64557f1a..29557aa90b 100644
--- a/parse.y
+++ b/parse.y
@@ -360,31 +360,21 @@ stmt : kALIAS fitem {lex_state = EXPR_FNAME;} fitem
| stmt kWHILE_MOD expr
{
value_expr($3);
- if ($1) {
- if (nd_type($1) == NODE_BEGIN) {
- $$ = NEW_WHILE(cond($3), $1->nd_body, 0);
- }
- else {
- $$ = NEW_WHILE(cond($3), $1, 1);
- }
+ if ($1 && nd_type($1) == NODE_BEGIN) {
+ $$ = NEW_WHILE(cond($3), $1->nd_body, 0);
}
else {
- $$ = 0;
+ $$ = NEW_WHILE(cond($3), $1, 1);
}
}
| stmt kUNTIL_MOD expr
{
value_expr($3);
- if ($1) {
- if (nd_type($1) == NODE_BEGIN) {
- $$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
- }
- else {
- $$ = NEW_UNTIL(cond($3), $1, 1);
- }
+ if ($1 && nd_type($1) == NODE_BEGIN) {
+ $$ = NEW_UNTIL(cond($3), $1->nd_body, 0);
}
else {
- $$ = 0;
+ $$ = NEW_UNTIL(cond($3), $1, 1);
}
}
| stmt kRESCUE_MOD stmt