From 7e2a67275379e41bf453fd4e82492f2b633ab21d Mon Sep 17 00:00:00 2001 From: suchmememanyskill Date: Mon, 4 Jan 2021 18:27:17 +0100 Subject: [PATCH] [script] fix == not working --- source/script/functions.c | 2 +- source/script/lexer.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/script/functions.c b/source/script/functions.c index d84d3cb..cc19cea 100644 --- a/source/script/functions.c +++ b/source/script/functions.c @@ -233,8 +233,8 @@ scriptFunction(funcWait){ u32 timer = get_tmr_ms(); while (timer + vars[0].integerType > get_tmr_ms()){ gfx_printf(" \r", (vars[0].integerType - (get_tmr_ms() - timer)) / 1000); + hidRead(); } - gfx_putc('\n'); return NullVar; } diff --git a/source/script/lexer.c b/source/script/lexer.c index ecb3308..3b4bf27 100644 --- a/source/script/lexer.c +++ b/source/script/lexer.c @@ -162,6 +162,12 @@ Vector_t runLexar(const char* in, u32 len) { vecAddElement(&vec, makeLexarToken(LSBracket, 0)); } ELIFC('=') { // Do we need to keep = if the vars are assignments anyway? + if (in[1] == '='){ + vecAddElement(&vec, makeLexarToken(EqualEqual, 0)); + in++; + continue; + } + if (lx[vec.count - 1].token == Variable) lx[vec.count - 1].token = VariableAssignment;