aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorGarrett D'Amore2022-11-16 02:17:03 +0000
committerGitHub2022-11-16 02:17:03 +0000
commitf843967059fc36bf497bde31ce9ed18b1354f1eb (patch)
treebe08a0e1c215b175d2b66fe5855e1cd99c335997 /runtime
parent70ebbd018ad80c9fe0067c99f5fa86d1c529486a (diff)
Improvements to Meson syntax. (#4572)
Co-authored-by: Garrett D'Amore <garrett.damore@weka.io> Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
Diffstat (limited to 'runtime')
-rw-r--r--runtime/queries/meson/highlights.scm92
-rw-r--r--runtime/queries/meson/indents.scm7
2 files changed, 50 insertions, 49 deletions
diff --git a/runtime/queries/meson/highlights.scm b/runtime/queries/meson/highlights.scm
index 01df8f27..c4775540 100644
--- a/runtime/queries/meson/highlights.scm
+++ b/runtime/queries/meson/highlights.scm
@@ -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) @constant.character.escape
+(bad_escape) @warning
[
- ":"
- ","
+"."
+","
+":"
] @punctuation.delimiter
[
- "("
- ")"
- "["
- "]"
- "{"
- "}"
-] @punctuation.bracket
+ (string_literal)
+ (fstring_literal)
+] @string
+
+(identifier) @variable
diff --git a/runtime/queries/meson/indents.scm b/runtime/queries/meson/indents.scm
index a1c7b3fa..2a4c6c62 100644
--- a/runtime/queries/meson/indents.scm
+++ b/runtime/queries/meson/indents.scm
@@ -1,5 +1,5 @@
+; Indentation queries for helix
[
- (method_expression)
(function_expression)
(array_literal)
(dictionary_literal)
@@ -7,10 +7,11 @@
(iteration_statement)
] @indent
+; question - what about else, elif
[
")"
"]"
"}"
- "endif"
- "endforeach"
+ (endif)
+ (endforeach)
] @outdent