{ "name": "autohotkey2", "scopeName": "source.ahk2", "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" }, { "include": "#hotkey_hotstring" }, { "include": "#switch_statement" }, { "include": "#object_property" }, { "include": "#reserved" }, { "include": "#numbers" }, { "include": "#operators" }, { "include": "#strings" }, { "include": "#pre_definition" }, { "include": "#class_block" }, { "include": "#block" }, { "include": "#continuation_section" }, { "include": "#parens" }, { "include": "#function_call" }, { "include": "#property" }, { "include": "#variables" } ], "repository": { "block": { "patterns": [ { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.ahk2" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.block.end.ahk2" } }, "patterns": [ { "include": "#block_innards" } ] } ] }, "block_innards": { "patterns": [ { "include": "#object_property" }, { "name": "meta.initialization.ahk2", "begin": "(?x)\n(?:\n (?:\n\t(?=[ \t])(?=+!]+ | \\(\\) | \\[\\]))\n)\n[ \t]*(\\() # opening bracket", "beginCaptures": { "1": { "name": "variable.other.ahk2" }, "2": { "name": "punctuation.section.parens.begin.bracket.round.initialization.ahk2" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.bracket.round.initialization.ahk2" } }, "patterns": [ { "include": "$base" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.section.block.begin.ahk2" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.section.block.end.ahk2" } }, "patterns": [ { "include": "#block_innards" } ] }, { "include": "$base" } ] }, "case_statement": { "name": "meta.conditional.case.ahk2", "begin": "(?<=^[ \t]*\\{?[ \t]*)((?i:case))(?!\\w)", "beginCaptures": { "1": { "name": "keyword.control.case.ahk2" } }, "end": "(:)", "endCaptures": { "1": { "name": "punctuation.separator.colon.case.ahk2" } }, "patterns": [ { "include": "#strings" }, { "include": "#numbers" }, { "match": ",", "name": "punctuation.separator.comma.ahk2" }, { "match": "\\.(?=\\w)", "name": "punctuation.accessor.ahk2" }, { "include": "#function_call" }, { "match": "{", "name": "punctuation.section.block.begin.ahk2" }, { "match": "}", "name": "punctuation.section.block.end.ahk2" }, { "match": "\\[|\\(", "name": "punctuation.section.parens.begin.ahk2" }, { "match": "\\]|\\)", "name": "punctuation.section.parens.end.ahk2" }, { "include": "#operators" }, { "include": "#variables" }, { "include": "#comments" } ] }, "class_block": { "name": "meta.block.class.ahk2", "begin": "(^|(?<=^[ \t]*\\*/))[ \t]*((?i:class))[ \t]+(\\$?\\w+(\\.\\w+)*)", "beginCaptures": { "2": { "name": "storage.type.class.ahk2" }, "3": { "name": "entity.name.type.class.ahk2" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.definition.block.class.end.ahk2" } }, "patterns": [ { "begin": "\\G(?!\\{)", "end": "(?=\\{)", "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" }, { "begin": "\\G[ \t]*(<)", "beginCaptures": { "1": { "name": "punctuation.definition.typeparameters.begin.ahk2" } }, "end": ">", "endCaptures": { "0": { "name": "punctuation.definition.typeparameters.end.ahk2" } }, "patterns": [ { "match": "\\w+", "name": "entity.name.type.parameter" }, { "match": ",", "name": "punctuation.separator.comma.ahk2" }, { "match": "=", "name": "keyword.operator.assignment.ahk2" }, { "match": "\\.", "name": "punctuation.accessor.ahk2" }, { "match": "\\|", "name": "keyword.operator.ahk2" } ] }, { "match": "\\b((?i:extends))([ \t]+([\\w.]+))?", "captures": { "1": { "name": "storage.modifier.ahk2" }, "3": { "patterns": [ { "match": "\\.(?=\\w)", "name": "punctuation.accessor.ahk2" }, { "include": "#default_classes" }, { "match": "\\b[^.]+\\b", "name": "entity.name.type.class.ahk2" } ] } } } ] }, { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.definition.block.class.begin.ahk2" } }, "end": "(?=})", "name": "meta.block.class.body.ahk2", "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" }, { "match": "(?<=^[ \t]*)(?i:static)(?=[ \t]+\\w)", "name": "storage.modifier.ahk2" }, { "begin": "(?<=^[ \t]*(?i:static[ \t]+)?)(\\w+)[ \t]*(=>)([ \t]+(;.*)\\n|[ \t]*\\n)?", "beginCaptures": { "1": { "patterns": [ { "match": "\\b(?i:__item)\\b", "name": "storage.type.metafunction.ahk2" } ], "name": "variable.other.property.ahk2" }, "2": { "name": "storage.type.function.arrow.ahk2" }, "4": { "name": "comment.line.ahk2" } }, "end": "(?=\\n)", "name": "meta.block.prototype.body.ahk2", "patterns": [ { "include": "#line_continue" }, { "include": "$base" } ] }, { "match": "(?<=(^[ \t]*(?i:static[ \t]+)?|,[ \t]*))\\w+(?=[ \t]*:=)", "captures": { "0": { "patterns": [ { "match": "\\b(?i:__item)\\b", "name": "storage.type.metafunction.ahk2" } ], "name": "variable.other.property.ahk2" } } }, { "begin": "(?<=^[ \t]*(?i:static[ \t]+)?)(\\w+)(?=\\()", "beginCaptures": { "1": { "patterns": [ { "match": "\\b(__(?i:new|init|enum|get|call|set|delete))\\b", "name": "storage.type.metafunction.ahk2" } ], "name": "entity.name.function.method.ahk2" } }, "end": "(?=\\n)", "name": "meta.block.method.ahk2", "patterns": [ { "begin": "\\G\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.ahk2" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.ahk2" } }, "patterns": [ { "include": "$base" } ] }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.block.method.begin.ahk2" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.definition.block.method.end.ahk2" } }, "name": "meta.block.method.body.ahk2", "patterns": [ { "include": "$base" } ] }, { "begin": "(=>)([ \t]+(;.*)\\n|[ \t]*\\n)?", "beginCaptures": { "1": { "name": "storage.type.function.arrow.ahk2" }, "3": { "name": "comment.line.ahk2" } }, "end": "(?=\\n)", "name": "meta.block.method.body.ahk2", "patterns": [ { "include": "#line_continue" }, { "include": "$base" } ] }, { "include": "#compiler_directive" }, { "include": "#comments" } ] }, { "begin": "(?<=^[ \t]*(?i:static[ \t]+)?)\\b\\w+\\b(?=(\\[|[ \t]*\\{?([ \t];.*)?\\n))", "beginCaptures": { "0": { "patterns": [ { "match": "\\b(?i:__item)\\b", "name": "storage.type.metafunction.ahk2" } ], "name": "variable.other.property.ahk2" } }, "name": "meta.block.property.ahk2", "end": "(?=\\n)", "endCaptures": { "1": { "name": "punctuation.definition.block.property.end.ahk2" } }, "patterns": [ { "begin": "\\G\\[", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.ahk2" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.ahk2" } }, "patterns": [ { "include": "$base" } ] }, { "include": "#compiler_directive" }, { "include": "#comments" }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.block.property.begin.ahk2" } }, "end": "(?=})", "endCaptures": { "0": { "name": "punctuation.definition.block.property.end.ahk2" } }, "name": "meta.block.property.body.ahk2", "patterns": [ { "begin": "(?<=^[ \t]*)(?i:set)\\b", "beginCaptures": { "0": { "name": "storage.type.setter.ahk2" } }, "end": "(?=\\n)", "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.block.property.setter.begin.ahk2" } }, "name": "meta.block.property.setter.body.ahk2", "end": "}", "endCaptures": { "0": { "name": "punctuation.definition.block.property.setter.end.ahk2" } }, "patterns": [ { "include": "$base" } ] }, { "begin": "(=>)([ \t]+(;.*)\\n|[ \t]*\\n)?", "beginCaptures": { "1": { "name": "storage.type.function.arrow.ahk2" }, "3": { "name": "comment.line.ahk2" } }, "name": "meta.block.property.setter.body.ahk2", "end": "(?=\\n)", "patterns": [ { "include": "#line_continue" }, { "include": "$base" } ] } ] }, { "begin": "(?<=^[ \t]*)(?i:get)\\b", "beginCaptures": { "0": { "name": "storage.type.getter.ahk2" } }, "end": "(?=\\n)", "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" }, { "begin": "{", "beginCaptures": { "0": { "name": "punctuation.definition.block.property.getter.begin.ahk2" } }, "name": "meta.block.property.getter.body.ahk2", "end": "}", "endCaptures": { "0": { "name": "punctuation.definition.block.property.getter.end.ahk2" } }, "patterns": [ { "include": "$base" } ] }, { "begin": "(=>)([ \t]+(;.*)\\n|[ \t]*\\n)?", "beginCaptures": { "1": { "name": "storage.type.function.arrow.ahk2" }, "3": { "name": "comment.line.ahk2" } }, "name": "meta.block.property.getter.body.ahk2", "end": "(?=\\n)", "patterns": [ { "include": "#line_continue" }, { "include": "$base" } ] } ] }, { "include": "$base" } ] }, { "begin": "(=>)([ \t]+(;.*)\\n|[ \t]*\\n)?", "beginCaptures": { "1": { "name": "storage.type.function.arrow.ahk2" }, "3": { "name": "comment.line.ahk2" } }, "name": "meta.block.property.getter.body.ahk2", "end": "(?=\\n)", "patterns": [ { "include": "#line_continue" }, { "include": "$base" } ] }, { "include": "#variables" } ] }, { "include": "#class_block" }, { "include": "#line_continue" }, { "include": "$base" } ] } ] }, "comments": { "patterns": [ { "name": "comment.block.jsdoc.ahk2", "begin": "^[ \t]*(\\/\\*\\*)(?!\\/)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.ahk2" } }, "end": "(^[ \t]*\\*\\/|(\\*\\/)[ \t]*$)", "endCaptures": { "1": { "name": "punctuation.definition.comment.end.ahk2" } }, "patterns": [ { "include": "#docblock" } ] }, { "name": "comment.block.ahk2", "begin": "(?<=^[ \t]*)(\\/\\*)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.ahk2" } }, "end": "(^[ \t]*\\*\\/|(\\*\\/)[ \t]*$)", "endCaptures": { "1": { "name": "punctuation.definition.comment.end.ahk2" } } }, { "name": "comment.line.ahk2", "match": "(?<=(^[ \t]*|[ \t]))(;.*)" } ] }, "compiler_directive": { "patterns": [ { "name": "comment.block.ahk2", "begin": "^[ \t]*(\\/\\*)((?i:@ahk2exe-keep))", "beginCaptures": { "1": { "name": "punctuation.definition.comment.begin.ahk2" }, "2": { "name": "keyword.control.directive.conditional.ahk2" } }, "end": "^[ \t]*(\\*\\/)", "endCaptures": { "1": { "name": "punctuation.definition.comment.end.ahk2" } } }, { "match": "(?<=^[ \t]*);[ \t]*@(?i:ahk2exe-ignore(begin|end))", "name": "keyword.control.directive.ahk2" }, { "begin": "^[ \t]*(;[ \t]*@(?i:ahk2exe-let))\\b", "beginCaptures": { "0": { "name": "keyword.control.directive.ahk2" } }, "end": "(?=\\n)", "patterns": [ { "include": "#strings" }, { "include": "#numbers" }, { "match": "\\b([_[:alpha:]][_[:alnum:]]*)(?=[ \t]*=)", "name": "constant.language.ahk2" }, { "match": "=", "name": "keyword.operator.assignment.ahk2" }, { "match": ",", "name": "punctuation.separator.comma.ahk2" } ] }, { "begin": "^[ \t]*((;[ \t]*@)(?i:include))\\b", "beginCaptures": { "1": { "name": "keyword.control.directive.ahk2" }, "2": { "name": "punctuation.definition.directive.ahk2" } }, "end": "(?=\\n)", "name": "meta.preprocessor.include.ahk2", "patterns": [ { "begin": "[^ \t;]", "end": "(?=(?:[ \t]+;))|(?=\\n)", "name": "string.literal.include.ahk2" }, { "match": "(?:[ \t]+);.*", "name": "comment.line.ahk2" } ] }, { "match": "(?<=^[ \t]*);[ \t]*@(?i:ahk2exe-\\w+)\\b([ \t].*)?", "name": "keyword.control.directive.ahk2", "captures": { "1": { "name": "string.literal.ahk2" } } }, { "match": "(?<=^|[ \t]);[ \t]*@(?:[\\w\\-]+)\\b([ \t]+(.*))?", "name": "keyword.control.directive.ahk2", "captures": { "2": { "name": "comment.line.ahk2" } } } ] }, "conditional_context": { "patterns": [ { "include": "$self" }, { "include": "#block_innards" } ] }, "continuation_section": { "name": "meta.parens.continuation_section.ahk2", "begin": "(?<=^[ \t]*)(\\()((((?i:join)[^ \t]*|[^ \t();]+)(?=[ \t]|$)|[ \t]+)*)((?<=[ \t]);.*)?$", "beginCaptures": { "1": { "name": "punctuation.section.parens.begin.ahk2" }, "2": { "patterns": [ { "match": "(?<=[ \t]|^[ \t]*\\()(?i:c(om(ments?)?)?|[lr]trim0?|`|join(`s|[^ \t]){0,15})(?=[ \t]|$)", "name": "string.options.ahk2 markup.italic" }, { "match": "[^ \t]+", "name": "invalid.options.ahk2 markup.strikethrough" } ] }, "5": { "name": "comment.line.ahk2" } }, "end": "^[ \t]*(\\))", "endCaptures": { "1": { "name": "punctuation.section.parens.end.ahk2" } }, "patterns": [ { "include": "#continuation_section_innards" } ] }, "continuation_section_innards": { "patterns": [ { "begin": "('|\")", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.ahk2" } }, "end": "(\\1)|(?=^[ \t]*\\))", "endCaptures": { "1": { "name": "punctuation.definition.string.end.ahk2" } }, "name": "string.continuation_section_innards.ahk2", "patterns": [ { "include": "#string_escaped_char" } ] }, { "include": "#variables" }, { "match": "{", "name": "punctuation.section.block.begin.ahk2" }, { "match": "}", "name": "punctuation.section.block.end.ahk2" }, { "match": "\\[", "name": "punctuation.section.parens.begin.ahk2" }, { "match": "\\]", "name": "punctuation.section.parens.end.ahk2" }, { "include": "#parens" }, { "include": "$base" } ] }, "default_classes": { "patterns": [ { "begin": "(?*/]\n (?:[^@<>*/]|\\*[^/])*\n)\n(?:\n \\s*\n (<)\n ([^>\\s]+)\n (>)\n)?", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" }, "4": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "5": { "name": "constant.other.email.link.underline.jsdoc" }, "6": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } } }, { "match": "(?x)\n((@)borrows) \\s+\n((?:[^@\\s*/]|\\*[^/])+) # \n\\s+ (as) \\s+ # as\n((?:[^@\\s*/]|\\*[^/])+) # ", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" }, "4": { "name": "keyword.operator.control.jsdoc" }, "5": { "name": "entity.name.type.instance.jsdoc" } } }, { "name": "meta.embedded.ahk2 meta.example.jsdoc", "begin": "((@)example)\\s+", "end": "(?=@|\\*+/)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "patterns": [ { "match": "^\\s*\\*\\s+", "name": "comment.block.ahk2" }, { "contentName": "constant.other.description.jsdoc", "begin": "\\G(<)caption(>)", "beginCaptures": { "0": { "name": "entity.name.tag.inline.jsdoc" }, "1": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } }, "end": "()|(?=\\*/)", "endCaptures": { "0": { "name": "entity.name.tag.inline.jsdoc" }, "1": { "name": "punctuation.definition.bracket.angle.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.angle.end.jsdoc" } }, "patterns": [ { "match": "^\\s*\\*\\s", "name": "comment.block.ahk2" } ] }, { "include": "$base" } ] }, { "name": "meta.overload.ahk2", "begin": "((@)overload)\\s+", "end": "(?=\\n|^\\s*\\*)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "patterns": [ { "include": "$base" } ] }, { "match": "(?x) ((@)kind) \\s+ (class|constant|event|external|file|function|member|mixin|module|namespace|typedef) \\b", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "constant.language.symbol-type.jsdoc" } } }, { "match": "(?x)\n((@)see)\n\\s+\n(?:\n # URL\n (\n (?=https?://)\n (?:[^\\s*]|\\*[^/])+\n )\n |\n # JSDoc namepath\n (\n (?!\n # Avoid matching bare URIs (also acceptable as links)\n https?://\n |\n # Avoid matching {@inline tags}; we match those below\n (?:\\[[^\\[\\]]*\\])? # Possible description [preceding]{@tag}\n {@(?:link|linkcode|linkplain|tutorial)\\b\n )\n # Matched namepath\n (?:[^@\\s*/]|\\*[^/])+\n )\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.link.underline.jsdoc" }, "4": { "name": "entity.name.type.instance.jsdoc" } } }, { "match": "(?x)\n((@)template)\n\\s+\n# One or more valid identifiers\n(\n [A-Za-z_$] # First character: non-numeric word character\n [\\w$.\\[\\]]* # Rest of identifier\n (?: # Possible list of additional identifiers\n \\s* , \\s*\n [A-Za-z_$]\n [\\w$.\\[\\]]*\n )*\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" } } }, { "begin": "((@)typedef)\\s+(?={)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", "patterns": [ { "include": "#jsdoctype" }, { "name": "entity.name.type.instance.jsdoc", "match": "(?:[^@\\s*/]|\\*[^/])+" } ] }, { "begin": "((@)(?:arg|argument|const|constant|member|namespace|param|prop|property|var))\\s+(?=[\\[{]|(?!\\d)\\w)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]\\w])", "patterns": [ { "include": "#jsdoctype" }, { "name": "variable.other.jsdoc", "match": "((?!\\d)\\w[\\w.\\[\\]]*)" }, { "name": "variable.other.jsdoc", "match": "(?x)\n(\\[)\\s*\n\\w+\n(?:\n (?:\\[\\])? # Foo[ ].bar properties within an array\n \\. # Foo.Bar namespaced parameter\n [\\w$]+\n)*\n(?:\n \\s*\n (=) # [foo=bar] Default parameter value\n \\s*\n (\n # The inner regexes are to stop the match early at */ and to not stop at escaped quotes\n (?>\n \"(?:(?:\\*(?!/))|(?:\\\\(?!\"))|[^*\\\\])*?\" | # [foo=\"bar\"] Double-quoted\n '(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' | # [foo='bar'] Single-quoted\n \\[ (?:(?:\\*(?!/))|[^*])*? \\] | # [foo=[1,2]] Array literal\n (?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])* # Everything else\n )*\n )\n)?\n\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))", "captures": { "1": { "name": "punctuation.definition.optional-value.begin.bracket.square.jsdoc" }, "2": { "name": "keyword.operator.assignment.jsdoc" }, "3": { "name": "meta.embedded.ahk2" }, "4": { "name": "punctuation.definition.optional-value.end.bracket.square.jsdoc" }, "5": { "name": "invalid.illegal.syntax.jsdoc" } } } ] }, { "begin": "(?x)\n(\n (@)\n (?:define|enum|exception|export|extends|lends|implements|modifies\n |namespace|private|protected|returns?|suppress|this|throws|type\n |yields?)\n)\n\\s+(?={)", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "end": "(?=\\s|\\*/|[^{}\\[\\]A-Za-z_$])", "patterns": [ { "include": "#jsdoctype" } ] }, { "match": "((@)method)\\b\\s*((\\w|[^\\x00-\\x7f])+)?", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.function.method.ahk2" } } }, { "match": "(?x)\n(\n (@)\n (?:alias|augments|callback|constructs|emits|event|fires|exports?\n |extends|external|function|func|host|lends|listens|interface|memberof!?\n |module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n (?:\n [^{}@\\s*] | \\*[^/]\n )+\n)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" } } }, { "contentName": "variable.other.jsdoc", "begin": "((@)(?:default(?:value)?|license|version))\\s+(([''\"]))", "beginCaptures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" }, "4": { "name": "punctuation.definition.string.begin.jsdoc" } }, "end": "(\\3)|(?=$|\\*/)", "endCaptures": { "0": { "name": "variable.other.jsdoc" }, "1": { "name": "punctuation.definition.string.end.jsdoc" } } }, { "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" } } }, { "name": "storage.type.class.jsdoc", "match": "(?x) (@) (?:abstract|access|alias|api|arg|argument|async|attribute|augments|author|beta|borrows|bubbles |callback|chainable|class|classdesc|code|config|const|constant|constructor|constructs|copyright |default|defaultvalue|define|deprecated|desc|description|dict|emits|enum|event|example|exception |exports?|extends|extension(?:_?for)?|external|externs|file|fileoverview|final|fires|for|func |function|generator|global|hideconstructor|host|ignore|implements|implicitCast|inherit[Dd]oc |inner|instance|interface|internal|kind|lends|license|listens|main|member|memberof!?|method |mixes|mixins?|modifies|module|name|namespace|noalias|nocollapse|nocompile|nosideeffects |override|overview|package|param|polymer(?:Behavior)?|preserve|private|prop|property|protected |public|read[Oo]nly|record|require[ds]|returns?|see|since|static|struct|submodule|summary |suppress|template|this|throws|todo|tutorial|type|typedef|unrestricted|uses|var|variation |version|virtual|writeOnce|yields?) \\b", "captures": { "1": { "name": "punctuation.definition.block.tag.jsdoc" } } }, { "include": "#inline-tags" }, { "match": "((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)", "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } } } ] }, "function_call": { "match": "([_[:alpha:]][[:alnum:]_]*+)(?=\\()", "captures": { "1": { "name": "entity.name.function.ahk2", "patterns": [ { "match": "(?<=\\.).+", "name": "entity.name.function.method.ahk2" }, { "include": "#variables_language" } ] } } }, "function_call_notparens": { "patterns": [ { "match": "(?<=^[ \t]*(\\{[ \t]*)?|::[ \t]*|(?i:(try|else|finally)[ \t]+))([[:alpha:]_][[:alnum:]_]*\\b(?>=|\\?|\\{))|$))", "name": "entity.name.function.ahk2", "captures": { "0": { "patterns": [ { "include": "#function_defaultLibrary" } ] } } }, { "match": "(?<=(^[ \t]*(\\{[ \t]*)?|::[ \t]*|(?i:(try|else|finally)[ \t]+))([[:alpha:]_][[:alnum:]_]*\\.)+)([[:alpha:]_][[:alnum:]_]*\\b)(?=$|[ \t]((?!([ \t]*[+\\-*/^&:.|]?=|<<=|>>=|\\?|\\{))|$))", "name": "entity.name.function.method.ahk2" } ] }, "function_defaultLibrary": { "patterns": [ { "match": "(?$~*!+#^]*?)(`;|(?<=[^ \t]);|[\\x21-\\x3A\\x3C-\\x7E]|[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\x7f]+))|~?(`;|(?<=[^ \t]);|[\\x21-\\x3A\\x3C-\\x7E]|[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\x7f]+)[ \t]+&[ \t]+~?(`;|(?<=[^ \t]);|[\\x21-\\x3A\\x3C-\\x7E]|[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x5e\\x60\\x7b-\\x7f]+))([ \t]+up)?)(::)", "beginCaptures": { "1": { "name": "hotkey.ahk2", "patterns": [ { "match": "(?<=[ \t])&(?=[ \t]+[^ \t]+(?i:[ \t]+up)?$)", "name": "keyword.operator.ahk2" }, { "match": "(?<=(&[ \t]+|^[ \t]*))([<>$~*!+#^]*?)(?i:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|lbutton|rbutton|mbutton|wheeldown|wheelup|wheelleft|wheelright|xbutton[12]|(0*[2-9]|0*1[0-6]?)?joy0*([1-9]|[12]\\d|3[012])|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgdn|pgup|home|end|up|down|left|right|printscreen|ctrlbreak|pause|help|sleep|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadleft|numpadright|numpaddown|numpadup|numpadhome|numpadend|numpadpgdn|numpadpgup|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2|vk[a-f\\d]{1,2}(sc[a-f\\d]+)?|sc[a-f\\d]+|`[;{]|[\\x21-\\x3A\\x3C-\\x7E]|(?<=[^ \t]);)(?=([ \t]|$))", "name": "keyword.keys.ahk2" } ] }, "7": { "name": "keyword.keys.up.ahk2" }, "8": { "name": "punctuation.definition.colon" } }, "end": "(?=\\n)", "patterns": [ { "match": "(?<=\\G[ \t]*)((?i:alttab|alttabandmenu|alttabmenu|alttabmenudismiss|shiftalttab)\\b|([<>]?[!+#^]){0,4}(`[{;]|(?<=\\G);|[^{;]|(?i:shift|lshift|rshift|alt|lalt|ralt|control|lcontrol|rcontrol|ctrl|lctrl|rctrl|lwin|rwin|appskey|lbutton|rbutton|mbutton|wheeldown|wheelup|wheelleft|wheelright|xbutton[12]|space|tab|enter|escape|esc|backspace|bs|delete|del|insert|ins|pgdn|pgup|home|end|up|down|left|right|printscreen|ctrlbreak|pause|help|sleep|scrolllock|capslock|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadmult|numpadadd|numpadsub|numpaddiv|numpaddot|numpaddel|numpadins|numpadclear|numpadleft|numpadright|numpaddown|numpadup|numpadhome|numpadend|numpadpgdn|numpadpgup|numpadenter|f1|f2|f3|f4|f5|f6|f7|f8|f9|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f20|f21|f22|f23|f24|browser_back|browser_forward|browser_refresh|browser_stop|browser_search|browser_favorites|browser_home|volume_mute|volume_down|volume_up|media_next|media_prev|media_stop|media_play_pause|launch_mail|launch_media|launch_app1|launch_app2|vk[a-f\\d]{1,2}(sc[a-f\\d]+)?|sc[a-f\\d]+))(?=([ \t]+;.*|[ \t]*)\\n))", "name": "keyword.keys.ahk2" }, { "include": "$base" } ] }, { "match": "(?<=^[ \t]*\\{?[ \t]*)(\\w+)(:)(?=[ \t]*([ \t];.*)?$)", "captures": { "1": { "name": "entity.name.label.ahk2" }, "2": { "name": "punctuation.definition.colon" } } } ] }, "hotstring_execute": { "match": "^[ \t]*(:)([^:]*)(:)((`.|[^`])*?)(::)", "captures": { "1": { "name": "punctuation.definition.colon" }, "2": { "patterns": [ { "match": "(?i:(s[ipe]|[*?borstz]0?|c[01]?|k-1|[kp]\\d+|x1?))", "name": "string.options.ahk2 markup.italic" }, { "match": "[^ \t]", "name": "invalid.options.ahk2 markup.strikethrough" } ] }, "3": { "name": "punctuation.definition.colon" }, "4": { "name": "keyword.keys.ahk2 markup.underline" }, "6": { "name": "punctuation.definition.colon" } }, "name": "hotstring.ahk2" }, "inline-tags": { "patterns": [ { "name": "constant.other.description.jsdoc", "match": "(\\[)[^\\]]+(\\])(?={@(?:link|linkcode|linkplain|tutorial))", "captures": { "1": { "name": "punctuation.definition.bracket.square.begin.jsdoc" }, "2": { "name": "punctuation.definition.bracket.square.end.jsdoc" } } }, { "name": "entity.name.type.instance.jsdoc", "begin": "({)((@)(?:link(?:code|plain)?|tutorial))\\s*", "beginCaptures": { "1": { "name": "punctuation.definition.bracket.curly.begin.jsdoc" }, "2": { "name": "storage.type.class.jsdoc" }, "3": { "name": "punctuation.definition.inline.tag.jsdoc" } }, "end": "}|(?=\\*/)", "endCaptures": { "0": { "name": "punctuation.definition.bracket.curly.end.jsdoc" } }, "patterns": [ { "match": "\\G((?=https?://)(?:[^|}\\s*]|\\*[/])+)(\\|)?", "captures": { "1": { "name": "variable.other.link.underline.jsdoc" }, "2": { "name": "punctuation.separator.pipe.jsdoc" } } }, { "match": "\\G((?:[^{}@\\s|*]|\\*[^/])+)(\\|)?", "captures": { "1": { "name": "variable.other.description.jsdoc" }, "2": { "name": "punctuation.separator.pipe.jsdoc" } } } ] } ] }, "brackets": { "patterns": [ { "match": "^\\s*\\*\\s+", "name": "comment.block.ahk2" }, { "match": "(['\"])(`\\1|.(??:=.&|^]+|[~+\\-]=?|!==?|,|\\b(?i:(and|contain|not|in|is|or)))[ \t]*([ \t];.*)?\\n", "beginCaptures": { "1": { "patterns": [ { "include": "#operators" }, { "match": ",", "name": "punctuation.separator.comma.ahk2" }, { "match": "=>", "name": "storage.type.function.arrow.ahk2" } ] }, "3": { "name": "comment.line.ahk2" } }, "end": "(?!([*/<>?:=.]+|[+\\-]=?|!==?|,|\\b(?i:(and|contain|not|in|is|or))))[ \t]*([ \t];.*)?(?=\\n)|(?<=^[ \t]*(?i:class|static|if|try|loop|while)[ \t]+\\w+)", "endCaptures": { "3": { "name": "comment.line.ahk2" } }, "patterns": [ { "match": "(?<=^[ \t]*)\\w+(?=(\\n|[ \t]))", "captures": { "0": { "patterns": [ { "include": "#variables" } ] } } }, { "include": "#line_continue" }, { "include": "$base" } ] }, "numbers": { "match": "(?", "name": "storage.type.function.arrow.ahk2" }, { "match": "\\.=|\\+=|-=|\\*=|/?/=", "name": "keyword.operator.assignment.compound.ahk2" }, { "match": "&=|\\^=|<<=|>>>=|>>=|\\|=", "name": "keyword.operator.assignment.compound.bitwise.ahk2" }, { "match": "<<|>>>|>>", "name": "keyword.operator.bitwise.shift.ahk2" }, { "match": "!=|<=|>=|=?=|<|>", "name": "keyword.operator.comparison.ahk2" }, { "match": "~=", "name": "keyword.operator.regexp.ahk2" }, { "match": "\\?\\?|&&|!|\\|\\|", "name": "keyword.operator.logical.ahk2" }, { "match": "&|\\||\\^|~", "name": "keyword.operator.ahk2" }, { "match": ":=", "name": "keyword.operator.assignment.ahk2" }, { "match": "\\.(?=\\w)", "name": "punctuation.accessor.ahk2" }, { "match": "\\*|/|-|\\+|\\.", "name": "keyword.operator.ahk2" }, { "match": "%", "name": "punctuation.parens.percent.ahk2" }, { "match": "\\[", "name": "punctuation.square.begin.ahk2" }, { "match": "\\]", "name": "punctuation.square.end.ahk2" }, { "match": "\\?(?=[ \t]*[,)\\]}])", "name": "keyword.operator.optional.ahk2" }, { "match": "\\?|:(?!\\:)", "name": "keyword.operator.ternary.ahk2" }, { "match": ",", "name": "punctuation.separator.comma.ahk2" } ] }, "parens": { "name": "meta.parens.ahk2", "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.section.parens.begin.bracket.round.ahk2" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.section.parens.end.bracket.round.ahk2" } }, "patterns": [ { "include": "$base" } ] }, "property": { "patterns": [ { "name": "variable.other.property.ahk2", "match": "\\b(?<=\\.)[_[:alnum:]]+\\b" } ] }, "pre_definition": { "patterns": [ { "begin": "^[ \t]*((#)(?i:dllload|hotstring|include(again)?|mapcasesense|requires|errorstdout|definedefault(array|map|object)value|windowclass(gui|main)|singleinstance|targetcontrolerror|targetwindowerror))\\b", "beginCaptures": { "1": { "name": "keyword.control.directive.ahk2" }, "2": { "name": "punctuation.definition.directive.ahk2" } }, "end": "\\n", "name": "meta.preprocessor.ahk2", "patterns": [ { "match": "[^ \t;].*?(?=([ \t]+;|[ \t]*\\n))", "name": "string.literal.ahk2" }, { "match": "(?<=[ \t]);.*", "name": "comment.line.ahk2" } ] }, { "begin": "^[ \t]*((#)(?i:warn))\\b", "beginCaptures": { "1": { "name": "keyword.control.directive.ahk2" }, "2": { "name": "punctuation.definition.directive.ahk2" } }, "end": "\\n", "name": "meta.preprocessor.ahk2", "patterns": [ { "match": ",", "name": "punctuation.separator.comma.ahk2" }, { "match": "\\w+", "name": "string.literal.ahk2" }, { "match": "(?<=[ \t]);.*", "name": "comment.line.ahk2" } ] }, { "match": "^[ \t]*((#)(?i:clipboardtimeout|criticalobject(sleeptime|timeout)|hotif|hotiftimeout|inputlevel|initexec|maxthreads|maxthreadsbuffer|maxthreadsperhotkey|notrayicon|suspendexempt|usehook|usestdlib|warn|warncontinuableexception|winactivateforce))\\b", "captures": { "1": { "name": "keyword.control.directive.ahk2" }, "2": { "name": "punctuation.definition.directive.ahk2" } } }, { "begin": "^[ \t]*((#)(?i:dllimport))([ \t]+(\\w+)[ \t]*(,?))?", "beginCaptures": { "1": { "name": "keyword.control.directive.ahk2" }, "2": { "name": "punctuation.definition.directive.ahk2" }, "4": { "name": "entity.name.function.ahk2" }, "5": { "name": "punctuation.separator.comma.ahk2" } }, "end": "\\n", "name": "meta.preprocessor.ahk2", "patterns": [ { "match": ",", "name": "punctuation.separator.comma.ahk2" }, { "match": "[^,\\n\\r]+", "name": "string.literal.ahk2" } ] } ] }, "reserved": { "patterns": [ { "match": "(?(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))(\\()", "beginCaptures": { "1": { "patterns": [ { "include": "#compiler_directive" }, { "include": "#comments" } ] }, "2": { "name": "comment.block.ahk2 punctuation.definition.comment.begin.ahk2" }, "3": { "name": "comment.block.ahk2" }, "4": { "patterns": [ { "match": "\\*\\/", "name": "comment.block.ahk2 punctuation.definition.comment.end.ahk2" }, { "match": "\\*", "name": "comment.block.ahk2" } ] }, "5": { "name": "punctuation.section.parens.begin.bracket.round.conditional.switch.ahk2" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.section.parens.end.bracket.round.conditional.switch.ahk2" } }, "patterns": [ { "include": "#conditional_context" } ] }, "switch_statement": { "name": "meta.block.switch.ahk2", "begin": "(((?>(?:(?:(?>(?(?:[^\\*]|(?>\\*+)[^\\/])*)((?>\\*+)\\/)))+|(?:(?:(?:(?:\\b|(?<=\\W))|(?=\\W))|\\A)|\\Z))))((?\\[\\]=]))", "patterns": [ { "name": "meta.head.switch.ahk2", "begin": "\\G ?", "end": "(?