|
|
@@ -256,7 +256,6 @@ BIND* recursive_interpret(NODE *tree, ENV *env_ptr) {
|
|
256
|
256
|
if(debug)printf("I got: ");
|
|
257
|
257
|
if (var_bind->tree->type == CONSTANT) {
|
|
258
|
258
|
if(debug){
|
|
259
|
|
- printf("CONSTANT\n");
|
|
260
|
259
|
print_leaf(var_bind->tree, 0);
|
|
261
|
260
|
}
|
|
262
|
261
|
} else {
|
|
|
@@ -315,6 +314,7 @@ BIND* recursive_interpret(NODE *tree, ENV *env_ptr) {
|
|
315
|
314
|
return ret_val;
|
|
316
|
315
|
} else {
|
|
317
|
316
|
printf("HELP called a function with no return!!\n");
|
|
|
317
|
+ exit(1);
|
|
318
|
318
|
}
|
|
319
|
319
|
}
|
|
320
|
320
|
if (tree->type == IF) {
|
|
|
@@ -376,7 +376,7 @@ BIND* recursive_interpret(NODE *tree, ENV *env_ptr) {
|
|
376
|
376
|
if (debug) printf("Adding %d and %d\n", lhs->value, rhs->value);
|
|
377
|
377
|
int result = lhs->value + rhs->value;
|
|
378
|
378
|
return anon_binding((NODE*) get_int_token(result));
|
|
379
|
|
- }
|
|
|
379
|
+ }
|
|
380
|
380
|
if (tree->type == '-') {
|
|
381
|
381
|
TOKEN* lhs = (TOKEN*) recursive_interpret(tree->left, env_ptr)->tree;
|
|
382
|
382
|
TOKEN* rhs = (TOKEN*) recursive_interpret(tree->right, env_ptr)->tree;
|