Page 1 of 1

Lex's lexers (mostly accurate highlighting for v2.0-a082)

Posted: 30 Dec 2017, 02:51
by lexikos
Originally posted here.
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.

  • 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.
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.

Re: Lex's lexers (mostly accurate highlighting for v2.0-a082)

Posted: 30 Dec 2017, 03:47
by zcooler
What an awesome comeback you have made from self-imposed exile...the productivity is very impressing and SO nice for AHK...people were worried there for a while. Happy New Year to you lexikos and thank you very much for spreading joy in the houses again :thumbup: