tree-sitter-turbowave

Crates.iotree-sitter-turbowave
lib.rstree-sitter-turbowave
version1.7.1
sourcesrc
created_at2022-09-07 16:35:40.459911
updated_at2022-09-07 16:35:40.459911
descriptionturbowave grammar for the tree-sitter parsing library
homepage
repositoryhttps://github.com/dfgordon/tree-sitter-turbowave
max_upload_size
id660495
size322,121
(dfgordon)

documentation

README

Parser for turboWAVE

This is the rust binding for tree-sitter-turbowave. To use the parser, include the following in your package's Cargo.toml:

[dependencies]
tree-sitter = "~0.20.6"
tree-sitter-turbowave = "~1.7.1"

Here is a trivial main.rs example:

use tree_sitter;
use tree_sitter_turbowave;

fn main() {
    let code = "timestep = 1\n";
    let mut parser = tree_sitter::Parser::new();
    parser.set_language(tree_sitter_turbowave::language())
      .expect("Error loading grammar");
    let tree = parser.parse(code,None).unwrap();

    println!("{}",tree.root_node().to_sexp());
}

This should print the syntax tree

(input_file (assignment (obj_key (identifier)) (decimal)))

For more on parsing with rust, see the general guidance here.

Commit count: 38

cargo fmt