aboutsummaryrefslogtreecommitdiffstats
path: root/queries/zig
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-03-30 19:53:03 +0200
committerStephan Seitz <stephan.lauf@yahoo.de>2021-03-30 22:27:50 +0200
commit4821bde80a91fa3950b45cbe832d36a5f8c86c7d (patch)
tree2b0fe2a1726b75d25f0ea058d7da26bded24609e /queries/zig
parentFix beancount queries (diff)
downloadnvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar.gz
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar.bz2
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar.lz
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar.xz
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.tar.zst
nvim-treesitter-4821bde80a91fa3950b45cbe832d36a5f8c86c7d.zip
Import highlights.scm from tree-sitter-zig
Diffstat (limited to 'queries/zig')
-rw-r--r--queries/zig/highlights.scm29
1 files changed, 19 insertions, 10 deletions
diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm
index b9d3b25ad..3a044afee 100644
--- a/queries/zig/highlights.scm
+++ b/queries/zig/highlights.scm
@@ -1,6 +1,10 @@
-;; Assume all-caps names are constants
+; Types
-; (identifier) @variable
+; Zig
+
+; Variables
+; --------------
+(identifier) @variable
(parameter (identifier) @variable)
@@ -15,11 +19,12 @@
(function_declaration (identifier) @function)
; Function calls
-(call_expression
- function: (identifier) @function)
+; (call_expression
+; function: (identifier)) @function
(build_in_call_expr
- function: (identifier) @attribute)
+ function: (identifier) @function.builtin
+)
;; other identifiers
(type_identifier) @type
@@ -37,12 +42,18 @@
(undefined_literal) @constant.builtin
(null_literal) @constant.builtin
+(ERROR) @error
+
(string_literal) @string
-(multiline_string_literal) @string
+(multiline_string_literal "\\\\" @string.special)
(escape_sequence) @constant.builtin
+(label_identifier) @label
+
+(call_modifier) @keyword ; async
+(binary_operator) @keyword.operator
[
"align"
@@ -51,7 +62,6 @@
; "anyframe"
; "anytype"
;"asm"
- ; "async"
"await"
"break"
; "callconv"
@@ -67,7 +77,6 @@
"export"
"extern"
"false"
- ; "fn"
"for"
"if"
"inline"
@@ -116,6 +125,7 @@
(assignment_modifier) @attribute
[
+ ".{"
"("
")"
"["
@@ -148,7 +158,7 @@
;"<"
;"<<"
"<<="
- ;"<="
+ ; "<="
"-"
"-="
"-%"
@@ -164,7 +174,6 @@
"+="
;"+%"
"+%="
- "c\""
"?"
;">"
;">>"