pub struct Config {
pub emit_errors: bool,
pub emit_warnings: bool,
pub root_dir: PathBuf,
pub run_preprocessor: bool,
pub preprocess_only: bool,
pub include_path: Option<PathBuf>,
pub file_sym_name: Option<String>,
pub comment: String,
}
Expand description
Various configuration parameters for altering how the assembler acts
Fields§
§emit_errors: bool
This value should be true when this assembler is being run in CLI mode, like in this crate itself. This causes it to emit errors to stdout, instead of just returning Err(())
emit_warnings: bool
If warnings should be emitted during assembly
root_dir: PathBuf
The “root directory” is usually the directory in which KASM was run, so that file paths can be expressed relative to the current location
run_preprocessor: bool
If the preprocessor should be run or not. The benefit of not running it is that the assembly process will be faster without it
preprocess_only: bool
If assembly should take place, or if the output file should be preprocessed source code. This can be useful for debugging or just generating code
include_path: Option<PathBuf>
If specified, instead of the preprocessor looking at the current working directory for files to include, it will search the provided path
file_sym_name: Option<String>
If specified, instead of the object file’s “file” symbol being set to the name of the input file, it will be set to this provided value. This can be useful when creating a compiler with KASM as it allows you to use the source file’s name and not the assembled file’s name.
comment: String
If specified, instead of the default “Compiled with KASM {}”, another comment will be placed inside of the produced object file. This is useful for setting messages for compilers that generate KASM
Trait Implementations§
source§impl CommandFactory for Config
impl CommandFactory for Config
source§impl FromArgMatches for Config
impl FromArgMatches for Config
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>
ArgMatches
to self
.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>
ArgMatches
to self
.source§impl Parser for Config
impl Parser for Config
source§fn try_parse() -> Result<Self, Error<RichFormatter>>
fn try_parse() -> Result<Self, Error<RichFormatter>>
std::env::args_os()
, return Err on error.