diff options
Diffstat (limited to 'interpreter')
-rw-r--r-- | interpreter/.gitignore | 2 | ||||
-rw-r--r-- | interpreter/Makefile | 2 | ||||
-rw-r--r-- | interpreter/code.h | 3 | ||||
-rw-r--r-- | interpreter/print.c | 5 |
4 files changed, 4 insertions, 8 deletions
diff --git a/interpreter/.gitignore b/interpreter/.gitignore index 165017a..ea6faae 100644 --- a/interpreter/.gitignore +++ b/interpreter/.gitignore @@ -1,4 +1,2 @@ *.o -graph-*.png -graph-*.dot fuspel diff --git a/interpreter/Makefile b/interpreter/Makefile index 61be68d..8edcabe 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -1,4 +1,4 @@ -CFLAGS=-Werror -Wall -Wextra +CFLAGS=-Werror -Wall -Wextra -O3 DEPS=lex.h syntax.h print.h parse.h log.h eval.h mem.h code.h graphs.h OBJ=fuspel.o lex.o syntax.o print.o parse.o log.o eval.o mem.o code.o graphs.o diff --git a/interpreter/code.h b/interpreter/code.h index d139fb1..144a7c3 100644 --- a/interpreter/code.h +++ b/interpreter/code.h @@ -10,7 +10,4 @@ typedef void (Code_2) (struct node**, struct node*, struct node*); unsigned char code_find(char* name, void** function); -void code_mul(struct node** result, struct node* a, struct node* b); -void code_sub(struct node** result, struct node* a, struct node* b); - #endif diff --git a/interpreter/print.c b/interpreter/print.c index 78976c2..d410ba2 100644 --- a/interpreter/print.c +++ b/interpreter/print.c @@ -9,7 +9,7 @@ #include "mem.h" void print_token(token* tk) { - char c; + char c = NULL; switch (tk->kind) { case TOKEN_SEMICOLON: c = ';'; break; case TOKEN_COLON: c = ':'; break; @@ -28,7 +28,8 @@ void print_token(token* tk) { printf("%d", *((int*) tk->var)); return; } - printf("%c", c); + if (c) + printf("%c", c); } void print_token_list(token_list* list) { |