From 035649bd637d3bd60c496e82225cbce4ea16360d Mon Sep 17 00:00:00 2001 From: cozis Date: Tue, 2 Nov 2021 14:03:07 +0000 Subject: [PATCH] minor cleanups --- samples/if-else.noja | 8 +++++--- samples/if-else2.noja | 5 +++++ src/compiler/parse.c | 3 --- src/main.c | 2 -- 4 files changed, 10 insertions(+), 8 deletions(-) create mode 100644 samples/if-else2.noja diff --git a/samples/if-else.noja b/samples/if-else.noja index 37aaba7..230ec61 100644 --- a/samples/if-else.noja +++ b/samples/if-else.noja @@ -1,8 +1,10 @@ p = (false); -if p: - a = 1; -else +if p: + { + a = 1; + } +else a = 2; print(a); diff --git a/samples/if-else2.noja b/samples/if-else2.noja new file mode 100644 index 0000000..b4b3045 --- /dev/null +++ b/samples/if-else2.noja @@ -0,0 +1,5 @@ + +if false: + a = 33; + +print(a, '\n'); \ No newline at end of file diff --git a/src/compiler/parse.c b/src/compiler/parse.c index 13d2477..b3658ad 100644 --- a/src/compiler/parse.c +++ b/src/compiler/parse.c @@ -375,9 +375,6 @@ static inline _Bool done(Context *ctx) return current(ctx) == TDONE; } -#warning "TEMP" -#include - static Node *parse_statement(Context *ctx) { assert(ctx != NULL); diff --git a/src/main.c b/src/main.c index ffac6d1..d293088 100644 --- a/src/main.c +++ b/src/main.c @@ -22,8 +22,6 @@ typedef struct { const char *input, *output; } Options; -_Bool debug_callback(Runtime *runtime, void *userp); - static int parse_args(Options *opts, int argc, char **argv, Error *error) { assert(argc >= 0);