Open strattonbrazil opened 5 years ago
This is a tough one – node
handles it ostensibly by assigning the result of the expression to $_
and printing $_
. That won't work in BrightScript because – unlike JavaScript – BrightScript Doesn't support right-associative assignments (e.g. let foo = bar = baz = qux;
).
This might require a separate parser entirely, or maybe a separate mode for the parser? Not too sure yet.
Right now if the brightscript runtime executes a file, it will execute every expression it finds outside of a function. This doesn't match the brightscript implementation where expressions must be inside functions.
which raises a syntax error the following error:
Should we match the device implementation and look for a main function, or should we enable a flag to toggle it so we can still run expressions in the REPL?