Lex's lexers (mostly accurate highlighting for v2.0-a082)
Posted: 30 Dec 2017, 02:51
Originally posted here.
I've updated the v2 lexer to match the syntax of v2.0-a082. It was a few versions behind. Since it can be much simpler now, I've split it from the v1 lexer.lexikos wrote:I've just uploaded the lexers (syntax highlighters) that I've been using for the last few months.
AutoHotkey lexers for Scintillua + SciTE4AutoHotkey
AutoHotkey v1 and v2 are supported. A Lua script is included to automatically switch lexers when a "v2" platform is selected. Both lexers almost fully support the unique syntax of each command.
Caveats:
- Continuation sections are given a single flat style. This is to avoid inaccurate/misleading styling, because styling code within a continuation section accurately seems to be impossible with Scintillua. (The best I could achieve was styling which broke as soon as you edit a line near or in the section, and even that was complicated.)
- Continuation lines may be styled as though they are standalone expressions. This is a problem, for instance, if you spread the parameter list of a command across multiple lines.
- So-called "keywords" in strings are not highlighted, by design. (If a keyword is highlighted, it had better actually mean something in that context. Although it would be possible to highlight keywords such as sub-commands only in-context, it would further complicate the grammar.)
- It's memory-hungry.