@@ -1002,7 +1002,7 @@ repository:
1002
1002
# object literals
1003
1003
after-operator-block-as-object-literal :
1004
1004
name : meta.objectliteral.ts
1005
- begin : (?<=[=(,\[?+!]|{{lookBehindAwait}}|{{lookBehindReturn}}|{{lookBehindYield}}|{{lookBehindThrow}}|{{lookBehindIn}}|{{lookBehindOf}}|{{lookBehindTypeof}}|&&|\|\||\*)\s*(\{)
1005
+ begin : (?<!\+\+|--)(?< =[=(,\[?+!]|{{lookBehindAwait}}|{{lookBehindReturn}}|{{lookBehindYield}}|{{lookBehindThrow}}|{{lookBehindIn}}|{{lookBehindOf}}|{{lookBehindTypeof}}|&&|\|\||\*)\s*(\{)
1006
1006
beginCaptures :
1007
1007
' 1 ' : { name: punctuation.definition.block.ts }
1008
1008
end : \}
@@ -1154,7 +1154,7 @@ repository:
1154
1154
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
1155
1155
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
1156
1156
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
1157
- begin : (?:(?<={{lookBehindReturn}}|{{lookBehindThrow}}|{{lookBehindYield}}|{{lookBehindAwait}}|{{lookBehindDefault}}|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)
1157
+ begin : (?:(?<!\+\+|--)(?< ={{lookBehindReturn}}|{{lookBehindThrow}}|{{lookBehindYield}}|{{lookBehindAwait}}|{{lookBehindDefault}}|[=(,:>*?\&\|\^]|[^_$[:alnum:]](?:\+\+|\-\-)|[^\+]\+|[^\-]\-))\s*(<)(?!<?\=)
1158
1158
beginCaptures :
1159
1159
' 1 ' : { name: meta.brace.angle.ts }
1160
1160
end : (\>)\s*
@@ -1341,11 +1341,13 @@ repository:
1341
1341
- name : support.class.builtin.ts
1342
1342
match : |-
1343
1343
(?x){{startOfIdentifier}}(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
1344
- |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Promise| Proxy
1344
+ |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
1345
1345
|Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
1346
1346
|Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
1347
1347
- name : support.class.error.ts
1348
1348
match : ' {{startOfIdentifier}}((Eval|Internal|Range|Reference|Syntax|Type|URI)?Error)\b(?!\$)'
1349
+ - name : support.class.promise.ts
1350
+ match : ' {{startOfIdentifier}}(Promise)\b(?!\$)'
1349
1351
# known builtin function calls
1350
1352
- name : support.function.ts
1351
1353
match : |-
@@ -1598,6 +1600,8 @@ repository:
1598
1600
slice|splitText|stepDown|stepUp|stopImmediatePropagation|stopPropagation|
1599
1601
submit|substringData|supports|surroundContents|takeRecords|terminate|toBlob|
1600
1602
toDataURL|toggle|toString|values|write|writeln
1603
+ ) |
1604
+ (all|catch|finally|race|reject|resolve|then
1601
1605
)
1602
1606
)(?=\s*\()
1603
1607
captures:
@@ -1606,6 +1610,7 @@ repository:
1606
1610
'3': { name: support.function.event-handler.ts }
1607
1611
'4': { name: support.function.ts }
1608
1612
'5': { name: support.function.dom.ts }
1613
+ '6': { name: support.function.promise.ts }
1609
1614
1610
1615
identifiers :
1611
1616
patterns :
@@ -2029,77 +2034,82 @@ repository:
2029
2034
regex :
2030
2035
patterns :
2031
2036
- name : string.regexp.ts
2032
- begin : (?<=[=(:,\[?+!]|{{lookBehindReturn}}|{{lookBehindCase}}|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimuy ]*(?!\s*[a-zA-Z0-9_$]))
2037
+ begin : (?<!\+\+|--)(?< =[=(:,\[?+!]|{{lookBehindReturn}}|{{lookBehindCase}}|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimsuy ]*(?!\s*[a-zA-Z0-9_$]))
2033
2038
beginCaptures :
2034
- ' 1 ' : {name: punctuation.definition.string.begin.ts}
2035
- end : (/)([gimuy ]*)
2039
+ ' 1 ' : { name: punctuation.definition.string.begin.ts }
2040
+ end : (/)([gimsuy ]*)
2036
2041
endCaptures :
2037
- ' 1 ' : {name: punctuation.definition.string.end.ts}
2038
- ' 2 ' : {name: keyword.other.ts}
2042
+ ' 1 ' : { name: punctuation.definition.string.end.ts }
2043
+ ' 2 ' : { name: keyword.other.ts}
2039
2044
patterns :
2040
2045
- include : ' #regexp'
2041
2046
# Check if complete regexp syntax
2042
2047
- name : string.regexp.ts
2043
- begin : (?<![_$[:alnum:])\]])\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimuy ]*(?!\s*[a-zA-Z0-9_$]))
2048
+ begin : (?<![_$[:alnum:])\]]|\+\+|-- )\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/(?![\/*])[gimsuy ]*(?!\s*[a-zA-Z0-9_$]))
2044
2049
beginCaptures :
2045
- ' 0 ' : {name: punctuation.definition.string.begin.ts}
2046
- end : (/)([gimuy ]*)
2050
+ ' 0 ' : { name: punctuation.definition.string.begin.ts }
2051
+ end : (/)([gimsuy ]*)
2047
2052
endCaptures :
2048
- ' 1 ' : {name: punctuation.definition.string.end.ts}
2049
- ' 2 ' : {name: keyword.other.ts}
2053
+ ' 1 ' : { name: punctuation.definition.string.end.ts }
2054
+ ' 2 ' : { name: keyword.other.ts }
2050
2055
patterns :
2051
2056
- include : ' #regexp'
2052
2057
2053
2058
regexp :
2054
2059
patterns :
2055
2060
- name : keyword.control.anchor.regexp
2056
2061
match : \\[bB]|\^|\$
2057
- - name : keyword.other.back-reference.regexp
2058
- match : \\[1-9]\d*
2062
+ - match : \\[1-9]\d*|\\k<([a-zA-Z_$][\w$]*)>
2063
+ captures :
2064
+ ' 0 ' : { name: keyword.other.back-reference.regexp }
2065
+ ' 1 ' : { name: variable.other.regexp }
2059
2066
- name : keyword.operator.quantifier.regexp
2060
2067
match : ' [?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??'
2061
2068
- name : keyword.operator.or.regexp
2062
2069
match : \|
2063
2070
- name : meta.group.assertion.regexp
2064
- begin : (\()((\?=)|(\?!))
2071
+ begin : (\()((\?=)|(\?!)|(\?<=)|(\?<!) )
2065
2072
beginCaptures :
2066
- ' 1 ' : {name: punctuation.definition.group.regexp}
2067
- ' 2 ' : {name: punctuation.definition.group.assertion.regexp}
2068
- ' 3 ' : {name: meta.assertion.look-ahead.regexp}
2069
- ' 4 ' : {name: meta.assertion.negative-look-ahead.regexp}
2073
+ ' 1 ' : { name: punctuation.definition.group.regexp }
2074
+ ' 2 ' : { name: punctuation.definition.group.assertion.regexp }
2075
+ ' 3 ' : { name: meta.assertion.look-ahead.regexp }
2076
+ ' 4 ' : { name: meta.assertion.negative-look-ahead.regexp }
2077
+ ' 5 ' : { name: meta.assertion.look-behind.regexp }
2078
+ ' 6 ' : { name: meta.assertion.negative-look-behind.regexp }
2070
2079
end : (\))
2071
2080
endCaptures :
2072
- ' 1 ' : {name: punctuation.definition.group.regexp}
2081
+ ' 1 ' : {name: punctuation.definition.group.regexp }
2073
2082
patterns :
2074
2083
- include : ' #regexp'
2075
2084
- name : meta.group.regexp
2076
- begin : \((\?:)?
2085
+ begin : \((?:( \?:)|(?:\?<([a-zA-Z_$][\w$]*)>) )?
2077
2086
beginCaptures :
2078
- ' 0 ' : {name: punctuation.definition.group.regexp}
2079
- ' 1 ' : {name: punctuation.definition.group.no-capture.regexp}
2087
+ ' 0 ' : { name: punctuation.definition.group.regexp }
2088
+ ' 1 ' : { name: punctuation.definition.group.no-capture.regexp }
2089
+ ' 2 ' : { name: variable.other.regexp }
2080
2090
end : \)
2081
2091
endCaptures :
2082
- ' 0 ' : {name: punctuation.definition.group.regexp}
2092
+ ' 0 ' : { name: punctuation.definition.group.regexp }
2083
2093
patterns :
2084
2094
- include : ' #regexp'
2085
2095
- name : constant.other.character-class.set.regexp
2086
2096
begin : (\[)(\^)?
2087
2097
beginCaptures :
2088
- ' 1 ' : {name: punctuation.definition.character-class.regexp}
2089
- ' 2 ' : {name: keyword.operator.negation.regexp}
2098
+ ' 1 ' : { name: punctuation.definition.character-class.regexp }
2099
+ ' 2 ' : { name: keyword.operator.negation.regexp }
2090
2100
end : (\])
2091
2101
endCaptures :
2092
- ' 1 ' : {name: punctuation.definition.character-class.regexp}
2102
+ ' 1 ' : {name: punctuation.definition.character-class.regexp }
2093
2103
patterns :
2094
2104
- name : constant.other.character-class.range.regexp
2095
2105
match : (?:.|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))\-(?:[^\]\\]|(\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\c[A-Z])|(\\.))
2096
2106
captures :
2097
- ' 1 ' : {name: constant.character.numeric.regexp}
2098
- ' 2 ' : {name: constant.character.control.regexp}
2099
- ' 3 ' : {name: constant.character.escape.backslash.regexp}
2100
- ' 4 ' : {name: constant.character.numeric.regexp}
2101
- ' 5 ' : {name: constant.character.control.regexp}
2102
- ' 6 ' : {name: constant.character.escape.backslash.regexp}
2107
+ ' 1 ' : { name: constant.character.numeric.regexp }
2108
+ ' 2 ' : { name: constant.character.control.regexp }
2109
+ ' 3 ' : { name: constant.character.escape.backslash.regexp }
2110
+ ' 4 ' : { name: constant.character.numeric.regexp }
2111
+ ' 5 ' : { name: constant.character.control.regexp }
2112
+ ' 6 ' : { name: constant.character.escape.backslash.regexp }
2103
2113
- include : ' #regex-character-class'
2104
2114
- include : ' #regex-character-class'
2105
2115
0 commit comments