Skip to main content

lux_lib/lua_rockspec/build/
tree_sitter.rs

1use std::{collections::HashMap, path::PathBuf};
2
3/// Specification for building a rock with the `treesitter-parser` build backend
4#[derive(Debug, PartialEq, Default, Clone)]
5pub struct TreesitterParserBuildSpec {
6    /// Name of the parser language, e.g. "haskell"
7    pub lang: String,
8
9    /// Won't build the parser if `false`
10    /// (useful for packages that only include queries)
11    pub parser: bool,
12
13    /// Must the sources be generated?
14    pub generate: bool,
15
16    /// tree-sitter grammar's location (relative to the source root)
17    pub location: Option<PathBuf>,
18
19    /// Embedded queries to be installed in the `etc/queries` directory
20    pub queries: HashMap<PathBuf, String>,
21}