Option to keep output files in source tree

This commit is contained in:
Ayose 2018-03-25 19:48:11 +01:00
parent e7db1ee2e2
commit 7dc816b98c

View File

@ -76,6 +76,20 @@ impl Configuration {
self
}
/// Write output files in the same directory of the input files.
///
/// If this option is enabled, you have to load the parser as a module:
///
/// ```no_run
/// mod parser; // synthesized from parser.lalrpop
/// ```
///
/// This was the default behaviour up to version 0.15.
pub fn generate_in_source_tree(&mut self) -> &mut Self {
self.set_in_dir(Path::new("."))
.set_out_dir(Path::new("."))
}
/// If true, always convert `.lalrpop` files into `.rs` files, even if the
/// `.rs` file is newer. Default is false.
pub fn force_build(&mut self, val: bool) -> &mut Configuration {