From 9ed6e9af65363ea4c9a6c4a7a3f5898bb554c56a Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Mon, 10 Feb 2020 00:49:45 +0100 Subject: [PATCH] Make `=` a separate token from `SET` This does break backwards compat, but if anyone complains I'm gonna be mad --- src/asm/asmy.y | 5 +++++ src/asm/globlex.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/asm/asmy.y b/src/asm/asmy.y index 862ebcaf..11169634 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -565,6 +565,7 @@ static void strsubUTF8(char *dest, const char *src, uint32_t pos, uint32_t len) %token T_ID %token T_POP_EQU %token T_POP_SET +%token T_POP_EQUAL %token T_POP_EQUS %token T_POP_INCLUDE T_POP_PRINTF T_POP_PRINTT T_POP_PRINTV T_POP_PRINTI @@ -973,6 +974,10 @@ set : T_LABEL T_POP_SET const { sym_AddSet($1, constexpr_GetConstantValue(&$3)); } + | T_LABEL T_POP_EQUAL const + { + sym_AddSet($1, constexpr_GetConstantValue(&$3)); + } ; include : T_POP_INCLUDE string diff --git a/src/asm/globlex.c b/src/asm/globlex.c index 02bf438d..e591cd1a 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -540,7 +540,7 @@ const struct sLexInitString lexer_strings[] = { /* Handled before in list of CPU instructions */ /* {"set", T_POP_SET}, */ - {"=", T_POP_SET}, + {"=", T_POP_EQUAL}, {"pushs", T_POP_PUSHS}, {"pops", T_POP_POPS},