[−][src]Struct lalrpop::Configuration
Configure various aspects of how LALRPOP works.
Intended for use within a build.rs
script.
To get the default configuration, use Configuration::new
.
Implementations
impl Configuration
[src]
pub fn new() -> Configuration
[src]
Creates the default configuration; equivalent to Configuration::default
.
pub fn always_use_colors(&mut self) -> &mut Configuration
[src]
Always use ANSI colors in output, even if output does not appear to be a TTY.
pub fn never_use_colors(&mut self) -> &mut Configuration
[src]
Never use ANSI colors in output, even if output appears to be a TTY.
pub fn use_colors_if_tty(&mut self) -> &mut Configuration
[src]
Use ANSI colors in output if output appears to be a TTY, but not otherwise. This is the default.
pub fn set_in_dir<P>(&mut self, dir: P) -> &mut Self where
P: Into<PathBuf>,
[src]
P: Into<PathBuf>,
Specify a custom directory to search for input files. This
directory is recursively searched for .lalrpop
files to be
considered as input files. This configuration setting also
impacts where output files are placed; paths are made relative
to the input path before being resolved relative to the output
path. By default, the input directory is the current working
directory.
pub fn set_out_dir<P>(&mut self, dir: P) -> &mut Self where
P: Into<PathBuf>,
[src]
P: Into<PathBuf>,
Specify a custom directory to use when writing output files. By default, the output directory is the same as the input directory.
pub fn use_cargo_dir_conventions(&mut self) -> &mut Self
[src]
Apply cargo
directory location conventions, by setting the
input directory to src
and the output directory to
$OUT_DIR
.
pub fn generate_in_source_tree(&mut self) -> &mut Self
[src]
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:
mod parser; // synthesized from parser.lalrpop
This was the default behaviour up to version 0.15.
pub fn force_build(&mut self, val: bool) -> &mut Configuration
[src]
If true, always convert .lalrpop
files into .rs
files, even if the
.rs
file is newer. Default is false.
pub fn emit_rerun_directives(&mut self, val: bool) -> &mut Configuration
[src]
If true, print rerun-if-changed
directives to standard output, so that
Cargo will only rerun the build script if any of the processed
.lalrpop
files are changed. This option is independent of
[force_build
], although it would be usual to set [force_build
] and
[emit_rerun_directives
] at the same time.
While many build scripts will want to set this to true
, the default is
false, because emitting any rerun directives to Cargo will cause the
script to only be rerun when Cargo thinks it is needed. This could lead
to hard-to-find bugs if other parts of the build script do not emit
directives correctly, or need to be rerun unconditionally.
pub fn emit_comments(&mut self, val: bool) -> &mut Configuration
[src]
If true, emit comments into the generated code. This makes the generated code significantly larger. Default is false.
pub fn emit_whitespace(&mut self, val: bool) -> &mut Configuration
[src]
If false, shrinks the generated code by removing redundant white space. Default is true.
pub fn emit_report(&mut self, val: bool) -> &mut Configuration
[src]
If true, emit report file about generated code.
pub fn log_quiet(&mut self) -> &mut Configuration
[src]
Minimal logs: only for errors that halt progress.
pub fn log_info(&mut self) -> &mut Configuration
[src]
Informative logs: give some high-level indications of progress (default).
pub fn log_verbose(&mut self) -> &mut Configuration
[src]
Verbose logs: more than info, but still not overwhelming.
pub fn log_debug(&mut self) -> &mut Configuration
[src]
Debug logs: better redirect this to a file. Intended for debugging LALRPOP itself.
pub fn set_features<I>(&mut self, iterable: I) -> &mut Configuration where
I: IntoIterator<Item = String>,
[src]
I: IntoIterator<Item = String>,
Sets the features used during compilation, disables the use of cargo features.
(Default: Loaded from CARGO_FEATURE_{}
environment variables).
pub fn process(&self) -> Result<(), Box<dyn Error>>
[src]
Process all files according to the set_in_dir
and
set_out_dir
configuration.
pub fn process_current_dir(&self) -> Result<(), Box<dyn Error>>
[src]
Process all files in the current directory, which -- unless you have changed it -- is typically the root of the crate being compiled.
pub fn process_dir<P: AsRef<Path>>(&self, path: P) -> Result<(), Box<dyn Error>>
[src]
Process all .lalrpop
files in path
.
pub fn process_file<P: AsRef<Path>>(
&self,
path: P
) -> Result<(), Box<dyn Error>>
[src]
&self,
path: P
) -> Result<(), Box<dyn Error>>
Process the given .lalrpop
file.
Trait Implementations
impl Clone for Configuration
[src]
pub fn clone(&self) -> Configuration
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for Configuration
[src]
pub fn default() -> Configuration
[src]
Auto Trait Implementations
impl RefUnwindSafe for Configuration
[src]
impl Send for Configuration
[src]
impl Sync for Configuration
[src]
impl Unpin for Configuration
[src]
impl UnwindSafe for Configuration
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,