summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-26 15:09:26 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-04-26 15:09:26 +0000
commit56a18860daa1a34094e81cb68b45756617d04eab (patch)
treea19a220456cd55bfca2da1bf811b31c1e6bf9e15
parenta90469602c82fe0fe607cc6f1c8f32b223db0394 (diff)
* parse.y (program): check void_expr when rb_parse_in_main().
[ruby-dev:38717] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--parse.y5
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 9026aec65f..486ec517f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Tue Apr 27 00:07:32 2010 Yusuke Endoh <mame@tsg.ne.jp>
+
+ * parse.y (program): check void_expr when rb_parse_in_main().
+ [ruby-dev:38717]
+
Mon Apr 26 20:11:05 2010 Tadayoshi Funaba <tadf@dotrb.org>
* complex.c, rational.c, lib/cmath.rb, lib/date.rb lib/date/delta*:
diff --git a/parse.y b/parse.y
index 8dd7de3bda..52de93e8fe 100644
--- a/parse.y
+++ b/parse.y
@@ -786,8 +786,7 @@ static void token_info_pop(struct parser_params*, const char *token);
program : {
lex_state = EXPR_BEG;
/*%%%*/
- $<num>$ = compile_for_eval || rb_parse_in_main();
- local_push($<num>$);
+ local_push(compile_for_eval || rb_parse_in_main());
/*%
local_push(0);
%*/
@@ -795,7 +794,7 @@ program : {
top_compstmt
{
/*%%%*/
- if ($2 && !$<num>1) {
+ if ($2 && !compile_for_eval) {
/* last expression should not be void */
if (nd_type($2) != NODE_BLOCK) void_expr($2);
else {