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:
Jade Lovelace 2022-02-01 23:13:01 -08:00 committed by GitHub
parent c39cd92a14
commit c2d2557526
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)