4 releases
| 0.4.2 | Nov 17, 2025 |
|---|---|
| 0.4.1 | Oct 26, 2025 |
| 0.4.0 | Oct 26, 2025 |
| 0.3.0 | Sep 15, 2025 |
#2893 in Parser implementations
178 downloads per month
Used in mergiraf
3.5MB
132K
SLoC
This crate provides Python language support for the tree-sitter parsing library.
Typically, you will use the LANGUAGE constant to add this language to a
tree-sitter Parser, and then use the parser to parse some code:
let code = r#"
print('hello world')
"#;
let mut parser = tree_sitter::Parser::new();
let language = tree_sitter_python_orchard::LANGUAGE;
parser
.set_language(&language.into())
.expect("Error loading Python parser");
let tree = parser.parse(code, None).unwrap();
assert!(!tree.root_node().has_error());
tree-sitter-python-orchard
Python grammar for Tree-sitter, forked from https://github.com/tree-sitter/tree-sitter-python
Note that unlike upstream, generated files are not checked into git, so you need to run tree-sitter generate after cloning this repository.
Contributions are welcome, so are co-maintainers.