Skip to content

Commit 6c14550

Browse files
authored
[Added] Angular v17 Control-Block Syntax (#24)
* Update NgxHTML.sublime-syntax * Update NgxHTML.sublime-syntax
1 parent 08d07fc commit 6c14550

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

NgxHTML.sublime-syntax

+34
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,14 @@ version: 2
88

99
extends: Packages/HTML/HTML.sublime-syntax
1010

11+
variables:
12+
angular_blocks: (?<=\@)\b(?xi:for | if | else | else if | switch | case | empty | placeholder | defer | default | error | loading)\b
13+
1114
contexts:
1215
main:
1316
- meta_prepend: true
1417
- include: interpolation
18+
- include: angular-blocks
1519

1620
interpolation:
1721
- match: '{{'
@@ -82,3 +86,33 @@ contexts:
8286
push:
8387
- tag-event-attribute-meta
8488
- tag-event-attribute-assignment
89+
90+
91+
angular-blocks:
92+
- match: '(@){{angular_blocks}}'
93+
scope: keyword.control.control-flow.html
94+
captures:
95+
1: punctuation.definition.keyword.html
96+
- match: \(
97+
scope: punctuation.section.group.begin.html
98+
push:
99+
- meta_scope: meta.group.html
100+
- match: \b(async)\b
101+
scope: keyword.control.html
102+
- match: \b(track|of|prefetch on|on|prefetch when|when|as)\b
103+
scope: keyword.operator.word.html
104+
- match: \b(minimum|after)\b(\?)
105+
captures:
106+
1: keyword.operator.word.html
107+
2: keyword.control.question.html
108+
- match: \)
109+
scope: punctuation.section.group.end.html
110+
pop: 1
111+
- match: \{
112+
scope: punctuation.section.block.begin.html
113+
push:
114+
- meta_scope: meta.block.html
115+
- include: main
116+
- match: \}
117+
scope: punctuation.section.block.end.html
118+
pop: 1

0 commit comments

Comments
 (0)