]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/autohotkey.js
1 /*! `autohotkey` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Author: Seongwon Lee <dlimpid@gmail.com>
9 Description: AutoHotkey language definition
13 /** @type LanguageFn */
14 function autohotkey(hljs
) {
15 const BACKTICK_ESCAPE
= { begin: '`[\\s\\S]' };
19 case_insensitive: true,
22 keyword: 'Break Continue Critical Exit ExitApp Gosub Goto New OnExit Pause return SetBatchLines SetTimer Suspend Thread Throw Until ahk_id ahk_class ahk_pid ahk_exe ahk_group',
23 literal: 'true false NOT AND OR',
24 built_in: 'ComSpec Clipboard ClipboardAll ErrorLevel'
28 hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { contains: [ BACKTICK_ESCAPE
] }),
29 hljs
.COMMENT(';', '$', { relevance: 0 }),
30 hljs
.C_BLOCK_COMMENT_MODE
,
33 begin: hljs
.NUMBER_RE
,
37 // subst would be the most accurate however fails the point of
38 // highlighting. variable is comparably the most accurate that actually
40 className: 'variable',
41 begin: '%[a-zA-Z0-9#_$@]+%'
44 className: 'built_in',
45 begin: '^\\s*\\w+\\s*(,|%)'
46 // I don't really know if this is totally relevant
49 // symbol would be most accurate however is highlighted just like
50 // built_in and that makes up a lot of AutoHotkey code meaning that it
51 // would fail to highlight anything
54 { begin: '^[^\\n";]+::(?!=)' },
56 begin: '^[^\\n";]+:(?!=)',
57 // zero relevance as it catches a lot of things
58 // followed by a single ':' in many languages
70 className: 'built_in',
71 begin: 'A_[a-zA-Z0-9]+'
74 // consecutive commas, not for highlighting but just for relevance
84 hljs
.registerLanguage('autohotkey', hljsGrammar
);