-
Notifications
You must be signed in to change notification settings - Fork 127
Closed
Description
Try the following basic program:
print MEM - 1;
this results in:
NIL
Error:
Ln 1, Col 11
Code 30, Abort Code 3
Message: Colon expected.
The culprit seems to be line 5760 in my_basic.c
if(!context->last_symbol ||
(context->last_symbol && ((context->last_symbol->type == _DT_FUNC && context->last_symbol->data.func->pointer != _core_close_bracket) ||
context->last_symbol->type == _DT_SEP || context->last_symbol->type == _DT_EOS))) {
This test recognizes the last symbol (MEM) as a function, so the following - (minus) is recognized as _core_neg instead of _core_sub.
Replacing the part (context->last_symbol->type == _DT_FUNC && context->last_symbol->data.func->pointer != _core_close_bracket)
with (context->last_symbol->type == _DT_FUNC && context->last_symbol->data.func->pointer != _core_close_bracket && context->last_symbol->data.func->pointer != _core_mem)
works, but I'm not sure whether it's the right way to fix it.
Metadata
Metadata
Assignees
Labels
No labels