ironsheep / P2-vscode-langserv-extension

Spin/Spin2 Language Server based vscode extension
MIT License
1 stars 0 forks source link

Syntax highlighting issue when using inline PASM2 in SPIN2 method #12

Open jrullan opened 3 months ago

jrullan commented 3 months ago

and have you...

Version of Spin2 Language Server VScode Extension with the issue

Version 2.2.18

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Hardware, Operating System, Operating System version, VSCode version

Hardware: Samsung Notebook OS Ver: Windows 11 VSCode Ver: 1.89.1

Version: 1.89.1 (user setup) Commit: dc96b837cf6bb4af9cd736aa3af08cf8279f7685 Date: 2024-05-07T05:13:33.891Z Electron: 28.2.8 ElectronBuildId: 27744544 Chromium: 120.0.6099.291 Node.js: 18.18.2 V8: 12.0.267.19-electron.0 OS: Windows_NT x64 10.0.22631

Description of problem

Example of incorrect coloring of PASM instructions after the second if_z line:

image

Another example, issue after second REP:

image

Additional information


PUB string_to_number(buf):value | val, digits, char_value, subtotal, index
''----------------------------------------
''Converts a string to integer
'' 
'' @param buf - 
'' @returns value - 

' Local Variables:
' @local val - 
' @local digits - 
' @local char_value - 
' @local subtotal - 
' @local index - 
''----------------------------------------
  digits := STRSIZE(buf) - 1
ORG
      MOV index, buf
      CMP digits, #0 wz
if_z  JMP #.last
.loop
      RDBYTE char_value, index wz
if_z  JMP #.end
      MOV val, char_value
      SUB val, #48
      REP #2, digits
      QMUL val, #10
      GETQX val
      ADD subtotal, val
      ADD index, #1
      DJNZ digits, #.loop
.last
      RDBYTE char_value, index
      MOV val, char_value
      SUB val, #48
      ADD subtotal, val
.end
END
  value := subtotal
ironsheep commented 3 months ago

Thanks for reporting this!

That's going to be "fun" to track down. Syntax highlighting bugs are the worst, as I have to figure out why the highlighter disabled itself. (That's not something I wrote.) I specify how to recognize what to color. The greenish parts are all colored by the semantic highlighter (stuff I write). The coloring there says it is still running well. Hmmm...

Adding your example code to my test suite!

I will let you know what I find.