Registry / serialization / tree-sitter-verilog

tree-sitter-verilog

JSON →
library1.0.3pypypi✓ verified 81d ago

Verilog grammar for tree-sitter. Version 1.0.3, updated 2025. Low cadence; provides a parser for Verilog and SystemVerilog files, used with the tree-sitter parsing library.

pip install tree-sitter-verilog
INSTALL
IMPORT
SIG · TREE-SITTER-VERILO
T
tree-sitter-verilog
serializationpythonv1.0.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

language
from tree_sitter_verilog import language
from tree_sitter_verilog import language_verilog

Basic usage: import the grammar, build a Language, parse Verilog code.

import tree_sitter_verilog as tsverilog from tree_sitter import Language, Parser # Build Language object from grammar VERILOG_LANGUAGE = Language(tsverilog.language_verilog()) # Initialize parser parser = Parser(VERILOG_LANGUAGE) # Parse a snippet tree = parser.parse(bytes("module test; wire a; endmodule", "utf8")) root_node = tree.root_node print(root_node.sexp())
Debug
Known issues
breakingThe language function changed from `language` to `language_verilog` in v1.0.0. Old code using `from tree_sitter_verilog import language` will break.
fix
Change import to `from tree_sitter_verilog import language_verilog` and call `language_verilog()`.
affects: <1.0.0
deprecatedtree-sitter versions below 0.20 are no longer supported. This grammar uses the newer API.
fix
Upgrade tree-sitter to >=0.20.
affects: >=0.20
gotchaThe grammar is for Verilog and SystemVerilog. However, some SystemVerilog constructs may not be fully supported. Check the grammar's issue tracker for known limitations.
fix
Test edge cases against the grammar's test suite.
affects: all
Upgrade
Version history
1.0.3latest on PyPI · released Nov 10, 2024
Audit
Dependencies
tree-sitterrequiredCore library for parsing; tree-sitter-verilog is a grammar package meant to be used with tree-sitter >=0.20
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
2
Resources
tree-sitter-verilog — pip install tree-sitter-verilog · libregistry