Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvements to Meson syntax. #4572

Merged
merged 4 commits into from
Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ indent = { tab-width = 2, unit = " " }

[[grammar]]
name = "meson"
source = { git = "https://github.com/bearcove/tree-sitter-meson", rev = "feea83be9225842490066522ced2d13eb9cce0bd" }
source = { git = "https://github.com/staysail/tree-sitter-meson", rev = "32a83e8f200c347232fa795636cfe60dde22957a" }

[[language]]
name = "sshclientconfig"
Expand Down
92 changes: 46 additions & 46 deletions runtime/queries/meson/highlights.scm
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
(string_literal) @string
(comment) @comment

(boolean_literal) @constant.builtin.boolean
(integer_literal) @constant.numeric.integer

(comment) @comment.line
(function_id) @function
(keyword_arg_key) @variable.other.member
(id_expression) @variable
; these are listed first, because they override keyword queries
(function_expression (identifier) @function)

[
"if"
"elif"
"else"
"endif"
] @keyword.control.conditional
(assignment_operator)
(additive_operator)
(multiplicative_operator)
(equality_operator)
">="
"<="
"<"
">"
"+"
"-"
] @operator

[
"foreach"
"endforeach"
] @keyword.control.repeat
(and)
(or)
(not)
(in)
] @keyword.operator

[
"break"
"continue"
] @keyword.control
"(" ")" "[" "]" "{" "}"
] @punctuation.bracket

[
"not"
"in"
"and"
"or"
] @keyword.operator
(if)
(elif)
(else)
(endif)
] @keyword.control.conditional

[
"!"
"+"
"-"
"*"
"/"
"%"
"=="
"!="
">"
"<"
">="
"<="
] @operator
(foreach)
(endforeach)
(break)
(continue)
] @keyword.control.repeat

(boolean_literal) @constant.builtin.boolean
(int_literal) @constant.numeric.integer

(keyword_argument keyword: (identifier) @variable.parameter)
(escape_sequence) @string.special
gdamore marked this conversation as resolved.
Show resolved Hide resolved
(bad_escape) @warning

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

[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
(string_literal)
(fstring_literal)
] @string

(identifier) @variable.other
gdamore marked this conversation as resolved.
Show resolved Hide resolved
7 changes: 4 additions & 3 deletions runtime/queries/meson/indents.scm
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
; Indentation queries for helix
[
(method_expression)
(function_expression)
(array_literal)
(dictionary_literal)
(selection_statement)
(iteration_statement)
] @indent

; question - what about else, elif
[
")"
"]"
"}"
"endif"
"endforeach"
(endif)
(endforeach)
] @outdent