Struct erg_compiler::lower::ASTLowerer
source · pub struct ASTLowerer { /* private fields */ }
Expand description
Checks & infers types of an AST, and convert (lower) it into a HIR
Implementations§
source§impl ASTLowerer
impl ASTLowerer
pub fn new_with_cache<S: Into<Str>>( cfg: ErgConfig, mod_name: S, shared: SharedCompilerResource ) -> Self
pub fn pop_mod_ctx(&mut self) -> Option<ModuleContext>
pub fn pop_mod_ctx_or_default(&mut self) -> ModuleContext
pub fn get_mod_ctx(&self) -> &ModuleContext
pub fn dir(&self) -> Dict<&VarName, &VarInfo>
pub fn get_receiver_ctx(&self, receiver_name: &str) -> Option<&Context>
pub fn get_var_info(&self, name: &str) -> Option<(&VarName, &VarInfo)>
source§impl ASTLowerer
impl ASTLowerer
pub fn lower( &mut self, ast: AST, mode: &str ) -> Result<CompleteArtifact, IncompleteArtifact>
Trait Implementations§
source§impl ContextProvider for ASTLowerer
impl ContextProvider for ASTLowerer
source§impl Debug for ASTLowerer
impl Debug for ASTLowerer
source§impl Default for ASTLowerer
impl Default for ASTLowerer
source§impl Runnable for ASTLowerer
impl Runnable for ASTLowerer
type Err = CompileError
type Errs = CompileErrors
const NAME: &'static str = "Erg lowerer"
fn cfg(&self) -> &ErgConfig
fn cfg_mut(&mut self) -> &mut ErgConfig
fn new(cfg: ErgConfig) -> Self
fn finish(&mut self)
source§fn initialize(&mut self)
fn initialize(&mut self)
Erase all but immutable information.
fn exec(&mut self) -> Result<ExitStatus, Self::Errs>
fn eval(&mut self, src: String) -> Result<String, Self::Errs>
fn expect_block(&self, src: &str) -> BlockKind
fn input(&self) -> &Input
fn set_input(&mut self, input: Input)
fn start_message(&self) -> String
fn ps1(&self) -> String
fn ps2(&self) -> String
fn quit(&mut self, code: i32) -> !
fn quit_successfully(&mut self, output: BufWriter<StdoutLock<'_>>) -> !
fn run(cfg: ErgConfig) -> ExitStatus
Auto Trait Implementations§
impl !RefUnwindSafe for ASTLowerer
impl !Send for ASTLowerer
impl !Sync for ASTLowerer
impl Unpin for ASTLowerer
impl !UnwindSafe for ASTLowerer
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more