|
|
@ -1,20 +1,11 @@
|
|
|
|
[
|
|
|
|
[
|
|
|
|
(container_doc_comment)
|
|
|
|
(container_doc_comment)
|
|
|
|
(doc_comment)
|
|
|
|
(doc_comment)
|
|
|
|
(line_comment)
|
|
|
|
] @comment.documentation
|
|
|
|
] @comment
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
variable: (IDENTIFIER)
|
|
|
|
(line_comment)
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
] @comment.line
|
|
|
|
] @variable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
parameter: (IDENTIFIER) @variable.parameter
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
field_member: (IDENTIFIER)
|
|
|
|
|
|
|
|
field_access: (IDENTIFIER)
|
|
|
|
|
|
|
|
] @variable.other.member
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; assume TitleCase is a type
|
|
|
|
;; assume TitleCase is a type
|
|
|
|
(
|
|
|
|
(
|
|
|
@ -25,6 +16,7 @@ parameter: (IDENTIFIER) @variable.parameter
|
|
|
|
] @type
|
|
|
|
] @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
|
|
|
|
;; assume camelCase is a function
|
|
|
|
(
|
|
|
|
(
|
|
|
|
[
|
|
|
|
[
|
|
|
@ -44,29 +36,33 @@ parameter: (IDENTIFIER) @variable.parameter
|
|
|
|
(#match? @constant "^[A-Z][A-Z_0-9]+$")
|
|
|
|
(#match? @constant "^[A-Z][A-Z_0-9]+$")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
;; _
|
|
|
|
function_call: (IDENTIFIER)
|
|
|
|
|
|
|
|
function: (IDENTIFIER)
|
|
|
|
|
|
|
|
] @function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exception: "!" @function.macro
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
(
|
|
|
|
(IDENTIFIER) @variable.builtin
|
|
|
|
(IDENTIFIER) @variable.builtin
|
|
|
|
(#eq? @variable.builtin "_")
|
|
|
|
(#eq? @variable.builtin "_")
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;; C Pointers [*c]T
|
|
|
|
(PtrTypeStart "c" @variable.builtin)
|
|
|
|
(PtrTypeStart "c" @variable.builtin)
|
|
|
|
|
|
|
|
|
|
|
|
(
|
|
|
|
[
|
|
|
|
(ContainerDeclType
|
|
|
|
variable: (IDENTIFIER)
|
|
|
|
[
|
|
|
|
variable_type_function: (IDENTIFIER)
|
|
|
|
(ErrorUnionExpr)
|
|
|
|
] @variable
|
|
|
|
"enum"
|
|
|
|
|
|
|
|
]
|
|
|
|
parameter: (IDENTIFIER) @variable.parameter
|
|
|
|
)
|
|
|
|
|
|
|
|
(ContainerField (IDENTIFIER) @constant)
|
|
|
|
[
|
|
|
|
)
|
|
|
|
field_member: (IDENTIFIER)
|
|
|
|
|
|
|
|
field_access: (IDENTIFIER)
|
|
|
|
|
|
|
|
] @variable.other.member
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
function_call: (IDENTIFIER)
|
|
|
|
|
|
|
|
function: (IDENTIFIER)
|
|
|
|
|
|
|
|
] @function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exception: "!" @keyword.control.exception
|
|
|
|
|
|
|
|
|
|
|
|
field_constant: (IDENTIFIER) @constant
|
|
|
|
field_constant: (IDENTIFIER) @constant
|
|
|
|
|
|
|
|
|
|
|
@ -89,8 +85,6 @@ field_constant: (IDENTIFIER) @constant
|
|
|
|
(FormatSequence) @string.special
|
|
|
|
(FormatSequence) @string.special
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"allowzero"
|
|
|
|
|
|
|
|
"volatile"
|
|
|
|
|
|
|
|
"anytype"
|
|
|
|
"anytype"
|
|
|
|
"anyframe"
|
|
|
|
"anyframe"
|
|
|
|
(BuildinTypeExpr)
|
|
|
|
(BuildinTypeExpr)
|
|
|
@ -125,44 +119,53 @@ field_constant: (IDENTIFIER) @constant
|
|
|
|
"or"
|
|
|
|
"or"
|
|
|
|
"and"
|
|
|
|
"and"
|
|
|
|
"orelse"
|
|
|
|
"orelse"
|
|
|
|
] @operator
|
|
|
|
] @keyword.operator
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"struct"
|
|
|
|
"struct"
|
|
|
|
"enum"
|
|
|
|
"enum"
|
|
|
|
"union"
|
|
|
|
"union"
|
|
|
|
"error"
|
|
|
|
|
|
|
|
"packed"
|
|
|
|
"packed"
|
|
|
|
"opaque"
|
|
|
|
"opaque"
|
|
|
|
] @keyword
|
|
|
|
"export"
|
|
|
|
|
|
|
|
"extern"
|
|
|
|
|
|
|
|
"linksection"
|
|
|
|
|
|
|
|
] @keyword.storage.type
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"const"
|
|
|
|
|
|
|
|
"var"
|
|
|
|
|
|
|
|
"threadlocal"
|
|
|
|
|
|
|
|
"allowzero"
|
|
|
|
|
|
|
|
"volatile"
|
|
|
|
|
|
|
|
"align"
|
|
|
|
|
|
|
|
] @keyword.storage.modifier
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"try"
|
|
|
|
"try"
|
|
|
|
"error"
|
|
|
|
"error"
|
|
|
|
"catch"
|
|
|
|
"catch"
|
|
|
|
] @function.macro
|
|
|
|
] @keyword.control.exception
|
|
|
|
|
|
|
|
|
|
|
|
; VarDecl
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"threadlocal"
|
|
|
|
|
|
|
|
"fn"
|
|
|
|
"fn"
|
|
|
|
] @keyword.function
|
|
|
|
] @keyword.function
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"const"
|
|
|
|
|
|
|
|
"var"
|
|
|
|
|
|
|
|
"test"
|
|
|
|
"test"
|
|
|
|
|
|
|
|
] @keyword
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
"pub"
|
|
|
|
"pub"
|
|
|
|
"usingnamespace"
|
|
|
|
"usingnamespace"
|
|
|
|
] @keyword
|
|
|
|
] @keyword.control.import
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"return"
|
|
|
|
"return"
|
|
|
|
"break"
|
|
|
|
"break"
|
|
|
|
"continue"
|
|
|
|
"continue"
|
|
|
|
] @keyword.control
|
|
|
|
] @keyword.control.return
|
|
|
|
|
|
|
|
|
|
|
|
; Macro
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"defer"
|
|
|
|
"defer"
|
|
|
|
"errdefer"
|
|
|
|
"errdefer"
|
|
|
@ -171,11 +174,8 @@ field_constant: (IDENTIFIER) @constant
|
|
|
|
"await"
|
|
|
|
"await"
|
|
|
|
"suspend"
|
|
|
|
"suspend"
|
|
|
|
"resume"
|
|
|
|
"resume"
|
|
|
|
"export"
|
|
|
|
|
|
|
|
"extern"
|
|
|
|
|
|
|
|
] @function.macro
|
|
|
|
] @function.macro
|
|
|
|
|
|
|
|
|
|
|
|
; PrecProc
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
"comptime"
|
|
|
|
"comptime"
|
|
|
|
"inline"
|
|
|
|
"inline"
|
|
|
@ -185,11 +185,6 @@ field_constant: (IDENTIFIER) @constant
|
|
|
|
"noalias"
|
|
|
|
"noalias"
|
|
|
|
] @keyword.directive
|
|
|
|
] @keyword.directive
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
"linksection"
|
|
|
|
|
|
|
|
"align"
|
|
|
|
|
|
|
|
] @function.builtin
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[
|
|
|
|
[
|
|
|
|
(CompareOp)
|
|
|
|
(CompareOp)
|
|
|
|
(BitwiseOp)
|
|
|
|
(BitwiseOp)
|
|
|
@ -230,5 +225,4 @@ field_constant: (IDENTIFIER) @constant
|
|
|
|
(PtrIndexPayload "|")
|
|
|
|
(PtrIndexPayload "|")
|
|
|
|
] @punctuation.bracket
|
|
|
|
] @punctuation.bracket
|
|
|
|
|
|
|
|
|
|
|
|
; Error
|
|
|
|
(ERROR) @keyword.control.exception
|
|
|
|
(ERROR) @keyword
|
|
|
|
|
|
|
|