Bug fix to returning values inside of a loop
This commit is contained in:
parent
494335fb09
commit
26f5d25243
@ -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();
|
||||
|
@ -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\
|
||||
|
Loading…
x
Reference in New Issue
Block a user