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 = { systemverilog = {
install_info = { install_info = {
revision = 'b2c95d30954fbd3cf9be6d96a3ad82e023c2fa12', revision = '3bd2c5d2f60ed7b07c2177b34e2976ad9a87c659',
url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog', url = 'https://github.com/gmlarumbe/tree-sitter-systemverilog',
}, },
maintainers = { '@zhangwwpeng' }, maintainers = { '@zhangwwpeng' },

View file

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

View file

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