Highlighting lexer question

I'm trying to understand how the highlighting lexer for custom language works. Seems the highlighting lexer doesn't process all document on document change. Please explain what part of the document is reparsed.

For example, my grammar contains "#foreach" token. Seems, the highlighting lexer sometimes parses "each" substring so highlighting is broken. How to fix this problem? Will the merging lexer help me?

1 comment
Comment actions Permalink

I think your "#foreach" issue is a matter of the order of your token definitions.

if your lexer looks for the token "#' first, it will never ever resolve your "#foreach" token, because only the string "foreach" is left to be lexed.
Therefore try reordering the token definitions and return "#foreach" first, and then individual characters like "#" (i'm talking about the last section in the .flex file)


Please sign in to leave a comment.