newdatasystems / vscode-foxpro

VSCode Extension for the Microsoft Visual Foxpro programming language
MIT License
20 stars 5 forks source link

Parse TEXT ... ENDTEXT section as a big string #7

Closed ted537 closed 1 year ago

ted537 commented 1 year ago

This properly handles lone quote characters within TEXT ... ENDTEXT blocks, which would otherwise interpret the rest of the PRG file as one giant string.

Example

Even Github gets this one somewhat wrong.

PROCEDURE hi

hi

ENDPROC

INSERT H TO 

TEXT TO dsakldjlakj
"ok sick
Even t

ENDTEXT

v = "hi there"
m.somevar = "Now imagine there are 7000 lines here. I'd like for the syntax highlighting to work after ENDTEXT :)"

Note

This does make the parsing of the keywords after TEXT a bit less intelligent, but I think that's a small price to pay for the cases which this fixes.

ted537 commented 1 year ago

Ah -- it appears this does break in a few places. The regex likely needs to be tuned to require that TEXT is found at the start of a line.