From 314bcfc67fb95df06c8177cab8792b46b25d90fc Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sat, 24 Sep 2016 10:22:53 +0200 Subject: Working graphs (?) --- interpreter/code.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'interpreter/code.c') diff --git a/interpreter/code.c b/interpreter/code.c index d0b5416..e3cafa7 100644 --- a/interpreter/code.c +++ b/interpreter/code.c @@ -7,14 +7,14 @@ void fill_node_int(struct node** node, int i) { free_node(*node, 1, 0); - (*node)->kind = EXPR_INT; + (*node)->kind = NODE_INT; (*node)->var1 = my_calloc(1, sizeof(int)); *((int*) (*node)->var1) = i; } void fill_node_name(struct node** node, char* s) { free_node(*node, 1, 0); - (*node)->kind = EXPR_NAME; + (*node)->kind = NODE_NAME; (*node)->var1 = my_calloc(1, strlen(s) + 1); strcpy((*node)->var1, s); } @@ -24,14 +24,14 @@ void code_time(struct node** result) { } void code_mul(struct node** result, struct node* a, struct node* b) { - if (a->kind != EXPR_INT || b->kind != EXPR_INT) + if (a->kind != NODE_INT || b->kind != NODE_INT) fill_node_name(result, "mul on non-ints"); else fill_node_int(result, *((int*) a->var1) * *((int*) b->var1)); } void code_sub(struct node** result, struct node* a, struct node* b) { - if (a->kind != EXPR_INT || b->kind != EXPR_INT) + if (a->kind != NODE_INT || b->kind != NODE_INT) fill_node_name(result, "sub on non-ints"); else fill_node_int(result, *((int*) b->var1) - *((int*) a->var1)); -- cgit v1.2.3