diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
new file mode 100644
index 0000000..2bde098
--- /dev/null
+++ b/.github/workflows/test.yaml
@@ -0,0 +1,16 @@
+name: Syntax Tests
+
+on: [push, pull_request]
+
+jobs:
+ st4_syntax_tests:
+ name: Run ST4 Syntax Tests
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+
+ - uses: SublimeText/syntax-test-action@v2
+ with:
+ build: 4152
+ default_packages: v4152
+ package_name: Ngx HTML
diff --git a/NgxHTML.sublime-syntax b/NgxHTML.sublime-syntax
index 023fdc9..49a9ca8 100644
--- a/NgxHTML.sublime-syntax
+++ b/NgxHTML.sublime-syntax
@@ -93,26 +93,27 @@ contexts:
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
+ - match: \{
+ scope: punctuation.section.block.begin.html
+ push:
+ - meta_scope: meta.block.html
+ - include: main
+ - match: \}
+ scope: punctuation.section.block.end.html
+ pop: 2
+ - 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
diff --git a/tests/syntax_test_control_flow.component.html b/tests/syntax_test_control_flow.component.html
new file mode 100644
index 0000000..6aec2da
--- /dev/null
+++ b/tests/syntax_test_control_flow.component.html
@@ -0,0 +1,136 @@
+
+
+@if (loggedIn) {
+
+
+
+
+ The user is logged in
+} @else {
+
+
+
+
+
+
+
+ The user is not logged in
+}
+
+
+@if (a > b) {
+ {{ a }} is greater than {{ b }}
+
+
+
+
+}
+
+@if (a > b) {
+ {{ a }} is greater than {{ b }}
+} @else if (b > a) {
+ {{ a }} is less than {{ b }}
+} @else {
+ {{ a }} is equal to {{ b }}
+}
+
+@switch (accessLevel) {
+ @case ('admin') {
+
No Items
+} + +@for (item of items; track item.name) { +Placeholder
+} @loading (minimum?An loading error occured
+}