Skip to content

Commit 11b2d50

Browse files
deathaxeprincemaple
authored andcommitted
Add support for typeof and void operators
1 parent 8945ce0 commit 11b2d50

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

NgxHTML.sublime-syntax

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ contexts:
564564
- match: \?(?!\.)
565565
scope: keyword.operator.ternary.ngx
566566
push: ng-ternary-expression
567+
- match: (?:typeof|void){{ident_break}}
568+
scope: keyword.operator.type.ngx
567569

568570
ng-ternary-expression:
569571
- match: ':'

tests/syntax_test_scopes.component.html

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,19 @@
655655
<!-- ^ punctuation.definition.string.end.ngx -->
656656
<!-- ^^ punctuation.section.embedded.end.ngx.html -->
657657

658+
{{ type = typeof 32 }}
659+
<!-- ^^^^ variable.other.readwrite.ngx -->
660+
<!-- ^ keyword.operator.assignment.ngx -->
661+
<!-- ^^^^^^ keyword.operator.type.ngx -->
662+
<!-- ^^ meta.number.integer.decimal.ngx constant.numeric.value.ngx -->
663+
664+
665+
{{ type = void 32 }}
666+
<!-- ^^^^ variable.other.readwrite.ngx -->
667+
<!-- ^ keyword.operator.assignment.ngx -->
668+
<!-- ^^^^ keyword.operator.type.ngx -->
669+
<!-- ^^ meta.number.integer.decimal.ngx constant.numeric.value.ngx -->
670+
658671
<!-- property subscription -->
659672
{{ person['name'][0] = "Mirabel" }}
660673
<!--^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.embedded.expression.ngx.html -->

0 commit comments

Comments
 (0)