From dc1914b9ed4db5bc4175a49c4d4a03e82ea046d4 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sun, 21 Aug 2022 00:36:05 +0100 Subject: [PATCH] Resolved #13 --- scripts/empty.toy | 8 ++------ source/literal.c | 3 ++- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/scripts/empty.toy b/scripts/empty.toy index 3766a55..b727c01 100644 --- a/scripts/empty.toy +++ b/scripts/empty.toy @@ -1,9 +1,5 @@ //BUG: this causes a strange error message -if (true) { - ; -} -else { - ; -} \ No newline at end of file +if (true); +else; diff --git a/source/literal.c b/source/literal.c index 1fddebc..8826e7f 100644 --- a/source/literal.c +++ b/source/literal.c @@ -381,7 +381,8 @@ bool literalsAreEqual(Literal lhs, Literal rhs) { } switch(lhs.type) { - //NOTE: null covered by check at the top of the function + case LITERAL_NULL: + return true; //can only be true because of the check above case LITERAL_BOOLEAN: return AS_BOOLEAN(lhs) == AS_BOOLEAN(rhs);