Bug fix to returning values inside of a loop

This commit is contained in:
Jonathan Turner 2009-07-06 13:01:28 +00:00
parent 494335fb09
commit 26f5d25243
2 changed files with 3 additions and 2 deletions

View File

@ -556,8 +556,9 @@ namespace chaiscript
retval = eval_token(ss, node->children[i]);
}
catch (const chaiscript::ReturnValue &rv) {
ss.pop_scope();
retval = rv.retval;
break;
throw;
}
catch (...) {
ss.pop_scope();

View File

@ -139,7 +139,7 @@ def generate_range(x, y) { \n\
var i = x; \n\
var retval = Vector(); \n\
while (i <= y) { \n\
retval.push_back(clone(i)); \n\
retval.push_back(i); \n\
++i; \n\
} \n\
retval \n\