Skip to content

Commit

Permalink
[Added] Angular v17 Control-Block Syntax (#24)
Browse files Browse the repository at this point in the history
* Update NgxHTML.sublime-syntax

* Update NgxHTML.sublime-syntax
  • Loading branch information
thecodechef authored Dec 19, 2023
1 parent 08d07fc commit 6c14550
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions NgxHTML.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@ version: 2

extends: Packages/HTML/HTML.sublime-syntax

variables:
angular_blocks: (?<=\@)\b(?xi:for | if | else | else if | switch | case | empty | placeholder | defer | default | error | loading)\b

contexts:
main:
- meta_prepend: true
- include: interpolation
- include: angular-blocks

interpolation:
- match: '{{'
Expand Down Expand Up @@ -82,3 +86,33 @@ contexts:
push:
- tag-event-attribute-meta
- tag-event-attribute-assignment


angular-blocks:
- match: '(@){{angular_blocks}}'
scope: keyword.control.control-flow.html
captures:
1: punctuation.definition.keyword.html
- match: \(
scope: punctuation.section.group.begin.html
push:
- meta_scope: meta.group.html
- match: \b(async)\b
scope: keyword.control.html
- match: \b(track|of|prefetch on|on|prefetch when|when|as)\b
scope: keyword.operator.word.html
- match: \b(minimum|after)\b(\?)
captures:
1: keyword.operator.word.html
2: keyword.control.question.html
- match: \)
scope: punctuation.section.group.end.html
pop: 1
- match: \{
scope: punctuation.section.block.begin.html
push:
- meta_scope: meta.block.html
- include: main
- match: \}
scope: punctuation.section.block.end.html
pop: 1

0 comments on commit 6c14550

Please sign in to comment.