#dust #tree-sitter #parser

tree-sitter-dust

Dust grammar for the tree-sitter parsing library

1 unstable release

0.0.1 Sep 22, 2023

#8 in #dust

MIT license

53KB
1.5K SLoC

C 1.5K SLoC JavaScript 58 SLoC Rust 31 SLoC // 0.5% comments

tree-sitter-dust

Tree sitter implementation for the Dust programming language.

This repository is used to enable sytax highlighting and other developer-friendly features for Dust. To use this repository with Helix, clone it and add the following to your languages.toml file.

[[language]]
name = "dust"
scope = "source.dust"
injection-regex = "dust"
file-types = ["ds", "dust"]
roots = [".git"]
comment-token = "#"
grammar = "dust"

[[grammar]]
name = "dust"
source.path = "/path/to/tree-sitter-dust"

lib.rs:

This crate provides Dust 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_Dust::language()).expect("Error loading Dust grammar");
let tree = parser.parse(code, None).unwrap();

Dependencies

~2.8–4MB
~76K SLoC