@@ -19,6 +19,7 @@ patterns:
1919 - include : ' #enum-struct-union'
2020 - include : ' #sequence'
2121 - include : ' #all-types'
22+ - include : ' #class-instance-parameters'
2223 - include : ' #module-parameters'
2324 - include : ' #module-no-parameters'
2425 - include : ' #port-net-parameter'
@@ -411,6 +412,27 @@ repository:
411412 name : variable.other.module.systemverilog
412413 - include : ' #identifiers'
413414 name : meta.module.parameters.systemverilog
415+ class-instance-parameters :
416+ begin : >-
417+ [ \t\r\n]*\b([a-zA-Z_][a-zA-Z0-9_$]*)[ \t\r\n]*(?=#[^#])
418+ beginCaptures :
419+ ' 1 ' :
420+ name : storage.type.user-defined.systemverilog
421+ ' 2 ' :
422+ name : entity.name.type.class.systemverilog
423+ end : (?:[ \t\r\n]*(;))?
424+ endCaptures :
425+ ' 1 ' :
426+ name : punctuation.module.instantiation.end.systemverilog
427+ patterns :
428+ - match : ' \b([a-zA-Z_][a-zA-Z0-9_$]*)\b(?=[ \t\r\n]*\()'
429+ name : variable.other.module.systemverilog
430+ - include : ' #parameters'
431+ - include : ' #comments'
432+ - match : ' \b([a-zA-Z_][a-zA-Z0-9_$]*)\b(?=[ \t\r\n]*$)'
433+ name : variable.other.class.systemverilog
434+ - include : ' #identifiers'
435+ name : meta.class.parameters.systemverilog
414436 module-no-parameters :
415437 begin : >-
416438 [ \t\r\n]*\b(?:(bind|pullup|pulldown)[ \t\r\n]+(?:([a-zA-Z_][a-zA-Z0-9_$\.]*)[ \t\r\n]+)?)?((?:\b(?:and|nand|or|nor|xor|xnor|buf|not|bufif[01]|notif[01]|r?[npc]mos|r?tran|r?tranif[01])\b|[a-zA-Z_][a-zA-Z0-9_$]*))[ \t\r\n]+(?!intersect|and|or|throughout|within)([a-zA-Z_][a-zA-Z0-9_$]*)(?:[ \t\r\n]*(\[[a-zA-Z0-9_:$\.\-\+\*/%`' \t\r\n\[\]\(\)]*\])?)[ \t\r\n]*(?=\(|$)(?!;)
@@ -524,7 +546,7 @@ repository:
524546 port-net-parameter :
525547 patterns :
526548 - match : >-
527- ,?[ \t\r\n]*(?:\b(output|input|inout|ref)\b[ \t\r\n]*)?(?:\b(localparam|parameter|var|supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\b[ \t\r\n]*)?(?:\b([a-zA-Z_][a-zA-Z0-9_$]*)(::))?(?:([a-zA-Z_][a-zA-Z0-9_$]*)\b[ \t\r\n]*)?(?:\b(signed|unsigned)\b[ \t\r\n]*)?(?:(\[[a-zA-Z0-9_:$\.\-\+\*/%`' \t\r\n\[\]\(\)]*\])[ \t\r\n]*)?(?<!(?<!#)[:&|=+\-*/%><^!~\(][ \t\r\n]*)\b([a-zA-Z_][a-zA-Z0-9_$]*)\b[ \t\r\n]*(\[[a-zA-Z0-9_:$\.\-\+\*/%`' \t\r\n\[\]\(\)]*\])?[ \t\r\n]*(?=,|;|=|\)|/|$)
549+ ,?[ \t\r\n]*(?:\b(output|input|inout|ref)\b[ \t\r\n]*)?(?:\b(localparam|parameter|var|supply[01]|tri|triand|trior|trireg|tri[01]|uwire|wire|wand|wor)\b[ \t\r\n]*)?(?:\b([a-zA-Z_][a-zA-Z0-9_$]*)(::))?(?:([a-zA-Z_][a-zA-Z0-9_$]*)\b[ \t\r\n]*)?(?:(#\([ \t\r\n]*[.a-zA-Z_][a-zA-Z0-9_\.\"\'\(\), \t\r\n]*\)[ \t\r\n]*)\b[ \t\r\n]*)?(?: \b(signed|unsigned)\b[ \t\r\n]*)?(?:(\[[a-zA-Z0-9_:$\.\-\+\*/%`' \t\r\n\[\]\(\)]*\])[ \t\r\n]*)?(?<!(?<!#)[:&|=+\-*/%><^!~\(][ \t\r\n]*)\b([a-zA-Z_][a-zA-Z0-9_$]*)\b[ \t\r\n]*(\[[a-zA-Z0-9_:$\.\-\+\*/%`' \t\r\n\[\]\(\)]*\])?[ \t\r\n]*(?=,|;|=|\)|/|$)
528550 captures:
529551 '1':
530552 name: support.type.direction.systemverilog
@@ -541,15 +563,18 @@ repository:
541563 name: storage.type.user-defined.systemverilog
542564 '6':
543565 patterns:
544- - include: '#modifiers '
566+ - include: '#parameters '
545567 '7':
546568 patterns:
547- - include: '#selects '
569+ - include: '#modifiers '
548570 '8':
571+ patterns:
572+ - include: '#selects'
573+ '9':
549574 patterns:
550575 - include: '#constants'
551576 - include: '#identifiers'
552- '9 ':
577+ '10 ':
553578 patterns:
554579 - include: '#selects'
555580 name: meta.port-net-parameter.declaration.systemverilog
0 commit comments