mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
highlight(zig) highlight all caps is a constant
* in some context, like translate c macro * which is use all CAPS for define constant
This commit is contained in:
parent
7241ddaff4
commit
cbc42914bf
1 changed files with 10 additions and 1 deletions
|
|
@ -23,7 +23,7 @@ parameter: (IDENTIFIER) @parameter
|
|||
field_access: (IDENTIFIER)
|
||||
parameter: (IDENTIFIER)
|
||||
] @type
|
||||
(#match? @type "^[A-Z]")
|
||||
(#match? @type "^[A-Z]([a-z0-9]+[A-Za-z0-9]*)*$")
|
||||
)
|
||||
;; assume camelCase is a function
|
||||
(
|
||||
|
|
@ -35,6 +35,15 @@ parameter: (IDENTIFIER) @parameter
|
|||
(#match? @function "^[a-z]+([A-Z][a-z0-9]*)+$")
|
||||
)
|
||||
|
||||
;; assume all CAPS_1 is a constant
|
||||
(
|
||||
[
|
||||
variable_type_function: (IDENTIFIER)
|
||||
field_access: (IDENTIFIER)
|
||||
] @constant
|
||||
(#match? @constant "^[A-Z][A-Z_0-9]+$")
|
||||
)
|
||||
|
||||
[
|
||||
function_call: (IDENTIFIER)
|
||||
function: (IDENTIFIER)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue