Skip to content

Commit 667d217

Browse files
Update TypeScript.YAML-tmLanguage
1 parent 4457737 commit 667d217

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

TypeScript.YAML-tmLanguage

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,10 @@ repository:
415415

416416
cast:
417417
name: cast.expr.ts
418-
# To differentiate a cast vs a relational <, this regexp tries to use the surrounding context
419-
# If < is preceeded by 'return', 'throw', 'yield' its most likely a type assertion
420-
# An '=', '(', ',', ':', or '>' character followed by '<' is likely a type assertion, as otherwise its a syntax error
421-
# '<=' and '<<=' are definately not type assertions, as they are assignment operators.
418+
# We need to differentiate between the relational '<' operator and the beginning of a type assertion/cast using the surrounding context.
419+
# If '<' is preceeded by 'return', 'throw', 'yield', or 'await', it's most likely a type assertion
420+
# If '=', '(', ',', ':', or '>' are followed by a '<', it is also likely a type assertion as otherwise it would be a syntax error
421+
# '<=' and '<<=' are cannot be type assertions, as they are assignment operators.
422422
begin: '(?:(?<=return|throw|yield|await|[=(,:>]))\s*(<)(?!<?\=)'
423423
beginCaptures:
424424
'1': { name: meta.brace.angle.ts }
@@ -618,4 +618,4 @@ repository:
618618
name: storage.type.property.ts
619619
match: \b(get|set)\b
620620

621-
...
621+
...

0 commit comments

Comments
 (0)