summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-04 07:34:19 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-06-04 07:34:19 +0000
commitb7bc0cae539617af4dfac5b44b0ebd700efe2084 (patch)
treea65171fc36999a1cc3c537a0b8bf62ddd9b16f77 /parse.y
parent4cb164ee2a30ecb59ce93670e569f384c7da7521 (diff)
* string.c (rb_str_aset): should raise error if an indexing string
is not found in the receiver. * sprintf.c (rb_f_sprintf): "%d" should convert objects into integers using Integer(). * lib/tempfile.rb (Tempfile::size): added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y10
1 files changed, 8 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index e43f3fe031..c51e9ed1f6 100644
--- a/parse.y
+++ b/parse.y
@@ -281,7 +281,6 @@ static void top_local_setup();
%%
program : {
- $<vars>$ = ruby_dyna_vars;
lex_state = EXPR_BEG;
top_local_init();
if ((VALUE)ruby_class == rb_cObject) class_nest = 0;
@@ -303,7 +302,6 @@ program : {
ruby_eval_tree = block_append(ruby_eval_tree, $2);
top_local_setup();
class_nest = 0;
- ruby_dyna_vars = $<vars>1;
}
;
@@ -2170,6 +2168,7 @@ yycompile(f, line)
{
int n;
NODE *node = 0;
+ struct RVarmap *vp, *vars = ruby_dyna_vars;
if (!compile_for_eval && rb_safe_level() == 0 &&
rb_const_defined(rb_cObject, rb_intern("SCRIPT_LINES__"))) {
@@ -2210,6 +2209,13 @@ yycompile(f, line)
in_def = 0;
cur_mid = 0;
+ vp = ruby_dyna_vars;
+ ruby_dyna_vars = vars;
+ while (vp && vp != vars) {
+ struct RVarmap *tmp = vp;
+ vp = vp->next;
+ rb_gc_force_recycle((VALUE)tmp);
+ }
if (n == 0) node = ruby_eval_tree;
return node;
}