Lexer with nested comments?

Matic Kukovec kukovecmatic at hotmail.com
Tue Nov 23 09:45:39 GMT 2021


Hi guys,

Is it possible to implement nested comments in a QSciLexerCustom?
I see that lexers like QSciLexerD have a CommentNested enum, but they cannot be stacked,
it only looks at the first "/*" and last "*/". So if you do for example this:
/*
    my first comment here
/*
    my nested comment here
*/     <- comment stops here regardless that there are two nested "/*" above it

Now this could be solved by always parsing the entire text and counting the nestings,
but that is inefficient for anything but a tiny amount of text.

Is this solvable?

Thanks
Matic

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20211123/8d966680/attachment.htm>


More information about the QScintilla mailing list