diff options
author | Camil Staps | 2016-08-26 14:00:29 +0200 |
---|---|---|
committer | Camil Staps | 2016-08-26 14:00:29 +0200 |
commit | 5fa8a5684cfb2456b536765b608f0883b1b90029 (patch) | |
tree | 5a85bd4c0089e7f87cabe8614ef356557cd15a63 /interpreter/print.c | |
parent | Added eval_main (diff) |
Added strictness annotations
Diffstat (limited to 'interpreter/print.c')
-rw-r--r-- | interpreter/print.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/interpreter/print.c b/interpreter/print.c index c60c190..3f17475 100644 --- a/interpreter/print.c +++ b/interpreter/print.c @@ -15,6 +15,7 @@ void print_token(token* tk) { case TOKEN_CLOSE_SQ: c = ']'; break; case TOKEN_EQUALS: c = '='; break; case TOKEN_COMMA: c = ','; break; + case TOKEN_STRICT: c = '!'; break; case TOKEN_CODE: printf("code "); return; @@ -37,6 +38,12 @@ void print_token_list(token_list* list) { } void print_expression(expression* expr) { + if (!expr) + return; + + if (expr->is_strict) + printf("!"); + switch (expr->kind) { case EXPR_INT: printf("%d", *((int*) expr->var1)); |