Closed ojwb closed 3 weeks ago
This is going to be a fun one to do :) Context-sensitivity of symbols is a bit more fun in the (editor) tokeniser.
It seems :
doesn't end the content of a REM
so perhaps *
can work like that does?
That's not the problem, it's discriminating *
in the middle of a line (3*2
) vs one at the start or after a colon. REM
is always REM
(in theory). I think we'll need to make the editor tokeniser have a mode for "First part of a statement" vs the rest, to solve this.
Oh I see - I was thinking you meant the context-sensitivity of :
.
Yes, the Start flag
in the token table seems the right thing for this - it even mentions *
:
*
- disables the tokeniser if encountered at the start of the statement.
With a new version of monaco, we should be able to do this: https://github.com/microsoft/monaco-editor/issues/2265
(the change to look for being merged is https://github.com/microsoft/vscode/commit/5cc0aa284968c66b0075ac3b89a70c2edb10b891 )
Still present - here's a better reproducer (*.:0
is actually a useful command, at least if there's a disc in the drive) as a handy URL:
https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22*.%3A0%22%7D
Currently the highlighter seems to switch back to BASIC if it sees a
:
in a*
command: