mvbasic icon indicating copy to clipboard operation
mvbasic copied to clipboard

[BUG] Syntax Highlighting Incorrect When Using Backslash ('\') to Delineate String Literals

Open RDGInfoSys opened this issue 3 years ago • 1 comments

Describe the bug A number of mvBASIC flavors support the use of backslashes ('') to delineate string literals for example: A.STRING = \It's easy to use single (') and double (") quotes when using backslashes to define strings\

Unfortunately, the MV Basic Extension doesn't track the string inside the backslashes and unmatched single and double quotes continue to disrupt syntax highlighting throughout the rest of the code.

To Reproduce Steps to reproduce the behavior:

  1. Use backslashes to delineate a string literal
  2. See error

Expected behavior Syntax highlighting when backslashes to define string literals should behave the same way as it currently does if single or double quotes are nested inside string literals.

Screenshots Screen Shot 2022-03-10 at 5 33 17 PM

Versions of applicable software Detail on the versions of any and all pieces of software that are part of your environment, such as:

  • Host OS : Windows 10 Enterprise
  • Remote OS: n/a
  • Extension: MV Basic 2.1.3
  • IDE: VS Code 1.65.0

Code samples and/or reproducible test cases STRING1 = \Here is a string with a single quote: '\ STRING2 = \Here is a string with a double quote: "\ IF STRING1 = STRING2 THEN CRT "I shouldn't see this" ELSE CRT 'I should see "this".' END

Additional context n/a

RDGInfoSys avatar Mar 10 '22 23:03 RDGInfoSys

This also breaks variable name completion when the extension thinks the insertion point is inside a string when it actually isn't.

RDGInfoSys avatar Mar 11 '22 00:03 RDGInfoSys