diff options
author | Nadrieril Feneanar | 2019-09-19 10:54:11 +0200 |
---|---|---|
committer | GitHub | 2019-09-19 10:54:11 +0200 |
commit | 4daead27eb65e3a38869924f0f3ed1f425de1b33 (patch) | |
tree | 06effc0f10795a208e929bdf9fdbbbfa6d94cc31 /dhall_generated_parser/build.rs | |
parent | bcaeab3b7b114d8782be9589ad673ab9ab8c59fd (diff) | |
parent | bf417fadb206d6d2351a13cd7c6988977a46dd33 (diff) |
Merge pull request #113 from Nadrieril/pest_consume
Extract parser macros into an independent crate
Diffstat (limited to '')
-rw-r--r-- | dhall_generated_parser/build.rs | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/dhall_generated_parser/build.rs b/dhall_generated_parser/build.rs index c562fad..68895dd 100644 --- a/dhall_generated_parser/build.rs +++ b/dhall_generated_parser/build.rs @@ -1,7 +1,5 @@ -use std::env; use std::fs::File; use std::io::{BufRead, BufReader, Read, Write}; -use std::path::Path; use abnf_to_pest::render_rules_to_pest; @@ -90,20 +88,5 @@ fn main() -> std::io::Result<()> { writeln!(&mut file)?; writeln!(&mut file, "{}", render_rules_to_pest(rules).pretty(80))?; - // Generate pest parser manually to avoid spurious recompilations - let derived = { - let pest_path = "dhall.pest"; - let pest = quote::quote! { - #[grammar = #pest_path] - pub struct DhallParser; - }; - pest_generator::derive_parser(pest, false) - }; - - let out_dir = env::var("OUT_DIR").unwrap(); - let grammar_path = Path::new(&out_dir).join("grammar.rs"); - let mut file = File::create(grammar_path)?; - writeln!(file, "pub struct DhallParser;\n{}", derived,)?; - Ok(()) } |