From 2dd36fa585f703c76bb2b5ca0aab673edb773741 Mon Sep 17 00:00:00 2001 From: maxxnino <34153891+maxxnino@users.noreply.github.com> Date: Fri, 13 Aug 2021 13:36:01 +0900 Subject: highlights(zig): label, switch item, operator, punctuation, field property (#1685) Co-authored-by: maxxnino --- queries/zig/highlights.scm | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) (limited to 'queries') diff --git a/queries/zig/highlights.scm b/queries/zig/highlights.scm index 06daf0f99..048d6e07b 100644 --- a/queries/zig/highlights.scm +++ b/queries/zig/highlights.scm @@ -97,7 +97,6 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) ("!")? @exception ) - (ParamDecl (ParamType (SuffixExpr (IDENTIFIER) @parameter)) ) @@ -111,12 +110,19 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) ] ) +(SwitchItem + (SuffixExpr + "." + . + (IDENTIFIER) @constant + ) +) + (BUILTINIDENTIFIER) @function.builtin ((BUILTINIDENTIFIER) @include (#any-of? @include "@import" "@cImport")) - (INTEGER) @number (FLOAT) @float @@ -136,10 +142,8 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) (BuildinTypeExpr) ] @type.builtin -[ - (BreakLabel) - (BlockLabel) -] @label +(BreakLabel (IDENTIFIER) @label) +(BlockLabel (IDENTIFIER) @label) [ "true" @@ -166,7 +170,7 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) [ "or" "and" - (BitwiseOp "orelse") + "orelse" ] @keyword.operator [ @@ -220,7 +224,6 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) ; PrecProc [ - (BitwiseOp "orelse") "inline" "noinline" "asm" @@ -240,6 +243,13 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) (AdditionOp) (MultiplyOp) (PrefixOp) + "*" + "**" + "->" + "=>" + ".?" + ".*" + "=" ] @operator [ @@ -249,6 +259,11 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) ":" ] @punctuation.delimiter +[ + ".." + "..." +] @punctuation.special + [ "[" "]" @@ -256,4 +271,7 @@ constructor: (SuffixExpr (IDENTIFIER) @constructor) ")" "{" "}" + (Payload "|") + (PtrPayload "|") + (PtrIndexPayload "|") ] @punctuation.bracket -- cgit v1.2.3-70-g09d2