zufuliu / notepad4

Notepad4 (Notepad2⨯2, Notepad2++) is a light-weight Scintilla based text editor for Windows with syntax highlighting, code folding, auto-completion and API list for many programming languages and documents, bundled with file browser plugin matepath.
Other
2.56k stars 179 forks source link

bas : line extend character _ in comments #716

Open meteorquake opened 11 months ago

meteorquake commented 11 months ago

In vba type languages a comment ending in (space) continues the comment on the next line (as with any use of the ending) So the line(s) that follow need to be colourised as comment. Currently this doesn't happen. Practically speaking, this becomes relevant when you have a line that's extended using _ and comment it off with a ' in front of its opening.

Example :-

' Comment _ comment not a comment

David

zufuliu commented 11 months ago

Line continuation is not handled: https://github.com/zufuliu/notepad2/blob/12c61ddcf384c8b45505f42f65c62c6c08fe55f8/scintilla/lexers/LexVB.cxx#L184-L189

https://learn.microsoft.com/en-us/dotnet/visual-basic/reference/language-specification/lexical-grammar#line-continuation

LineContinuation
    : WhiteSpace '_' WhiteSpace* LineTerminator
    ;