Родитель
f0fc7a0a00
Коммит
cf95b1ec37
|
@ -1554,7 +1554,7 @@ repository:
|
|||
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
|
||||
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
|
||||
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
|
||||
begin: (?:(?<=return|throw|yield|await|default|[=(,:>*?]))\s*(<)(?!<?\=)
|
||||
begin: (?:(?<=return|throw|yield|await|default|[=(,:>+*?]))\s*(<)(?!<?\=)
|
||||
beginCaptures:
|
||||
'1': { name: meta.brace.angle.ts }
|
||||
end: (\>)\s*
|
||||
|
|
|
@ -4255,7 +4255,7 @@
|
|||
<key>name</key>
|
||||
<string>cast.expr.ts</string>
|
||||
<key>begin</key>
|
||||
<string>(?:(?<=return|throw|yield|await|default|[=(,:>*?]))\s*(<)(?!<?\=)</string>
|
||||
<string>(?:(?<=return|throw|yield|await|default|[=(,:>+*?]))\s*(<)(?!<?\=)</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
|
|
|
@ -0,0 +1,90 @@
|
|||
original file
|
||||
-----------------------------------
|
||||
// @onlyOwnGrammar - As this has cast expression
|
||||
var x = 0;
|
||||
var y = 1;
|
||||
var z = <number>x + <number>y;
|
||||
-----------------------------------
|
||||
|
||||
Grammar: TypeScript.tmLanguage
|
||||
-----------------------------------
|
||||
>// @onlyOwnGrammar - As this has cast expression
|
||||
^^
|
||||
source.ts comment.line.double-slash.ts punctuation.definition.comment.ts
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
source.ts comment.line.double-slash.ts
|
||||
>var x = 0;
|
||||
^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts constant.numeric.decimal.ts
|
||||
^
|
||||
source.ts punctuation.terminator.statement.ts
|
||||
^^
|
||||
source.ts
|
||||
>var y = 1;
|
||||
^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts constant.numeric.decimal.ts
|
||||
^
|
||||
source.ts punctuation.terminator.statement.ts
|
||||
^^
|
||||
source.ts
|
||||
>var z = <number>x + <number>y;
|
||||
^^^
|
||||
source.ts meta.var.expr.ts storage.type.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts meta.definition.variable.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts meta.var-single-variable.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.assignment.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts meta.brace.angle.ts
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts cast.expr.ts support.type.primitive.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts meta.brace.angle.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts keyword.operator.arithmetic.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts meta.brace.angle.ts
|
||||
^^^^^^
|
||||
source.ts meta.var.expr.ts cast.expr.ts support.type.primitive.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts cast.expr.ts meta.brace.angle.ts
|
||||
^
|
||||
source.ts meta.var.expr.ts variable.other.readwrite.ts
|
||||
^
|
||||
source.ts punctuation.terminator.statement.ts
|
|
@ -0,0 +1,4 @@
|
|||
// @onlyOwnGrammar - As this has cast expression
|
||||
var x = 0;
|
||||
var y = 1;
|
||||
var z = <number>x + <number>y;
|
Загрузка…
Ссылка в новой задаче