orbitalquark / scintillua

Scintillua enables Scintilla lexers to be written in Lua, particularly using LPeg. It can also be used as a standalone Lua library for syntax highlighting support.
https://orbitalquark.github.io/scintillua
MIT License
51 stars 20 forks source link

Add AutoHotkey lexer #82

Closed snoopy closed 1 year ago

snoopy commented 1 year ago

Adds a lexer for AutoHotkey (https://en.wikipedia.org/wiki/AutoHotkey) based on the AutoIt lexer.

Is there a way to enforce both a minimum and maximum amount of characters via patt^n and patt^-n? This would be for an F-key rule (match F1-F12 but don't match F123 or F by itself).

Is it possible for word_match to be case insensitive? Currently it does not seem to work.

orbitalquark commented 1 year ago

I can't think of a way to do that. The CSS lexer recognizes #rgb and #rrggbb using xdigit * xdigit * xdigit * (xdigit * xdigit * xdigit)^-1, so perhaps you can do something similar.

Are there any file extensions for AutoHotkey scripts? You can add them to lexer.lua's extensions table in the detect() function. (Or I can do so if you let me know.)

word_match() accepts a second argument for case-insensitivity. It works at least for the vb lexer.

snoopy commented 1 year ago

Many thanks for your input! I noticed you even used the case-insensitivity in your latest commit. Sorry for not paying attention to that.

orbitalquark commented 1 year ago

Committed via https://github.com/orbitalquark/scintillua/commit/5fa357a224f6186e0b0198a8e20ee55066496b58. Thank you!