diff --git a/link.cpp b/link.cpp index 209fb64..3a99c1e 100644 --- a/link.cpp +++ b/link.cpp @@ -713,10 +713,11 @@ void evaluate(label_t label, opcode_t opcode, operand_t operand) { char *cp = fgets(buffer, sizeof(buffer), stdin); if (!cp) return; - uint32_t value = 0; - // evaluate string. expressions and labels are allowed.... - define(label, value, LBL_KBD); + operand_t number_operand(const char *YYCURSOR, bool required); + operand_t op = number_operand(cp, true); + + define(label, eval(op), LBL_KBD); break; } diff --git a/script.re2c b/script.re2c index dee9fa6..fe6cb61 100644 --- a/script.re2c +++ b/script.re2c @@ -179,8 +179,8 @@ exit: - -static operand_t number_operand(const char *YYCURSOR, bool required = true) { +/* not static - called from link.cpp */ +operand_t number_operand(const char *YYCURSOR, bool required = true) { const char *iter = YYCURSOR; // const char *YYMARKER = nullptr;