feat: expose the allocator and array header files for external scanners
This commit is contained in:
parent
52d69790f3
commit
f1eecf9786
12 changed files with 326 additions and 82 deletions
|
|
@ -107,6 +107,25 @@ pub fn get_test_language(name: &str, parser_code: &str, path: Option<&Path>) ->
|
|||
|
||||
let header_path = src_dir.join("tree_sitter");
|
||||
fs::create_dir_all(&header_path).unwrap();
|
||||
|
||||
fs::write(header_path.join("alloc.h"), tree_sitter::PARSER_HEADER)
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Failed to write {:?}",
|
||||
header_path.join("alloc.h").file_name().unwrap()
|
||||
)
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
fs::write(header_path.join("array.h"), tree_sitter::PARSER_HEADER)
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Failed to write {:?}",
|
||||
header_path.join("array.h").file_name().unwrap()
|
||||
)
|
||||
})
|
||||
.unwrap();
|
||||
|
||||
fs::write(header_path.join("parser.h"), tree_sitter::PARSER_HEADER)
|
||||
.with_context(|| {
|
||||
format!(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue