overturetool / vdm-vscode

Visual Studio Code extension for VDM language support
GNU General Public License v3.0
21 stars 6 forks source link

Problem with syntax highlighting on char literals #190

Open JaScMiller opened 2 years ago

JaScMiller commented 2 years ago

Character literals seem to break subsequent syntax highlighting (see picture 1).

Sometimes it seems to fix itself later, I have not been able to discern how/why (see picture 2).

I tried switching themes but it seems to be a case on each.

image

image

JaScMiller commented 2 years ago

Ah, it is the use of a double quotes within a single quote, escaping the double quote does fix the single quote highlighting, but then creates a new issue:

image

image

nickbattle commented 2 years ago

Ah yes, you can imagine the colouring rules are confused by quotes within quotes. Thanks for reporting this. We'll take a look at the highlighting rules. In the meantime, if it's too annoying, I think you can achieve the same effect using a unicode character code - y = '\u0022'.

nickbattle commented 1 month ago

@MarkusEllyton Note that this seems to still be broken for single quotes appearing in variable names. See email.

functions
    name' : nat -> nat   <--- the quote here carries brown across until the next line!
    name'(a) == a + 1;