Struct hemtt_preprocessor::Context
source · pub struct Context<'a> { /* private fields */ }
Expand description
Preprocessor context
Implementations§
source§impl<'a> Context<'a>
impl<'a> Context<'a>
sourcepub fn ifstates_mut(&mut self) -> &mut IfStates
pub fn ifstates_mut(&mut self) -> &mut IfStates
Get the current IfState
mutably
sourcepub const fn definitions(&self) -> &Defines
pub const fn definitions(&self) -> &Defines
Get the current Definition
s
sourcepub fn definitions_mut(&mut self) -> &mut Defines
pub fn definitions_mut(&mut self) -> &mut Defines
Get the current Definition
s mutably
sourcepub const fn current_file(&self) -> &String
pub const fn current_file(&self) -> &String
Get the current file
sourcepub fn set_current_file(&mut self, file: String)
pub fn set_current_file(&mut self, file: String)
Set the current file
sourcepub fn define(
&mut self,
ident: String,
source: Token,
definition: Definition
) -> Result<(), Error>
pub fn define( &mut self, ident: String, source: Token, definition: Definition ) -> Result<(), Error>
sourcepub fn undefine(
&mut self,
ident: &str,
source: &Token
) -> Result<Option<(Token, Definition)>, Error>
pub fn undefine( &mut self, ident: &str, source: &Token ) -> Result<Option<(Token, Definition)>, Error>
sourcepub fn has(&self, ident: &str) -> bool
pub fn has(&self, ident: &str) -> bool
Check if a macro Definition
exists
sourcepub fn get(&self, ident: &str, token: &Token) -> Option<(Token, Definition)>
pub fn get(&self, ident: &str, token: &Token) -> Option<(Token, Definition)>
Get a macro Definition