mirror of
https://github.com/nvim-treesitter/nvim-treesitter
synced 2024-09-16 14:34:05 +02:00
feat: add earthfile parser (#6395)
--------- Co-authored-by: ObserverOfTime <chronobserver@disroot.org>
This commit is contained in:
parent
5c4892b055
commit
6ae470fd8f
4 changed files with 149 additions and 0 deletions
|
@ -131,6 +131,9 @@
|
|||
"dtd": {
|
||||
"revision": "2282ad5cb8e815523e70d5c82404620bd9a1494c"
|
||||
},
|
||||
"earthfile": {
|
||||
"revision": "2a6ab191f5f962562e495a818aa4e7f45f8a556a"
|
||||
},
|
||||
"ebnf": {
|
||||
"revision": "8e635b0b723c620774dfb8abf382a7f531894b40"
|
||||
},
|
||||
|
|
|
@ -443,6 +443,14 @@ list.dtd = {
|
|||
maintainers = { "@ObserverOfTime" },
|
||||
}
|
||||
|
||||
list.earthfile = {
|
||||
install_info = {
|
||||
url = "https://github.com/glehmann/tree-sitter-earthfile",
|
||||
files = { "src/parser.c", "src/scanner.c" },
|
||||
},
|
||||
maintainers = { "@glehmann" },
|
||||
}
|
||||
|
||||
list.ebnf = {
|
||||
install_info = {
|
||||
url = "https://github.com/RubixDev/ebnf",
|
||||
|
|
129
queries/earthfile/highlights.scm
Normal file
129
queries/earthfile/highlights.scm
Normal file
|
@ -0,0 +1,129 @@
|
|||
(string_array
|
||||
"," @punctuation.delimiter)
|
||||
|
||||
(string_array
|
||||
[
|
||||
"["
|
||||
"]"
|
||||
] @punctuation.bracket)
|
||||
|
||||
[
|
||||
"ARG"
|
||||
"AS LOCAL"
|
||||
"BUILD"
|
||||
"CACHE"
|
||||
"CMD"
|
||||
"COPY"
|
||||
"DO"
|
||||
"ENTRYPOINT"
|
||||
"ENV"
|
||||
"EXPOSE"
|
||||
"FROM DOCKERFILE"
|
||||
"FROM"
|
||||
"FUNCTION"
|
||||
"GIT CLONE"
|
||||
"HOST"
|
||||
"IMPORT"
|
||||
"LABEL"
|
||||
"LET"
|
||||
"PROJECT"
|
||||
"RUN"
|
||||
"SAVE ARTIFACT"
|
||||
"SAVE IMAGE"
|
||||
"SET"
|
||||
"USER"
|
||||
"VERSION"
|
||||
"VOLUME"
|
||||
"WORKDIR"
|
||||
] @keyword
|
||||
|
||||
(for_command
|
||||
[
|
||||
"FOR"
|
||||
"IN"
|
||||
"END"
|
||||
] @keyword.repeat)
|
||||
|
||||
(if_command
|
||||
[
|
||||
"IF"
|
||||
"END"
|
||||
] @keyword.conditional)
|
||||
|
||||
(elif_block
|
||||
"ELSE IF" @keyword.conditional)
|
||||
|
||||
(else_block
|
||||
"ELSE" @keyword.conditional)
|
||||
|
||||
(import_command
|
||||
[
|
||||
"IMPORT"
|
||||
"AS"
|
||||
] @keyword.import)
|
||||
|
||||
(try_command
|
||||
[
|
||||
"TRY"
|
||||
"FINALLY"
|
||||
"END"
|
||||
] @keyword.exception)
|
||||
|
||||
(wait_command
|
||||
[
|
||||
"WAIT"
|
||||
"END"
|
||||
] @keyword)
|
||||
|
||||
(with_docker_command
|
||||
[
|
||||
"WITH DOCKER"
|
||||
"END"
|
||||
] @keyword)
|
||||
|
||||
[
|
||||
(comment)
|
||||
(line_continuation_comment)
|
||||
] @comment @spell
|
||||
|
||||
[
|
||||
(target_ref)
|
||||
(target_artifact)
|
||||
(function_ref)
|
||||
] @function
|
||||
|
||||
(target
|
||||
(identifier) @function)
|
||||
|
||||
[
|
||||
(double_quoted_string)
|
||||
(single_quoted_string)
|
||||
] @string
|
||||
|
||||
(unquoted_string) @string.special
|
||||
|
||||
(escape_sequence) @string.escape
|
||||
|
||||
(variable) @variable
|
||||
|
||||
(expansion
|
||||
[
|
||||
"$"
|
||||
"{"
|
||||
"}"
|
||||
"("
|
||||
")"
|
||||
] @punctuation.special)
|
||||
|
||||
(build_arg
|
||||
[
|
||||
"--"
|
||||
(variable)
|
||||
] @variable.parameter)
|
||||
|
||||
(options
|
||||
(_) @property)
|
||||
|
||||
"=" @operator
|
||||
|
||||
(line_continuation) @operator
|
9
queries/earthfile/injections.scm
Normal file
9
queries/earthfile/injections.scm
Normal file
|
@ -0,0 +1,9 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((line_continuation_comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
((shell_fragment) @injection.content
|
||||
(#set! injection.language "bash")
|
||||
(#set! injection.include-children))
|
Loading…
Reference in a new issue