9 unstable releases
0.5.1 | Feb 24, 2024 |
---|---|
0.5.0 | Feb 4, 2024 |
0.4.2 | Oct 30, 2022 |
0.4.0 | May 7, 2022 |
0.1.0 | Aug 1, 2021 |
#124 in Text editors
164 downloads per month
Used in 2 crates
270KB
10K
SLoC
tree-sitter-openscad
OpenSCAD grammar for the tree-sitter parsing library
Developer quickstart
Most development of tree-sitter parsers is done using nodejs and npm. You can find the instructions on how to set that up here: https://tree-sitter.github.io/tree-sitter/creating-parsers
The TLDR would be:
- Install
npm
(there are many ways, pick your poison) - From the source directory, run
npm install
to get all the dependencies export PATH=$PATH:./node_modules/.bin
to get thetree-sitter
CLI commandtree-sitter generate
to build your changestree-sitter test
to make sure you didn't unintentionally break any of the existing test cases- Add a new test case covering your change (instructions here: https://tree-sitter.github.io/tree-sitter/creating-parsers#command-test)
lib.rs
:
This crate provides openscad language support for the tree-sitter parsing library.
Typically, you will use the language function to add this language to a tree-sitter Parser, and then use the parser to parse some code:
let code = "";
let mut parser = tree_sitter::Parser::new();
parser.set_language(tree_sitter_openscad::language()).expect("Error loading openscad grammar");
let tree = parser.parse(code, None).unwrap();
Dependencies
~2.7–4MB
~75K SLoC