mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-14 01:10:02 -04:00
verilog highlight: add some keywords, tidy keywords (#2432)
* Add a bunch of the OO keywords and some of the more unusual block delimiter types * Highlight macromodule like module is. * Highlight new as seen in constructor declarations like `class blah; function new(...); ... endfunction endclass` * Make endfunction a @keyword.function. This matches how lua does it. * Make tasks @keyword.function: tasks in SystemVerilog are more or less just impure functions * Highlight casex/casez like case is currently highlighted (previously these were not highlighted at all) * Highlight unique, unique0, priority for constructs like `unique case (...) ... endcase` and `priority if (...) ...`
This commit is contained in:
parent
c39cd92a14
commit
c2d2557526
1 changed files with 39 additions and 13 deletions
|
|
@ -1,32 +1,55 @@
|
||||||
; Keywords
|
; Keywords
|
||||||
|
|
||||||
[
|
[
|
||||||
"module"
|
; block delimeters
|
||||||
|
(module_keyword)
|
||||||
"endmodule"
|
"endmodule"
|
||||||
"endfunction"
|
"program"
|
||||||
"task"
|
"endprogram"
|
||||||
"endtask"
|
|
||||||
"parameter"
|
|
||||||
"localparam"
|
|
||||||
"assign"
|
|
||||||
"typedef"
|
|
||||||
"class"
|
"class"
|
||||||
"endclass"
|
"endclass"
|
||||||
"default"
|
|
||||||
"break"
|
|
||||||
"interface"
|
"interface"
|
||||||
"endinterface"
|
"endinterface"
|
||||||
"modport"
|
|
||||||
"package"
|
"package"
|
||||||
"endpackage"
|
"endpackage"
|
||||||
|
"checker"
|
||||||
|
"endchecker"
|
||||||
|
"config"
|
||||||
|
"endconfig"
|
||||||
|
|
||||||
|
"pure"
|
||||||
|
"virtual"
|
||||||
|
"extends"
|
||||||
|
"implements"
|
||||||
|
"super"
|
||||||
|
(class_item_qualifier)
|
||||||
|
|
||||||
|
"parameter"
|
||||||
|
"localparam"
|
||||||
|
"defparam"
|
||||||
|
"assign"
|
||||||
|
"typedef"
|
||||||
|
"modport"
|
||||||
"fork"
|
"fork"
|
||||||
"join"
|
"join"
|
||||||
"join_none"
|
"join_none"
|
||||||
"join_any"
|
"join_any"
|
||||||
|
"default"
|
||||||
|
"break"
|
||||||
"assert"
|
"assert"
|
||||||
|
(unique_priority)
|
||||||
|
"tagged"
|
||||||
|
"extern"
|
||||||
] @keyword
|
] @keyword
|
||||||
|
|
||||||
"function" @keyword.function
|
[
|
||||||
|
"function"
|
||||||
|
"endfunction"
|
||||||
|
|
||||||
|
"task"
|
||||||
|
"endtask"
|
||||||
|
] @keyword.function
|
||||||
|
|
||||||
"return" @keyword.return
|
"return" @keyword.return
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -48,7 +71,7 @@
|
||||||
[
|
[
|
||||||
"if"
|
"if"
|
||||||
"else"
|
"else"
|
||||||
"case"
|
(case_keyword)
|
||||||
"endcase"
|
"endcase"
|
||||||
] @conditional
|
] @conditional
|
||||||
|
|
||||||
|
|
@ -181,6 +204,9 @@
|
||||||
(module_header
|
(module_header
|
||||||
(simple_identifier) @constructor))
|
(simple_identifier) @constructor))
|
||||||
|
|
||||||
|
(class_constructor_declaration
|
||||||
|
"new" @constructor)
|
||||||
|
|
||||||
(parameter_identifier
|
(parameter_identifier
|
||||||
(simple_identifier) @parameter)
|
(simple_identifier) @parameter)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue