{ "name": "Haxe", "scopeName": "source.haxe.2", "patterns": [ { "include": "#all" } ], "repository": { "all": { "patterns": [ { "include": "#package" }, { "include": "#import" }, { "include": "#import-using" }, { "include": "#type-abstract" }, { "include": "#type-class" }, { "include": "#type-enum" }, { "include": "#type-interface" }, { "include": "#type-typedef" }, { "include": "#meta-static" }, { "include": "#method" }, { "include": "#variable" }, { "include": "#block" }, { "include": "#block-contents" } ] }, "arrays": { "name": "meta.array.haxe.2", "begin": "(\\[)", "end": "(\\])", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "punctuation.definition.array.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.array.end.haxe.2" } } }, "block": { "begin": "(\\{)", "end": "(\\})", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "block-contents": { "patterns": [ { "include": "#regex" }, { "include": "#arrays" }, { "include": "#parameters" }, { "include": "#constants" }, { "include": "#comments" }, { "include": "#strings" }, { "include": "#macro" }, { "include": "#modifiers" }, { "include": "#keywords" }, { "include": "#keywords-magic" }, { "include": "#keywords-reification" }, { "include": "#conditional-compilation" }, { "include": "#operator-assignment" }, { "include": "#operators" }, { "include": "#punctuation-separator" }, { "include": "#punctuation-terminator" }, { "include": "#punctuation-brackets" }, { "include": "#support-class-name" } ] }, "comments": { "patterns": [ { "name": "comment.block.haxe.2", "begin": "(/\\*)", "end": "(\\*/)", "beginCaptures": { "1": { "name": "punctuation.definition.comment.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.comment.haxe.2" } } }, { "name": "comment.line.double-slash.haxe.2", "match": "(//).*$\\n?", "captures": { "1": { "name": "punctuation.definition.comment.haxe.2" } } } ] }, "conditional-compilation": { "patterns": [ { "name": "keyword.control.directive.conditional.haxe.2", "match": "(#(end|else))" }, { "match": "((#(if|elseif))\\s+([a-zA-Z0-9_]*)\\s)", "captures": { "0": { "name": "meta.control.directive.conditional.haxe.2" }, "2": { "name": "keyword.control.directive.conditional.haxe.2" } } }, { "name": "meta.control.directive.conditional.haxe.2", "begin": "((#(if|elseif))\\s*?\\()", "end": "(\\))", "beginCaptures": { "0": { "name": "meta.control.directive.conditional.haxe.2" }, "2": { "name": "keyword.control.directive.conditional.haxe.2" } } }, { "name": "meta.control.directive.conditional.haxe.2", "match": "(#([a-zA-Z0-9_]*))\\s" } ] }, "constants": { "patterns": [ { "name": "constant.language.haxe.2", "match": "\\b(true|false|null)\\b" }, { "name": "constant.numeric.haxe.2", "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b" } ] }, "entity-name-class": { "name": "entity.name.type.class.haxe.2", "match": "\\b([_A-Za-z]\\w*)\\b" }, "entity-name-function": { "name": "entity.name.function.haxe.2", "match": "([_A-Za-z]\\w*)\\b(?=\\s*[\\(])" }, "import": { "name": "meta.import.haxe.2", "begin": "\\b(import)\\b", "end": "(;)", "patterns": [ { "match": "((\\b[a-z]\\w*\\.)*)((\\b[A-Z]\\w*\\.?|\\*)+)(\\b[_a-z]\\w*|\\*)?", "captures": { "1": { "name": "support.package.haxe.2" }, "3": { "name": "support.class.haxe.2" } } } ], "beginCaptures": { "1": { "name": "storage.type.import.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "import-using": { "name": "meta.using.haxe.2", "begin": "\\b(using)\\b", "end": "(;)", "patterns": [ { "match": "(([a-z]\\w*\\.)*)(([A-Z]\\w*\\.?)+)", "captures": { "1": { "name": "support.package.haxe.2" }, "3": { "name": "support.class.haxe.2" } } } ], "beginCaptures": { "1": { "name": "storage.type.using.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "keywords": { "patterns": [ { "name": "keyword.control.catch-exception.haxe.2", "match": "\\b(try|catch|throw)\\b" }, { "name": "keyword.control.haxe.flow-control.2", "match": "\\b(if|return|while|for|return|break|case|default|continue|do|while|for|switch|if|else)\\b" }, { "name": "keyword.control.directive.haxe.2", "match": "(\\.\\.\\.)" }, { "name": "keyword.other.untyped.haxe.2", "match": "\\b(cast|untyped)\\b" }, { "name": "keyword.other.trace.haxe.2", "match": "\\btrace\\b" }, { "name": "variable.language.haxe.2", "match": "\\b(this|super)\\b" }, { "name": "keyword.control.new.haxe.2", "match": "\\bnew\\b" }, { "name": "storage.type.variable.haxe.2", "match": "\\bvar\\b" }, { "name": "storage.type.function.haxe.2", "match": "\\bfunction\\b" }, { "name": "storage.type.class.haxe.2", "match": "\\b(abstract|class|enum|interface|typedef)\\b" } ] }, "keywords-abstract": { "patterns": [ { "name": "keyword.other.haxe.2", "match": "\\b(from|to)\\b" } ] }, "keywords-accessor": { "patterns": [ { "name": "keyword.other.haxe.2", "match": "\\b(default|get|set|dynamic|never|null)\\b" } ] }, "keywords-magic": { "patterns": [ { "name": "support.function.magic.haxe.2", "match": "\\b__\\w*__\\b" }, { "name": "support.variable.magic.haxe.2", "match": "\\bprototype\\b" } ] }, "keywords-reification": { "patterns": [ { "match": "(\\$)([iea])\\(", "captures": { "1": { "name": "punctuation.definition.variable.haxe.2" }, "2": { "name": "support.reification.haxe.2" } } }, { "match": "((\\$)([a-zA-Z.]*))", "captures": { "2": { "name": "punctuation.definition.variable.haxe.2" }, "3": { "name": "support.reification.haxe.2" } } } ] }, "macro": { "patterns": [ { "match": "((@:)(require|final|hack|native|coreApi|fakeEnum|macro|build|keep|keepSub|overload|extern|optional|feature|noCompletion|noUsing|allow|access|generic|publicFields|expose|defineFeature|runtime|initPackage|bind|bitmap|file|font|sound|ns|protected|getter|setter|meta|debug|noDebug|headerCode|headerClassCode|cppFileCode|functionCode|functionTailCode|buildXml|cppNamespaceCode|headerNamespaceCode|noStack|depend|include|internal|volatile|transient|functionBody|classContents|remove)\\b)", "captures": { "2": { "name": "punctuation.definition.variable.haxe.2" }, "3": { "name": "storage.modifier.macro.haxe.2" } } }, { "match": "((@:?)([a-zA-Z_]*))", "captures": { "2": { "name": "punctuation.definition.variable.haxe.2" }, "3": { "name": "support.macro.haxe.2" } } } ] }, "meta-static": { "name": "meta.static.haxe.2", "begin": "(static)", "end": "(?\u003c=[\\};])", "patterns": [ { "include": "#modifiers" }, { "include": "#method" }, { "include": "#variable" }, { "include": "#punctuation-terminator" } ], "beginCaptures": { "1": { "name": "storage.modifier.haxe.2" } } }, "method": { "name": "meta.method.haxe.2", "begin": "(?=function)", "end": "(?\u003c=[\\};])", "patterns": [ { "include": "#method-name" }, { "include": "#method-name-post" }, { "include": "#method-block" } ] }, "method-block": { "name": "meta.method.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "method-name": { "name": "meta.method.name.haxe.2", "begin": "\\b(function)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.function.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.function.haxe.2" } } }, "method-name-post": { "begin": "(?\u003c=\\w)", "end": "(\\{)|(;)", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" }, "2": { "name": "punctuation.terminator.haxe.2" } } }, "modifiers": { "name": "storage.modifier.haxe.2", "match": "\\b(public|private|static|dynamic|inline|macro|extern|override)\\b" }, "modifiers-inheritance": { "name": "storage.modifier.haxe.2", "match": "\\b(implements|extends)\\b" }, "operator-assignment": { "name": "keyword.operator.assignment.haxe.2", "match": "(=)" }, "operator-optional": { "name": "punctuation.definition.variable.haxe.2", "match": "(\\?)(?!\\s)" }, "operators": { "patterns": [ { "name": "keyword.operator.logical.haxe.2", "match": "(!|\u0026\u0026|\\|\\|)" }, { "name": "keyword.operator.bitwise.haxe.2", "match": "(~|\u0026|\\||\\^|\u003c\u003c|\u003e\u003e|\u003e\u003e\u003e)" }, { "name": "keyword.operator.comparison.haxe.2", "match": "(==|!=|\u003c=|\u003e=|\u003c\u003e|\u003c|\u003e)" }, { "name": "keyword.operator.increment-decrement.haxe.2", "match": "(\\-\\-|\\+\\+)" }, { "name": "keyword.operator.arithmetic.haxe.2", "match": "(\\-|\\+|\\*|\\/|%)" } ] }, "package": { "name": "meta.package.haxe.2", "match": "\\b(package)(\\s+([\\w.*]*))?\\s*(;)", "captures": { "1": { "name": "storage.type.package.haxe.2" }, "2": { "name": "support.package.haxe.2" }, "4": { "name": "punctuation.terminator.haxe.2" } } }, "parameters": { "name": "meta.parameters.haxe.2", "begin": "(\\()", "end": "(\\))", "patterns": [ { "include": "#operator-optional" }, { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.haxe.2" } } }, "punctuation-brackets": { "patterns": [ { "name": "punctuation.definition.other.haxe.2", "match": "([\\(\\\u003c\\)\\\u003e])" } ] }, "punctuation-separator": { "name": "punctuation.separator.haxe.2", "match": "([,:.?])" }, "punctuation-terminator": { "name": "punctuation.terminator.haxe.2", "match": ";" }, "regex": { "name": "string.regexp.haxe.2", "begin": "~/", "end": "(/[gimsu]*)|(\\n$)", "patterns": [ { "name": "constant.character.escape.haxe.2", "match": "\\\\." } ], "beginCaptures": { "1": { "name": "string.regexp.begin.haxe.2" } }, "endCaptures": { "1": { "name": "string.regexp.end.haxe.2" }, "2": { "name": "invalid.illegal.haxe.2" } } }, "strings": { "patterns": [ { "name": "string.quoted.double.haxe.2", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.haxe.2", "match": "\\\\." } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.haxe.2" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.haxe.2" } } }, { "name": "string.quoted.single.haxe.2", "begin": "'", "end": "'", "patterns": [ { "name": "constant.character.escape.haxe.2", "match": "\\\\." }, { "name": "constant.character.escape.haxe.2", "match": "\\$\\$" }, { "match": "(\\$)(\\{)([^}]*)(\\})", "captures": { "1": { "name": "variable.other.haxe.2" }, "2": { "name": "variable.other.haxe.2" }, "3": { "name": "variable.other.haxe.2" }, "4": { "name": "variable.other.haxe.2" } } }, { "match": "(\\$)([\\w]*)", "captures": { "1": { "name": "variable.other.haxe.2" }, "2": { "name": "variable.other.haxe.2" } } } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.haxe.2" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.haxe.2" } } } ] }, "support-class-name": { "match": "\\b(([a-z][a-zA-Z0-9]*\\.)*)(([A-Z]\\w*\\.?)+)\\b", "captures": { "1": { "name": "support.package.haxe.2" }, "3": { "name": "support.class.haxe.2" } } }, "type-abstract": { "name": "meta.type.abstract.haxe.2", "begin": "(?=abstract)", "end": "(?\u003c=\\})|(;)", "patterns": [ { "include": "#type-abstract-name" }, { "include": "#type-abstract-name-post" }, { "include": "#type-abstract-block" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "type-abstract-block": { "name": "meta.type.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#meta-static" }, { "include": "#method" }, { "include": "#modifiers" }, { "include": "#variable" }, { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "type-abstract-name": { "name": "meta.type.name.haxe.2", "begin": "\\b(abstract)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.class.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.type.class.haxe.2" } } }, "type-abstract-name-post": { "begin": "(?\u003c=\\w)", "end": "([\\{;])", "patterns": [ { "include": "#parameters" }, { "include": "#keywords-abstract" }, { "include": "#punctuation-brackets" }, { "include": "#punctuation-separator" }, { "include": "#support-class-name" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } } }, "type-class": { "name": "meta.type.class.haxe.2", "begin": "(?=class)", "end": "(?\u003c=\\})|(;)", "patterns": [ { "include": "#type-class-name" }, { "include": "#type-class-name-post" }, { "include": "#type-class-block" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "type-class-block": { "name": "meta.type.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#meta-static" }, { "include": "#method" }, { "include": "#modifiers" }, { "include": "#variable" }, { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "type-class-name": { "name": "meta.type.name.haxe.2", "begin": "\\b(class)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.class.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.type.class.haxe.2" } } }, "type-class-name-post": { "begin": "(?\u003c=\\w)", "end": "([\\{;])", "patterns": [ { "include": "#type-parameters" }, { "include": "#modifiers-inheritance" }, { "include": "#punctuation-brackets" }, { "include": "#punctuation-separator" }, { "include": "#support-class-name" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } } }, "type-enum": { "name": "meta.type.enum.haxe.2", "begin": "(?=enum)", "end": "(?\u003c=\\})|(;)", "patterns": [ { "include": "#type-enum-name" }, { "include": "#type-enum-name-post" }, { "include": "#type-enum-block" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "type-enum-block": { "name": "meta.type.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#type-parameters" }, { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "type-enum-name": { "name": "meta.type.name.haxe.2", "begin": "\\b(enum)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.class.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.type.class.haxe.2" } } }, "type-enum-name-post": { "begin": "(?\u003c=\\w)", "end": "([\\{;])", "patterns": [ { "include": "#type-parameters" }, { "include": "#punctuation-brackets" }, { "include": "#punctuation-separator" }, { "include": "#support-class-name" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } } }, "type-interface": { "name": "meta.type.interface.haxe.2", "begin": "(?=interface)", "end": "(?\u003c=\\})|(;)", "patterns": [ { "include": "#type-interface-name" }, { "include": "#type-interface-name-post" }, { "include": "#type-interface-block" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "type-interface-block": { "name": "meta.type.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#method" }, { "include": "#variable" }, { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "type-interface-name": { "name": "meta.type.name.haxe.2", "begin": "\\b(interface)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.class.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.type.class.haxe.2" } } }, "type-interface-name-post": { "begin": "(?\u003c=\\w)", "end": "([\\{;])", "patterns": [ { "include": "#modifiers-inheritance" }, { "include": "#punctuation-brackets" }, { "include": "#punctuation-separator" }, { "include": "#support-class-name" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } } }, "type-parameters": { "name": "meta.type.parameters.haxe.2", "begin": "(\\\u003c)", "end": "(\\\u003e)", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.haxe.2" } } }, "type-typedef": { "name": "meta.type.typedef.haxe.2", "begin": "(?=typedef)", "end": "(?\u003c=\\})|(;)", "patterns": [ { "include": "#type-typedef-name" }, { "include": "#type-typedef-name-post" }, { "include": "#type-typedef-block" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "type-typedef-block": { "name": "meta.type.block.haxe.2", "begin": "(?\u003c=\\{)", "end": "(\\})", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.end.haxe.2" } } }, "type-typedef-name": { "name": "meta.type.name.haxe.2", "begin": "\\b(typedef)\\b", "end": "([_A-Za-z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.class.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.type.class.haxe.2" } } }, "type-typedef-name-post": { "begin": "(?\u003c=\\w)", "end": "(\\{)|(?=;)", "patterns": [ { "include": "#punctuation-brackets" }, { "include": "#punctuation-separator" }, { "include": "#operator-assignment" }, { "include": "#support-class-name" } ], "endCaptures": { "1": { "name": "punctuation.definition.block.begin.haxe.2" } } }, "variable": { "name": "meta.variable.haxe.2", "begin": "(?=var)", "end": "(;)", "patterns": [ { "include": "#variable-name" }, { "include": "#variable-assign" }, { "include": "#variable-name-post" } ], "endCaptures": { "1": { "name": "punctuation.terminator.haxe.2" } } }, "variable-accessors": { "name": "meta.parameters.haxe.2", "begin": "(\\()", "end": "(\\))", "patterns": [ { "include": "#operator-optional" }, { "include": "#keywords-accessor" }, { "include": "#punctuation-separator" } ], "beginCaptures": { "1": { "name": "punctuation.definition.parameters.begin.haxe.2" } }, "endCaptures": { "1": { "name": "punctuation.definition.parameters.end.haxe.2" } } }, "variable-assign": { "begin": "(=)", "end": "(?=;)", "patterns": [ { "include": "#block" }, { "include": "#block-contents" } ], "beginCaptures": { "1": { "name": "keyword.operator.assignment.haxe.2" } } }, "variable-name": { "name": "meta.variable.name.haxe.2", "begin": "\\b(var)\\b", "end": "([_a-zA-Z]\\w*)", "beginCaptures": { "1": { "name": "storage.type.variable.haxe.2" } }, "endCaptures": { "1": { "name": "entity.name.variable.haxe.2" } } }, "variable-name-post": { "begin": "(?\u003c=\\w)", "end": "(?=;)|(?==)", "patterns": [ { "include": "#variable-accessors" }, { "include": "#block-contents" } ] } } }