mattgodbolt / owlet-editor

A modern BBC BASIC editor inspired by the BBC Micro Bot (https://bbcmicrobot.com)
https://bbcmic.ro
54 stars 4 forks source link

Incorrect syntax highlighting for "hidden" opening parentheses #114

Open ojwb opened 1 week ago

ojwb commented 1 week ago

Example:

https://bbcmic.ro/#%7B%22v%22%3A1%2C%22program%22%3A%22A%24%3D%5C%22OWLET%5C%22%3AP.RI.A%24%2C1%29LE.A%24%2C2%29MI.A%24%2C4%2C1%29MI.A%24%2C3%2C1%29%22%7D

RI. is an abbreviation for RIGHT$( (so there's an open parenthesis but it's "hidden") - however owlet colours the corresponding closing ) in red because it thinks there's a missing opening ( (and similarly for all such cases it seems).

It seems bracket syntax highlighting uses a builtin feature of the editor component so this may not be easy to fix:

brackets: [["(", ")", "delimiter.parenthesis"]],