Group highlighting lexer tokens for relexing


Is it possible to group tokens for relexing? I have a syntax like:

            JS $item $index $obj
                document.actTest2 = 'Hahaha' + item + index + (obj && obj.piu);


`JS` is a command (first token), `$item`, `$index` and `$obj` are arguments declaration (next three tokens) and everything with higher than `JS` indentation is one last token.

There is a problem with incremental highlighting lexer (everything works ok, until I begin to edit my code).
I want relexing to start from first token in group when I've changed last token in group.


Comment actions Permalink

Is your lexer obeying the contract described in Lexer#start javadoc? It should only return 0 from getState on the tokens that it's capable to restart from.

Comment actions Permalink

This is it. I was reading the code and called yypushback() for everything with lower indentation along with yybegin(YYINITIAL).
It looks like working now.
Thanks much!


Please sign in to leave a comment.