add werk language and highlights (#13136)

This commit is contained in:
Freddie Gilbraith 2025-03-20 13:04:52 +00:00 committed by GitHub
parent ccf9564123
commit d6cacb2731
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 73 additions and 0 deletions

View file

@ -247,6 +247,7 @@
| wast | ✓ | | | |
| wat | ✓ | | | `wat_server` |
| webc | ✓ | | | |
| werk | ✓ | | | |
| wgsl | ✓ | | | `wgsl-analyzer` |
| wit | ✓ | | ✓ | |
| wren | ✓ | ✓ | ✓ | |

View file

@ -4244,3 +4244,13 @@ formatter = {command = "tlafmt", args = ["--stdin"]}
name = "tlaplus"
source = { git = "https://github.com/tlaplus-community/tree-sitter-tlaplus", rev = "4ba91b07b97741a67f61221d0d50e6d962e4987e"}
[[language]]
name = "werk"
scope = "source.werk"
file-types = [ "werk", { glob = "Werkfile" } ]
comment-token = "#"
indent = { tab-width = 2, unit = " " }
[[grammar]]
name = "werk"
source = { git = "https://github.com/little-bonsai/tree-sitter-werk", rev = "92b0f7fe98465c4c435794a58e961306193d1c1e" }

View file

@ -0,0 +1,62 @@
(buildBlock . ("build") @keyword.function)
(taskBlock . ("task") @keyword.function )
(run . ("run") @keyword.function )
(taskBlock name: (identifier) @function )
(comment) @comment
(string) @string
(number) @constant.numeric
(identifier) @identifier
(include) @keyword.control.import
(let) @keyword.storage
(default) @keyword.storage
(config) @keyword.storage
(interpolation ["{" "}" "<" ">" ] @punctuation.special)
["{" "}" "<" ">" "(" ")" "[" "]"] @punctuation.bracket
["=>" "|"] @punctuation
; Statements
(build "build") @function
(config "config") @function
(copy "copy") @function
(default "default") @function
(delete "delete") @function
(depfile "depfile") @function
(envRemove "env-remove") @function
(from "from") @function
(info "info") @function
(let "let") @function
(setEnv "env") @function
(shell "shell") @function
(write "write") @function
; Expressions
(error "error" @function.builtin)
(getEnv "env" @function.builtin)
(glob "glob" @function.builtin)
(include "include" @function.builtin)
(info "info" @function.builtin)
(read "read" @function.builtin)
(warn "warn" @function.builtin)
(which "which" @function.builtin)
; Operations
(op (string) @operator)
("dedup" @operator)
("first" @operator)
("flatten" @operator)
("last" @operator)
("len" @operator)
("lines" @operator)
("tail" @operator)
(assertEq "assert-eq" @operator)
(discard "discard" @operator)
(filter "filter" @operator)
(filterMatch "filter-match" @operator)
(join "join" @operator)
(map "map" @operator)
(match "match" @operator)
(split "split" @operator)