Skip to content

Commit

Permalink
[typescript] update grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
aeschli authored and kieferrm committed Nov 21, 2016
1 parent 9ed81c4 commit 7ba55c5
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 6 deletions.
39 changes: 37 additions & 2 deletions extensions/javascript/syntaxes/JavaScript.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1018,6 +1018,9 @@
{
"include": "#indexer-declaration"
},
{
"include": "#indexer-mapped-type-declaration"
},
{
"include": "#field-declaration"
},
Expand Down Expand Up @@ -1219,6 +1222,38 @@
}
]
},
"indexer-mapped-type-declaration": {
"name": "meta.indexer.mappedtype.declaration.js",
"begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+",
"beginCaptures": {
"1": {
"name": "storage.modifier.js"
},
"2": {
"name": "meta.brace.square.js"
},
"3": {
"name": "entity.name.type.js"
},
"4": {
"name": "keyword.operator.expression.in.js"
}
},
"end": "(\\])\\s*(\\?\\s*)?|$",
"endCaptures": {
"1": {
"name": "meta.brace.square.js"
},
"2": {
"name": "keyword.operator.optional.js"
}
},
"patterns": [
{
"include": "#type"
}
]
},
"function-declaration": {
"name": "meta.function.js",
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
Expand Down Expand Up @@ -2700,7 +2735,7 @@
},
{
"name": "string.regex.js",
"begin": "/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:]])/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.js"
Expand Down Expand Up @@ -3460,5 +3495,5 @@
]
}
},
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/578dd5db70333e3b6826ff529276f32916a2c81b"
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b5ce6b5632711b9230a33213874b818d994acab9"
}
39 changes: 37 additions & 2 deletions extensions/typescript/syntaxes/TypeScript.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,9 @@
{
"include": "#indexer-declaration"
},
{
"include": "#indexer-mapped-type-declaration"
},
{
"include": "#field-declaration"
},
Expand Down Expand Up @@ -1215,6 +1218,38 @@
}
]
},
"indexer-mapped-type-declaration": {
"name": "meta.indexer.mappedtype.declaration.ts",
"begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+",
"beginCaptures": {
"1": {
"name": "storage.modifier.ts"
},
"2": {
"name": "meta.brace.square.ts"
},
"3": {
"name": "entity.name.type.ts"
},
"4": {
"name": "keyword.operator.expression.in.ts"
}
},
"end": "(\\])\\s*(\\?\\s*)?|$",
"endCaptures": {
"1": {
"name": "meta.brace.square.ts"
},
"2": {
"name": "keyword.operator.optional.ts"
}
},
"patterns": [
{
"include": "#type"
}
]
},
"function-declaration": {
"name": "meta.function.ts",
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
Expand Down Expand Up @@ -2709,7 +2744,7 @@
},
{
"name": "string.regex.ts",
"begin": "/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:]])/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.ts"
Expand Down Expand Up @@ -3167,5 +3202,5 @@
]
}
},
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/578dd5db70333e3b6826ff529276f32916a2c81b"
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b5ce6b5632711b9230a33213874b818d994acab9"
}
39 changes: 37 additions & 2 deletions extensions/typescript/syntaxes/TypeScriptReact.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,9 @@
{
"include": "#indexer-declaration"
},
{
"include": "#indexer-mapped-type-declaration"
},
{
"include": "#field-declaration"
},
Expand Down Expand Up @@ -1218,6 +1221,38 @@
}
]
},
"indexer-mapped-type-declaration": {
"name": "meta.indexer.mappedtype.declaration.tsx",
"begin": "(?:(?<!\\.|\\$)\\b(readonly)\\s*)?(\\[)\\s*([_$[:alpha:]][_$[:alnum:]]*)\\s+(in)\\s+",
"beginCaptures": {
"1": {
"name": "storage.modifier.tsx"
},
"2": {
"name": "meta.brace.square.tsx"
},
"3": {
"name": "entity.name.type.tsx"
},
"4": {
"name": "keyword.operator.expression.in.tsx"
}
},
"end": "(\\])\\s*(\\?\\s*)?|$",
"endCaptures": {
"1": {
"name": "meta.brace.square.tsx"
},
"2": {
"name": "keyword.operator.optional.tsx"
}
},
"patterns": [
{
"include": "#type"
}
]
},
"function-declaration": {
"name": "meta.function.tsx",
"begin": "(?<!\\.|\\$)\\b(?:(export)\\s+)?(?:(async)\\s+)?(function\\b)(?:\\s*(\\*))?(?:(?:\\s+|(?<=\\*))([_$[:alpha:]][_$[:alnum:]]*))?\\s*",
Expand Down Expand Up @@ -2699,7 +2734,7 @@
},
{
"name": "string.regex.tsx",
"begin": "/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"begin": "(?<![_$[:alnum:]])/(?![/*])(?=(?:[^/\\\\\\[]|\\\\.|\\[([^\\]\\\\]|\\\\.)+\\])+/(?![/*])[gimy]*(?!\\s*[a-zA-Z0-9_$]))",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.tsx"
Expand Down Expand Up @@ -3459,5 +3494,5 @@
]
}
},
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/578dd5db70333e3b6826ff529276f32916a2c81b"
"version": "https://github.com/Microsoft/TypeScript-TmLanguage/commit/b5ce6b5632711b9230a33213874b818d994acab9"
}

1 comment on commit 7ba55c5

@garbear601
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.