29 lines
180 KiB
JavaScript
29 lines
180 KiB
JavaScript
|
const lang = Object.freeze({ "displayName": "TSX", "name": "tsx", "patterns": [{ "include": "#directives" }, { "include": "#statements" }, { "include": "#shebang" }], "repository": { "access-modifier": { "match": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(abstract|declare|override|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\\.\\.\\.)|(?!\\.))", "name": "storage.modifier.tsx" }, "after-operator-block-as-object-literal": { "begin": "(?<!\\+\\+|--)(?<=[:=(,\\[?+!>]|^await|[^\\._$[:alnum:]]await|^return|[^\\._$[:alnum:]]return|^yield|[^\\._$[:alnum:]]yield|^throw|[^\\._$[:alnum:]]throw|^in|[^\\._$[:alnum:]]in|^of|[^\\._$[:alnum:]]of|^typeof|[^\\._$[:alnum:]]typeof|&&|\\|\\||\\*)\\s*(\\{)", "beginCaptures": { "1": { "name": "punctuation.definition.block.tsx" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.block.tsx" } }, "name": "meta.objectliteral.tsx", "patterns": [{ "include": "#object-member" }] }, "array-binding-pattern": { "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", "beginCaptures": { "1": { "name": "keyword.operator.rest.tsx" }, "2": { "name": "punctuation.definition.binding-pattern.array.tsx" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.binding-pattern.array.tsx" } }, "patterns": [{ "include": "#binding-element" }, { "include": "#punctuation-comma" }] }, "array-binding-pattern-const": { "begin": "(?:(\\.\\.\\.)\\s*)?(\\[)", "beginCaptures": { "1": { "name": "keyword.operator.rest.tsx" }, "2": { "name": "punctuation.definition.binding-pattern.array.tsx" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.binding-pattern.array.tsx" } }, "patterns": [{ "include": "#binding-element-const" }, { "include": "#punctuation-comma" }] }, "array-literal": { "begin": "\\s*(\\[)", "beginCaptures": { "1": { "name": "meta.brace.square.tsx" } }, "end": "\\]", "endCaptures": { "0": { "name": "meta.brace.square.tsx" } }, "name": "meta.array.literal.tsx", "patterns": [{ "include": "#expression" }, { "include": "#punctuation-comma" }] }, "arrow-function": { "patterns": [{ "captures": { "1": { "name": "storage.modifier.async.tsx" }, "2": { "name": "variable.parameter.tsx" } }, "match": "(?:(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\\s+)?([_$[:alpha:]][_$[:alnum:]]*)\\s*(?==>)", "name": "meta.arrow.tsx" }, { "begin": "(?x) (?:\n(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(\\basync)\n)? ((?<![})!\\]])\\s*\n(?=\n\n(\n(<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>)*>\\s*)?\n[(]\\s*(\\/\\*([^\\*]|(\\*[^\\/]))*\\*\\/\\s*)*\n(\n([)]\\s*:) |\n((\\.\\.\\.\\s*)?[_$[:alpha:]][_$[:alnum:]]*\\s*:)\n)\n) |\n(\n[<]\\s*[_$[:alpha:]][_$[:alnum:]]*\\s+extends\\s*[^=>]\n) |\n# arrow function possible to detect only with => on same line\n(\n(<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<]|\\<\\s*(((const\\s+)?[_$[:alpha:]])|(\\{([^\\{\\}]|(\\{([^\\{\\}]|\\{[^\\{\\}]*\\})*\\}))*\\})|(\\(([^\\(\\)]|(\\(([^\\(\\)]|\\([^\\(\\)]*\\))*\\)))*\\))|(\\[([^\\[\\]]|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\])*\\]))*\\]))([^=<>]|=[^<])*\\>)*\\>
|
||
|
(\\[)\\s*
|
||
|
[\\w$]+
|
||
|
(?:
|
||
|
(?:\\[\\])?
|
||
|
\\.
|
||
|
[\\w$]+
|
||
|
)*
|
||
|
(?:
|
||
|
\\s*
|
||
|
(=)
|
||
|
\\s*
|
||
|
(
|
||
|
|
||
|
(?>
|
||
|
"(?:(?:\\*(?!/))|(?:\\\\(?!"))|[^*\\\\])*?" |
|
||
|
'(?:(?:\\*(?!/))|(?:\\\\(?!'))|[^*\\\\])*?' |
|
||
|
\\[ (?:(?:\\*(?!/))|[^*])*? \\] |
|
||
|
(?:(?:\\*(?!/))|\\s(?!\\s*\\])|\\[.*?(?:\\]|(?=\\*/))|[^*\\s\\[\\]])*
|
||
|
)*
|
||
|
)
|
||
|
)?
|
||
|
\\s*(?:(\\])((?:[^*\\s]|\\*[^\\s/])+)?|(?=\\*/))`, "name": "variable.other.jsdoc" }] }, { "begin": "(?x)\n(\n(@)\n(?:define|enum|exception|export|extends|lends|implements|modifies\n|namespace|private|protected|returns?|satisfies|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" }] }, { "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "entity.name.type.instance.jsdoc" } }, "match": "(?x)\n(\n(@)\n(?:alias|augments|callback|constructs|emits|event|fires|exports?\n|extends|external|function|func|host|lends|listens|interface|memberof!?\n|method|module|mixes|mixin|name|requires|see|this|typedef|uses)\n)\n\\s+\n(\n(?:\n[^{}@\\s*] | \\*[^/]\n)+\n)" }, { "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" } }, "contentName": "variable.other.jsdoc", "end": "(\\3)|(?=$|\\*/)", "endCaptures": { "0": { "name": "variable.other.jsdoc" }, "1": { "name": "punctuation.definition.string.end.jsdoc" } } }, { "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" }, "3": { "name": "variable.other.jsdoc" } }, "match": "((@)(?:default(?:value)?|license|tutorial|variation|version))\\s+([^\\s*]+)" }, { "captures": { "1": { "name": "punctuation.definition.block.tag.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", "name": "storage.type.class.jsdoc" }, { "include": "#inline-tags" }, { "captures": { "1": { "name": "storage.type.class.jsdoc" }, "2": { "name": "punctuation.definition.block.tag.jsdoc" } }, "match": "((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\\s+)" }] }, "enum-declaration": { "begin": "(?<![_$[:alnum:]])(?:(?<=\\.\\.\\.)|(?<!\\.))(?:(\\bexport)\\s+)?(?:(\\bdeclare)\\s+)?(?:\\b(const)\\s+)?\\b(enum)\\s+([_$[:alpha:]][_$[:alnum:]]*)", "beginCaptures": { "1": { "name": "keyword.control.export.tsx" }, "2": { "name": "storage.modifier.tsx" }, "3": { "name": "storage.modifier.tsx" }, "4": { "name": "storage.type.enum.tsx" }, "5": { "name": "entity.name.type.enum.tsx" } }, "end": "(?<=\\})", "name": "meta.enum.declaration.tsx", "patterns": [{ "include": "#comment" }, { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.definition.block.tsx" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.block.tsx" } }, "patterns": [{ "include": "#comment" }, { "begin": "([_$[:alpha:]][_$[:alnum:]]*)", "beginCaptures": { "0": { "name": "variable.other.enummember.tsx" } }, "end": "(?=,|\\}|$)", "patterns": [{ "include": "#comment" }, { "include": "#variable-initializer" }] }, { "begin": "(?=((\\'([^\\'\\\\]|\\\\.)*\\')|(\\\"([^\\\"\\\\]|\\\\.)*\\\")|(\\`([^\\`\\\\]|\\\\.)*\\`)|(\\[([^\\[\\]]|\\[[^\\[\\]]*\\]
|
||
|
var tsx = [
|
||
|
lang
|
||
|
];
|
||
|
|
||
|
export { tsx as default };
|