rhaiscript / vscode-rhai

Rhai language support for Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=rhaiscript.vscode-rhai
Mozilla Public License 2.0
19 stars 0 forks source link

breaking syntax highlighting in switch #6

Open burrbull opened 1 year ago

burrbull commented 1 year ago

If switch branch contents several values syntax highlighting breaks after | and restores after next one.

switch val {
                128 | 256 => 64,
                384 | 512 => 96,
            }
schungx commented 1 year ago

Hhhmmm.... seems that an even number of items doesn't allow it to recover. An odd number of items can be recovered.

And a simple expression x | y with two terms also doesn't work, so this must be a particular issue with the | operator.

It is likely to be a conflict with the | x, y | ... closure syntax...

As I'm not really an expert in writing syntax highlighting expressions... I'm not sure how this can be fixed.