Fix up some broken sample files

This commit is contained in:
Jonathan Turner 2009-12-02 14:29:42 +00:00
parent 636c55493c
commit ac8462fb67
4 changed files with 4 additions and 5 deletions

View File

@ -982,9 +982,10 @@ namespace chaiscript
Boxed_Value eval_block(Eval_System &ss, const TokenPtr &node) {
Boxed_Value retval;
unsigned int i;
unsigned int num_children = node->children.size();
ss.new_scope();
for (i = 0; i < node->children.size(); ++i) {
for (i = 0; i < num_children; ++i) {
try {
retval = eval_token(ss, node->children[i]);
}

View File

@ -1586,7 +1586,6 @@ namespace chaiscript
if (Operator_Helper(precedence)) {
do {
if (!Operator(precedence+1)) {
std::cout << std::string(input_pos, input_end);
throw Eval_Error("Incomplete " + std::string(token_type_to_string(operators[precedence])) + " expression",
File_Position(line, col), filename);
}

View File

@ -1,3 +1,2 @@
var i = 1
var j = eval("5 + 4")
print(j)

View File

@ -2,11 +2,11 @@ for (var i = 0; i < 10; ++i) {
print(i)
}
for (i = 10; i >= 0; i -= 2) {
for (var i = 10; i >= 0; i -= 2) {
print(i)
}
i = 0
var i = 0
for (; i < 5; ++i) {
print(i)