feat: expose the allocator and array header files for external scanners

This commit is contained in:
Amaan Qureshi 2024-02-22 09:13:59 -05:00
parent 52d69790f3
commit f1eecf9786
12 changed files with 326 additions and 82 deletions

View file

@ -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!(