parent
b08f8dc855
commit
5debf3cbcc
1 changed files with 4 additions and 3 deletions
|
|
@ -34,6 +34,10 @@ pub fn generate_parser_in_directory(
|
|||
state_ids_to_log: Vec<usize>,
|
||||
) -> Result<()> {
|
||||
let repo_src_path = repo_path.join("src");
|
||||
let repo_header_path = repo_src_path.join("tree_sitter");
|
||||
|
||||
fs::create_dir_all(&repo_src_path)?;
|
||||
fs::create_dir_all(&repo_header_path)?;
|
||||
|
||||
let grammar_json;
|
||||
match grammar_path {
|
||||
|
|
@ -49,9 +53,6 @@ pub fn generate_parser_in_directory(
|
|||
|
||||
let (language_name, c_code) =
|
||||
generate_parser_for_grammar_with_opts(&grammar_json, minimize, state_ids_to_log)?;
|
||||
let repo_header_path = repo_src_path.join("tree_sitter");
|
||||
fs::create_dir_all(&repo_src_path)?;
|
||||
fs::create_dir_all(&repo_header_path)?;
|
||||
fs::write(&repo_src_path.join("parser.c"), c_code)
|
||||
.map_err(|e| format!("Failed to write parser.c: {}", e))?;
|
||||
fs::write(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue