diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-09 06:16:43 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-01-09 06:16:43 +0000 |
| commit | 8645250f3d8a823e0e9a1d264bd1b7936ba1f2c6 (patch) | |
| tree | dfef5085206eb64aeeadb052b39ef0da1c7dcf09 /eval.c | |
| parent | aa37b208eb2ed61f2289267d64e754df986e4235 (diff) | |
| download | ruby-8645250f3d8a823e0e9a1d264bd1b7936ba1f2c6.tar.gz ruby-8645250f3d8a823e0e9a1d264bd1b7936ba1f2c6.tar.xz ruby-8645250f3d8a823e0e9a1d264bd1b7936ba1f2c6.zip | |
* parse.y (stmt): NODE_NOT elimitation for if/unless/while/until node.
* parse.y (primary): ditto.
* eval.c (rb_eval): reduce recursive rb_eval() call by using sort
of continuation passing style.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@3314 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
| -rw-r--r-- | eval.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -2209,6 +2209,7 @@ rb_eval(self, n) VALUE self; NODE *n; { + NODE * volatile contnode = 0; NODE * volatile node = n; int state; volatile VALUE result = Qnil; @@ -2224,10 +2225,10 @@ rb_eval(self, n) ruby_current_node = node; switch (nd_type(node)) { case NODE_BLOCK: - while (node->nd_next) { - rb_eval(self, node->nd_head); - node = node->nd_next; + if (contnode) { + rb_bug("nested NODE_BLOCK"); } + contnode = node->nd_next; node = node->nd_head; goto again; @@ -3391,7 +3392,6 @@ rb_eval(self, n) break; case NODE_NEWLINE: - ruby_sourceline = node->nd_nth; if (trace_func) { call_trace_func("line", node, self, ruby_frame->last_func, @@ -3405,6 +3405,11 @@ rb_eval(self, n) } finish: CHECK_INTS; + if (contnode) { + node = contnode; + contnode = 0; + goto again; + } return result; } @@ -4304,7 +4309,7 @@ rb_with_disable_interrupt(proc, data) return result; } -static void +static inline void stack_check() { static int overflowing = 0; |
