Improve highlighting of port declarations in verilog

This commit is contained in:
zegervdv 2020-11-17 18:16:35 +01:00 committed by Stephan Seitz
parent 33ffdce690
commit d59b4810a6

View file

@ -14,6 +14,7 @@
"class" "class"
"endclass" "endclass"
"return" "return"
"default"
] @keyword ] @keyword
[ [
@ -29,6 +30,8 @@
[ [
"if" "if"
"else" "else"
"case"
"endcase"
] @conditional ] @conditional
[ [
@ -45,6 +48,7 @@
(include_compiler_directive) @constant.macro (include_compiler_directive) @constant.macro
(package_import_declaration (package_import_declaration
"import" @include) "import" @include)
(package_import_declaration (package_import_declaration
(package_import_item (package_import_item
(package_identifier (package_identifier
@ -57,6 +61,10 @@
(package_identifier (package_identifier
(simple_identifier) @constant)) (simple_identifier) @constant))
(module_ansi_header
(parameter_port_list
"#" @constructor))
[ [
"=" "="
"-" "-"
@ -97,8 +105,6 @@
(edge_identifier) @attribute (edge_identifier) @attribute
";" @punctuation.delimiter
(port_direction) @label (port_direction) @label
(port_identifier (port_identifier
(simple_identifier) @variable) (simple_identifier) @variable)
@ -120,6 +126,16 @@
(method_call_body (method_call_body
(method_identifier) @field) (method_identifier) @field)
(interface_identifier
(simple_identifier) @type)
(modport_identifier
(modport_identifier
(simple_identifier) @field))
(net_port_type1
(simple_identifier) @type)
(double_quoted_string) @string (double_quoted_string) @string
[ [
@ -128,12 +144,18 @@
(timescale_compiler_directive) (timescale_compiler_directive)
] @constant.macro ] @constant.macro
; begin/end label
(seq_block (seq_block
(simple_identifier) @comment) (simple_identifier) @comment)
[ [
"::" ";"
"::"
","
"."
] @punctuation.delimiter ] @punctuation.delimiter
(default_nettype_compiler_directive (default_nettype_compiler_directive
(default_nettype_value) @string) (default_nettype_value) @string)
@ -189,12 +211,17 @@
(system_tf_call (system_tf_call
(system_tf_identifier) @function.builtin))) (system_tf_identifier) @function.builtin)))
(task_identifier
(task_identifier
(simple_identifier) @method))
(assignment_pattern_expression (assignment_pattern_expression
(assignment_pattern (assignment_pattern
(parameter_identifier) @field)) (parameter_identifier) @field))
(type_declaration (type_declaration
(data_type) @label) (data_type ["packed"] @label))
(struct_union) @type (struct_union) @type
(type_declaration (type_declaration
@ -223,3 +250,12 @@
(simple_identifier) @type) (simple_identifier) @type)
(generate_block_identifier) @comment (generate_block_identifier) @comment
[
"["
"]"
"("
")"
] @punctuation.bracket
(ERROR) @error