tree-sitter-integerbasic

Crates.iotree-sitter-integerbasic
lib.rstree-sitter-integerbasic
version2.0.0
sourcesrc
created_at2022-03-13 17:24:07.751504
updated_at2024-07-26 22:40:53.691859
descriptioninteger basic grammar for the tree-sitter parsing library
homepagehttps://github.com/dfgordon/tree-sitter-integerbasic
repositoryhttps://github.com/dfgordon/tree-sitter-integerbasic
max_upload_size
id549299
size1,031,438
(dfgordon)

documentation

README

Parser for Integer BASIC

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

[dependencies]
tree-sitter = "0.22.4"
tree-sitter-integerbasic = "2.0.0"

Here is a trivial main.rs example:

use tree_sitter;
use tree_sitter_integerbasic;

fn main() {
    let code = "10 GOTO 10\n";
    let mut parser = tree_sitter::Parser::new();
    parser.set_language(&tree_sitter_integerbasic::language())
      .expect("Error loading Integer BASIC grammar");
    let tree = parser.parse(code,None).unwrap();

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

This should print the syntax tree

(source_file (line (linenum) (statement (statement_goto) (integer))))

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

Commit count: 13

cargo fmt