From bc737404e8ad462b4101987730f4a76658d132ad Mon Sep 17 00:00:00 2001 From: voroskoi Date: Wed, 2 Aug 2023 21:22:28 +0200 Subject: Update tree-sitter-zig (#7803) --- runtime/queries/zig/highlights.scm | 7 +++++-- runtime/queries/zig/textobjects.scm | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'runtime') diff --git a/runtime/queries/zig/highlights.scm b/runtime/queries/zig/highlights.scm index e2e79518..d6b1f95a 100644 --- a/runtime/queries/zig/highlights.scm +++ b/runtime/queries/zig/highlights.scm @@ -14,7 +14,7 @@ field_access: (IDENTIFIER) parameter: (IDENTIFIER) ] @type - (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)*$") + (#match? @type "^[A-Z]([a-z]+[A-Za-z0-9]*)+$") ) ;; assume camelCase is a function @@ -122,8 +122,11 @@ field_constant: (IDENTIFIER) @constant ] @keyword.operator [ - "struct" "enum" +] @type.enum + +[ + "struct" "union" "packed" "opaque" diff --git a/runtime/queries/zig/textobjects.scm b/runtime/queries/zig/textobjects.scm index 67528943..5c4ebd86 100644 --- a/runtime/queries/zig/textobjects.scm +++ b/runtime/queries/zig/textobjects.scm @@ -1,4 +1,4 @@ -(TopLevelDecl (FnProto) +(Decl (FnProto) (_) @function.inside) @function.around (TestDecl (_) @test.inside) @test.around @@ -6,10 +6,10 @@ ; matches all of: struct, enum, union ; this unfortunately cannot be split up because ; of the way struct "container" types are defined -(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ContainerDecl +(Decl (VarDecl (ErrorUnionExpr (SuffixExpr (ContainerDecl (_) @class.inside))))) @class.around -(TopLevelDecl (VarDecl (ErrorUnionExpr (SuffixExpr (ErrorSetDecl +(Decl (VarDecl (ErrorUnionExpr (SuffixExpr (ErrorSetDecl (_) @class.inside))))) @class.around (ParamDeclList -- cgit v1.2.3-70-g09d2