mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-03 12:06:55 -04:00
Add locals for verilog
This commit is contained in:
parent
6cc1c28f68
commit
6731bcbf7b
2 changed files with 91 additions and 13 deletions
|
|
@ -19,8 +19,20 @@
|
|||
"interface"
|
||||
"endinterface"
|
||||
"modport"
|
||||
"package"
|
||||
"endpackage"
|
||||
"fork"
|
||||
"join"
|
||||
"join_none"
|
||||
"join_any"
|
||||
"assert"
|
||||
] @keyword
|
||||
|
||||
[
|
||||
"begin"
|
||||
"end"
|
||||
] @label
|
||||
|
||||
[
|
||||
(always_keyword)
|
||||
"generate"
|
||||
|
|
@ -28,6 +40,7 @@
|
|||
"foreach"
|
||||
"repeat"
|
||||
"forever"
|
||||
"initial"
|
||||
"while"
|
||||
] @repeat
|
||||
|
||||
|
|
@ -38,15 +51,6 @@
|
|||
"endcase"
|
||||
] @conditional
|
||||
|
||||
[
|
||||
"begin"
|
||||
"end"
|
||||
"fork"
|
||||
"join"
|
||||
"join_none"
|
||||
"join_any"
|
||||
] @label
|
||||
|
||||
(comment) @comment
|
||||
|
||||
(include_compiler_directive) @constant.macro
|
||||
|
|
@ -65,9 +69,12 @@
|
|||
(package_identifier
|
||||
(simple_identifier) @constant))
|
||||
|
||||
(module_ansi_header
|
||||
(parameter_port_list
|
||||
"#" @constructor))
|
||||
(package_declaration
|
||||
(package_identifier
|
||||
(simple_identifier) @constant))
|
||||
|
||||
(parameter_port_list
|
||||
"#" @constructor)
|
||||
|
||||
[
|
||||
"="
|
||||
|
|
@ -140,7 +147,10 @@
|
|||
(net_port_type1
|
||||
(simple_identifier) @type)
|
||||
|
||||
(double_quoted_string) @string
|
||||
[
|
||||
(double_quoted_string)
|
||||
(string_literal)
|
||||
] @string
|
||||
|
||||
[
|
||||
(include_compiler_directive)
|
||||
|
|
@ -228,6 +238,14 @@
|
|||
|
||||
(struct_union) @type
|
||||
|
||||
[
|
||||
"enum"
|
||||
] @type
|
||||
|
||||
(enum_name_declaration
|
||||
(enum_identifier
|
||||
(simple_identifier) @constant))
|
||||
|
||||
(type_declaration
|
||||
(simple_identifier) @type)
|
||||
|
||||
|
|
|
|||
60
queries/verilog/locals.scm
Normal file
60
queries/verilog/locals.scm
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
[
|
||||
(loop_generate_construct)
|
||||
(loop_statement)
|
||||
(conditional_statement)
|
||||
(case_item)
|
||||
(function_declaration)
|
||||
(always_construct)
|
||||
(module_declaration)
|
||||
] @scope
|
||||
|
||||
(data_declaration
|
||||
(list_of_variable_decl_assignments
|
||||
(variable_decl_assignment
|
||||
(simple_identifier) @definition.var)))
|
||||
|
||||
(genvar_initialization
|
||||
(genvar_identifier
|
||||
(simple_identifier) @definition.var))
|
||||
|
||||
(for_initialization
|
||||
(for_variable_declaration
|
||||
(simple_identifier) @definition.var))
|
||||
|
||||
(net_declaration
|
||||
(list_of_net_decl_assignments
|
||||
(net_decl_assignment
|
||||
(simple_identifier) @definition.var)))
|
||||
|
||||
(ansi_port_declaration
|
||||
(port_identifier
|
||||
(simple_identifier) @definition.var))
|
||||
|
||||
(parameter_declaration
|
||||
(list_of_param_assignments
|
||||
(param_assignment
|
||||
(parameter_identifier
|
||||
(simple_identifier) @definition.parameter))))
|
||||
|
||||
(local_parameter_declaration
|
||||
(list_of_param_assignments
|
||||
(param_assignment
|
||||
(parameter_identifier
|
||||
(simple_identifier) @definition.parameter))))
|
||||
|
||||
(function_declaration
|
||||
(function_identifier
|
||||
(simple_identifier) @definition.function))
|
||||
|
||||
(function_declaration
|
||||
(function_body_declaration
|
||||
(function_identifier
|
||||
(function_identifier
|
||||
(simple_identifier) @definition.function))))
|
||||
|
||||
(tf_port_item1
|
||||
(port_identifier
|
||||
(simple_identifier) @definition.parameter))
|
||||
|
||||
; too broad, now includes types etc
|
||||
(simple_identifier) @reference
|
||||
Loading…
Add table
Add a link
Reference in a new issue