feat(systemverilog)!: update parser and queries

Breaking changes:
1. `(comment)` node split into `(one_line_comment)` and
   `(block_comment)`
2. named `(directive_foo)` nodes replaced by anonymous `"'foo"`
   (with backtick!) nodes -- but not consistently
This commit is contained in:
Christian Clason 2025-08-01 18:15:49 +02:00 committed by Christian Clason
parent 3561e1fb19
commit 05f2910355
3 changed files with 21 additions and 18 deletions

View file

@ -2233,7 +2233,7 @@ return {
},
systemverilog = {
install_info = {
revision = 'b2c95d30954fbd3cf9be6d96a3ad82e023c2fa12',
revision = '3bd2c5d2f60ed7b07c2177b34e2976ad9a87c659',
url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog',
},
maintainers = { '@zhangwwpeng' },

View file

@ -234,10 +234,13 @@
[
"include"
"import"
"directive_include"
"`include"
] @keyword.import
(comment) @comment @spell
[
(one_line_comment)
(block_comment)
] @comment @spell
[
"@"
@ -300,9 +303,6 @@ port_name: (simple_identifier) @variable
(net_decl_assignment
(simple_identifier) @variable)
(ERROR
(simple_identifier) @variable)
; variable.member
(hierarchical_identifier
(simple_identifier)
@ -570,17 +570,17 @@ c_name: (c_identifier) @function
; directive
[
"directive_define"
"directive_default_nettype"
"directive_resetall"
"directive_timescale"
"directive_undef"
"directive_undefineall"
"directive_ifdef"
"directive_ifndef"
"directive_elsif"
"directive_endif"
"directive_else"
"`define"
"`default_nettype"
(resetall_compiler_directive)
"`timescale"
"`undef"
(undefineall_compiler_directive)
"`ifdef"
"`ifndef"
"`elsif"
"`endif"
"`else"
] @keyword.directive.define
(include_compiler_directive

View file

@ -1,4 +1,7 @@
((comment) @injection.content
([
(one_line_comment)
(block_comment)
] @injection.content
(#set! injection.language "comment"))
((macro_text) @injection.content