capl-vector icon indicating copy to clipboard operation
capl-vector copied to clipboard

Syntax color cannot handle single quotes

Open nattelog opened this issue 7 years ago • 1 comments

Describe the bug In the case of an expression with a double quote inside two single quotes, i.e. '"', syntax coloring believes the double quote is the start of a new string. The result is that until a new double quote is found, every line is colored as if it was a string.

To Reproduce Write an expression including two single quotes wrapping a double quote, e.g.

if (a == '"') // all following code is colored as a string

Expected behavior Syntax coloring should be able to handle the case when there is a double quote inside two single quote, i.e. '"'.

Screenshots

image

Desktop (please complete the following information):

  • OS: Windows 10
  • CAPL version: 0.1.1
  • VS Code:
    • Version: 1.28.2 (user setup)
    • Commit: 7f3ce96ff4729c91352ae6def877e59c561f4850
    • Date: 2018-10-17T00:23:51.859Z
    • Electron: 2.0.9
    • Chrome: 61.0.3163.100
    • Node.js: 8.9.3
    • V8: 6.1.534.41
    • Architecture: x64

nattelog avatar Nov 14 '18 11:11 nattelog

Similar issue is with double backslash in string constant. String "\" is not correctly recognized as complete and following code is wrongly colored.

tomyknocker avatar Mar 28 '19 12:03 tomyknocker