@Chris-Mckevitt
Scintilla is the component which
is used by notepad++ to do all the coloring, folding, styling, … stuff of your language.
A lexer is the component which calculates which parts should be colored, folded, styled etc…
Scintilla itself has already a lot of builtin lexers but it also provides an interface for writing
own lexers e.g. the UDL from npp. Those lexers are written by different programmers,
although they may use the same scintilla version they are slightly different in functionality
and representation. E.g. put the following python code into a doc and set the lexer to python
def foo():
# comment
pass
you will see that folding starts from line 1 and includes line 3.
Use this vbs code and do the same (except you want select visual basic as lexer)
Sub Foo()
'comment
End Sub
You will see that folding starts also at line 1 but doesn’t include the last line.
Even more critical is when pasting this, which from vbs syntax view is absolutely ok, into a doc.
Sub Foo()
'comment
End Sub
This results in no folding at all. Why? Because the visual basic lexer programmer decided to
write the folding logic based on indention and not doing complex code analysis.
Which is fine, as long as the vbs user does the same kind of code styling.
So you see, even if one of the language lexer you use behaves the way you like,
there is no guarantee that others act the same.
When you want to write your own lexer than I would recommend to check the code of one of the existing lexers.
This Gmod LUA plugin is known to be a good example but must admit that I never used or checked the code myself.
Cheers
Claudia