From 9f36468b15c740d17a5755801986e01e7fb841ce Mon Sep 17 00:00:00 2001 From: gbprod Date: Mon, 10 Oct 2022 23:27:14 +0200 Subject: Change twig tree-sitter grammar (#4176) --- runtime/queries/twig/highlights.scm | 70 ++++++++++++++++++++++++++++++------- 1 file changed, 57 insertions(+), 13 deletions(-) (limited to 'runtime') 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) + -- cgit v1.2.3-70-g09d2