Skip to content

Commit

Permalink
Update tree-sitter-zig (#7803)
Browse files Browse the repository at this point in the history
  • Loading branch information
voroskoi authored Aug 2, 2023
1 parent 325692a commit bc73740
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion languages.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ args = { console = "internalConsole", attachCommands = [ "platform select remote

[[grammar]]
name = "zig"
source = { git = "https://github.com/maxxnino/tree-sitter-zig", rev = "8d3224c3bd0890fe08358886ebf54fca2ed448a6" }
source = { git = "https://github.com/maxxnino/tree-sitter-zig", rev = "0d08703e4c3f426ec61695d7617415fff97029bd" }

[[language]]
name = "prolog"
Expand Down
7 changes: 5 additions & 2 deletions runtime/queries/zig/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -122,8 +122,11 @@ field_constant: (IDENTIFIER) @constant
] @keyword.operator

[
"struct"
"enum"
] @type.enum

[
"struct"
"union"
"packed"
"opaque"
Expand Down
6 changes: 3 additions & 3 deletions runtime/queries/zig/textobjects.scm
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
(TopLevelDecl (FnProto)
(Decl (FnProto)
(_) @function.inside) @function.around

(TestDecl (_) @test.inside) @test.around

; 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
Expand Down

0 comments on commit bc73740

Please sign in to comment.