[papert commit] r130 - fixing recursion limit to restore tail in tail recursive case

6 views
Skip to first unread message

codesite...@google.com

unread,
Mar 25, 2009, 9:19:29 PM3/25/09
to paper...@googlegroups.com
Author: thomas.figg
Date: Wed Mar 25 18:18:08 2009
New Revision: 130

Modified:
trunk/index.yaml
trunk/static/logo.js

Log:
fixing recursion limit to restore tail in tail recursive case

Modified: trunk/index.yaml
==============================================================================
--- trunk/index.yaml (original)
+++ trunk/index.yaml Wed Mar 25 18:18:08 2009
@@ -10,7 +10,7 @@
# automatically uploaded to the admin console when you next deploy
# your application using appcfg.py.

-# Used 12 times in query history.
+# Unused in query history -- copied from input.
- kind: LogoProgram
properties:
- name: date

Modified: trunk/static/logo.js
==============================================================================
--- trunk/static/logo.js (original)
+++ trunk/static/logo.js Wed Mar 25 18:18:08 2009
@@ -593,14 +593,16 @@
rec_depth = this.depth;
while (1) { // revursive
if (this.depth > this.maxdepth) {
- this.depth = rec_depth;
+ this.values = par; // restore the original stack
+ f.code.push(tail); // restore the original tail.
+ this.depth=rec_depth;
return new Token('error', 'too much recursion');
}
+
this.depth++;
-
this.values = newvalues;
var result = this.eval_list(f.code);
-
+
if (result && (result.type == "stop" || result.type
== "error")) {
this.values = par; // restore the original stack
f.code.push(tail); // restore the original tail.

Reply all
Reply to author
Forward
0 new messages