on master help sign in
Change twig tree-sitter grammar (#4176)
9f36468gbprod
languages.toml+1−1
@@ -537,7 +537,7 @@ indent = { tab-width = 2, unit = " " }
537
537
538[[grammar]]
538[[grammar]]
539name = "twig"
539name = "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" }
541
541
542[[language]]
542[[language]]
543name = "latex"
543name = "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
2
20
3[
21[
22+ "{{"
23+ "}}"
24+ "{{-"
25+ "-}}"
26+ "{{~"
27+ "~}}"
28+ "{%"
4− "{%"
29+ "%}"
5− "{%-"
30+ "{%-"
31+ "-%}"
6− "{%~"
32+ "{%~"
7− "%}"
8− "-%}"
9− "~%}"
33+ "~%}"
10− "{{"
11− "{{-"
12− "{{~"
13− "}}"
14− "-}}"
15− "~}}"
16] @keyword
34] @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+