summaryrefslogtreecommitdiffstats
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
commit31230ec3de8249cb2a0d1fb11ae87853b2d2edd4 (patch)
treea65171fc36999a1cc3c537a0b8bf62ddd9b16f77 /parse.y
parent1258af1e28d321ce14e1ba5e342ccc279e081f18 (diff)
downloadruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.tar.gz
ruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.tar.xz
ruby-31230ec3de8249cb2a0d1fb11ae87853b2d2edd4.zip
* 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: http://svn.ruby-lang.org/repos/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 e43f3fe03..c51e9ed1f 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;
}