aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorgbprod2022-10-10 21:27:14 +0000
committerGitHub2022-10-10 21:27:14 +0000
commit9f36468b15c740d17a5755801986e01e7fb841ce (patch)
treee1034327d850a8dabb52782298933aabbcbdad0f /runtime
parenta079f2c9bd2ec5f9cb9d0b06969a522463edac53 (diff)
Change twig tree-sitter grammar (#4176)
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/twig/highlights.scm70
1 files changed, 57 insertions, 13 deletions
diff --git a/runtime/queries/twig/highlights.scm b/runtime/queries/twig/highlights.scm
index 2c95ab63..1ef8d06b 100644
--- a/runtime/queries/twig/highlights.scm
+++ b/runtime/queries/twig/highlights.scm
@@ -1,16 +1,60 @@
-(comment_directive) @comment
+(comment) @comment
+
+(filter_identifier) @function.method
+(function_identifier) @function.method
+(test) @function.builtin
+(variable) @variable
+(string) @string
+(interpolated_string) @string
+(operator) @operator
+(number) @constant.numeric.integer
+(boolean) @constant.builtin.boolean
+(null) @constant.builtin
+(keyword) @keyword
+(attribute) @attribute
+(tag) @tag
+(conditional) @keyword.control.conditional
+(repeat) @keyword.control.repeat
+(method) @function.method
+(parameter) @variable.parameter
[
- "{%"
- "{%-"
- "{%~"
- "%}"
- "-%}"
- "~%}"
- "{{"
- "{{-"
- "{{~"
- "}}"
- "-}}"
- "~}}"
+ "{{"
+ "}}"
+ "{{-"
+ "-}}"
+ "{{~"
+ "~}}"
+ "{%"
+ "%}"
+ "{%-"
+ "-%}"
+ "{%~"
+ "~%}"
] @keyword
+
+[
+ ","
+ "."
+ "?"
+ ":"
+ "="
+] @punctuation.delimiter
+
+(interpolated_string [
+ "#{"
+ "}"
+] @punctuation.delimiter)
+
+[
+ "("
+ ")"
+ "["
+ "]"
+ "{"
+] @punctuation.bracket
+
+(hash [
+ "}"
+] @punctuation.bracket)
+