{"id":28418,"library":"tree-sitter-verilog","title":"tree-sitter-verilog","description":"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.","status":"active","version":"1.0.3","language":"python","source_language":"en","source_url":"https://github.com/tree-sitter/tree-sitter-verilog","tags":["tree-sitter","verilog","systemverilog","parser","grammar"],"install":[{"cmd":"pip install tree-sitter-verilog","lang":"bash","label":"latest release"}],"dependencies":[{"reason":"Core library for parsing; tree-sitter-verilog is a grammar package meant to be used with tree-sitter >=0.20","package":"tree-sitter","optional":false}],"imports":[{"note":"The grammar language function for Verilog.","symbol":"language_verilog","correct":"from tree_sitter_verilog import language_verilog"},{"note":"Language is from tree_sitter core, not from the grammar package.","wrong":"from tree_sitter_verilog import Language","symbol":"Language","correct":"from tree_sitter import Language"}],"quickstart":{"code":"import tree_sitter_verilog as tsverilog\nfrom tree_sitter import Language, Parser\n\n# Build Language object from grammar\nVERILOG_LANGUAGE = Language(tsverilog.language_verilog())\n\n# Initialize parser\nparser = Parser(VERILOG_LANGUAGE)\n\n# Parse a snippet\ntree = parser.parse(bytes(\"module test; wire a; endmodule\", \"utf8\"))\nroot_node = tree.root_node\nprint(root_node.sexp())","lang":"python","description":"Basic usage: import the grammar, build a Language, parse Verilog code."},"warnings":[{"fix":"Change import to `from tree_sitter_verilog import language_verilog` and call `language_verilog()`.","message":"The language function changed from `language` to `language_verilog` in v1.0.0. Old code using `from tree_sitter_verilog import language` will break.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Upgrade tree-sitter to >=0.20.","message":"tree-sitter versions below 0.20 are no longer supported. This grammar uses the newer API.","severity":"deprecated","affected_versions":">=0.20"},{"fix":"Test edge cases against the grammar's test suite.","message":"The grammar is for Verilog and SystemVerilog. However, some SystemVerilog constructs may not be fully supported. Check the grammar's issue tracker for known limitations.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Use `from tree_sitter_verilog import language_verilog` and call `language_verilog()`.","cause":"Old import pattern using `language` instead of `language_verilog`.","error":"AttributeError: module 'tree_sitter_verilog' has no attribute 'language'"},{"fix":"Call the function: `Language(tsverilog.language_verilog())`.","cause":"Passing the language function directly instead of calling it.","error":"TypeError: Language() argument after * must be an iterable, not function"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}