Closed jeremybobbin closed 1 year ago
There are two possible approaches to this:
Define a "sub" lexer for strings and try to integrate it using embed_lexer
. I'm not sure whether that will actually work when the start and end rule are the same, though.
Introduce some concept of "stacked lexing" where the initial (existing) lexer produces a token stream (type, range)
which could be further tweaked in subsequent passes. In your case you could filter out all tokens of type string and analyze them further. It might also be useful for language independent things like highlighting trailing white spaces etc.
However, if you are looking for advanced/correct syntax highlighting it might make more sense to investigate integration with existing language aware solutions.
@ninewise, this should probably be sent upstream to https://github.com/orbitalquark/scintillua/issues, right?
Yes, closing this here. Please open a ticket at scintillua if this is still relevant.
Is there any way to syntax highlight inner expressions like
${0##*/}
&$opt
in this string?Or maybe the
%s
's in:What would be the best way to do this sort of thing?