tree_sitter_bynk/lib.rs
1//! Rust binding for the `tree-sitter-bynk` grammar.
2//!
3//! This crate is **not** a product crate. It exists so the cross-parser
4//! conformance test (`tests/conformance.rs`) can parse Bynk source with the
5//! tree-sitter grammar and diff the accept/reject decision against the
6//! hand-written `bynk-syntax` recursive-descent parser — the only guard that
7//! ties the editor grammar to the compiler parser. It is unpublished and kept
8//! off the release workflows' hardcoded crate list.
9
10use tree_sitter_language::LanguageFn;
11
12unsafe extern "C" {
13 fn tree_sitter_bynk() -> *const ();
14}
15
16/// The tree-sitter [`LanguageFn`] for the Bynk grammar.
17pub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_bynk) };
18
19/// The generated `node-types.json` for the grammar.
20pub const NODE_TYPES: &str = include_str!("../../src/node-types.json");