Registry / serialization / tree-sitter-groovy

tree-sitter-groovy

JSON →
library0.1.2pypypi✓ verified 85d ago

Groovy grammar for tree-sitter, version 0.1.2. Provides a parser and syntax tree for Groovy files. Low release cadence; mature grammar.

pip install tree-sitter-groovy
INSTALL
IMPORT
SIG · TREE-SITTER-GROOVY
T
tree-sitter-groovy
serializationpythonv0.1.2
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_groovy import language
import tree_sitter_groovy; tree_sitter_groovy.language()
Direct import of the function avoids namespace confusion

Parse a Groovy snippet and print the syntax tree.

from tree_sitter import Language, Parser from tree_sitter_groovy import language Lang = Language(language()) parser = Parser() parser.set_language(Lang) tree = parser.parse(b'println "hello"') root = tree.root_node print(root.sexp())
Debug
Known issues
gotchaThe grammar is incomplete and may fail on complex Groovy constructs.
fix
Test thoroughly; consider contributing to grammar improvements.
affects: all
deprecatedThe old API of directly calling `language` without importing from the specific package is deprecated.
fix
Use `from tree_sitter_groovy import language` instead of `import tree_sitter_groovy; tree_sitter_groovy.language()`.
affects: >=0.1.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'tree_sitter_groovy'
tree-sitter-groovy not installed or installed in a different environment.
fix
Run `pip install tree-sitter-groovy` in the correct environment.
TypeError: language() takes 0 positional arguments but 1 was given
Passing arguments to `language()` which is no longer supported.
fix
Call `language()` with no arguments; it returns the language object directly.
Upgrade
Version history
0.1.2latest on PyPI · released Nov 19, 2024
Audit
Dependencies
tree-sitterrequiredRequired for loading and using the grammar
Agent activity
11 hits · last 30 days
node
10
OpenAI (training)
1
Resources
tree-sitter-groovy — pip install tree-sitter-groovy · libregistry