Skip to content

Commit

Permalink
feat: Add Twig support
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Nov 14, 2023
1 parent 26885d0 commit bb9fc1a
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -520,3 +520,9 @@
update = none
ignore = dirty
branch = main
[submodule "repos/twig"]
path = repos/twig
url = https://github.com/gbprod/tree-sitter-twig
update = none
ignore = dirty
branch = main
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Changelog

## Unreleased
- Add `Twig` support

## 0.12.77 - 2023-11-05

Expand Down
59 changes: 59 additions & 0 deletions queries/twig/highlights.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
(comment) @comment

(filter_identifier) @function.call
(function_identifier) @function.call
(test) @function.builtin
(variable) @variable
(string) @string
(interpolated_string) @string
(operator) @operator
(number) @number
(boolean) @constant.builtin
(null) @constant.builtin
(keyword) @keyword
(attribute) @attribute
(tag) @tag
(conditional) @conditional
(repeat) @repeat
(method) @method
(parameter) @parameter

[
"{{"
"}}"
"{{-"
"-}}"
"{{~"
"~}}"
"{%"
"%}"
"{%-"
"-%}"
"{%~"
"~%}"
] @tag.delimiter

[
","
"."
"?"
":"
"="
] @punctuation.delimiter

(interpolated_string [
"#{"
"}"
] @punctuation.delimiter)

[
"("
")"
"["
"]"
"{"
] @punctuation.bracket

(hash [
"}"
] @punctuation.bracket)
1 change: 1 addition & 0 deletions repos/twig
Submodule twig added at eaf80e
1 change: 1 addition & 0 deletions tree-sitter-langs.el
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ See `tree-sitter-langs-repos'."
(conf-toml-mode . toml)
(tcl-mode . tcl)
(tuareg-mode . ocaml)
(twig-mode . twig)
(typescript-mode . typescript)
(typst-mode . typst)
(verilog-mode . verilog)
Expand Down

0 comments on commit bb9fc1a

Please sign in to comment.