on master help sign in
Change twig tree-sitter grammar (#4176)
commit9f36468b15c740d17a5755801986e01e7fb841ce authorgbprod <contact@gb-prod.fr> dateMon 10 Oct 2022, 23:27 (4 years ago) parenta079f2c
2 files changed+58−14
languages.toml+1−1 runtime/queries/twig/highlights.scm+57−13
languages.toml+1−1
@@ -537,7 +537,7 @@ indent = { tab-width = 2, unit = " " }
537537
538538[[grammar]]
539539name = "twig"
540−source = { git = "https://github.com/eirabben/tree-sitter-twig", rev = "b7444181fb38e603e25ea8fcdac55f9492e49c27" }
540+source = { git = "https://github.com/gbprod/tree-sitter-twig", rev = "807b293fec3fead64f54c64fdf6fb05516c032b9" }
541541
542542[[language]]
543543name = "latex"
runtime/queries/twig/highlights.scm+57−13
@@ -1,16 +1,60 @@
1−(comment_directive) @comment
1+(comment) @comment
2+
3+(filter_identifier) @function.method
4+(function_identifier) @function.method
5+(test) @function.builtin
6+(variable) @variable
7+(string) @string
8+(interpolated_string) @string
9+(operator) @operator
10+(number) @constant.numeric.integer
11+(boolean) @constant.builtin.boolean
12+(null) @constant.builtin
13+(keyword) @keyword
14+(attribute) @attribute
15+(tag) @tag
16+(conditional) @keyword.control.conditional
17+(repeat) @keyword.control.repeat
18+(method) @function.method
19+(parameter) @variable.parameter
220
321[
4− "{%"
5− "{%-"
6− "{%~"
7− "%}"
8− "-%}"
9− "~%}"
10− "{{"
11− "{{-"
12− "{{~"
13− "}}"
14− "-}}"
15− "~}}"
22+ "{{"
23+ "}}"
24+ "{{-"
25+ "-}}"
26+ "{{~"
27+ "~}}"
28+ "{%"
29+ "%}"
30+ "{%-"
31+ "-%}"
32+ "{%~"
33+ "~%}"
1634] @keyword
35+
36+[
37+ ","
38+ "."
39+ "?"
40+ ":"
41+ "="
42+] @punctuation.delimiter
43+
44+(interpolated_string [
45+ "#{"
46+ "}"
47+] @punctuation.delimiter)
48+
49+[
50+ "("
51+ ")"
52+ "["
53+ "]"
54+ "{"
55+] @punctuation.bracket
56+
57+(hash [
58+ "}"
59+] @punctuation.bracket)
60+