Struct erg_compiler::Compiler
source · pub struct Compiler {
pub cfg: ErgConfig,
/* private fields */
}
Expand description
Generates a CodeObj
from an String or other File inputs.
Fields§
§cfg: ErgConfig
Implementations§
source§impl Compiler
impl Compiler
pub fn new(cfg: ErgConfig) -> Self
pub fn compile_and_dump_as_pyc<P: AsRef<Path>>( &mut self, pyc_path: P, src: String, mode: &str ) -> Result<CompileWarnings, ErrorArtifact>
pub fn eval_compile_and_dump_as_pyc<P: AsRef<Path>>( &mut self, pyc_path: P, src: String, mode: &str ) -> Result<CompleteArtifact<Option<Expr>>, ErrorArtifact>
pub fn compile( &mut self, src: String, mode: &str ) -> Result<CompleteArtifact<CodeObj>, ErrorArtifact>
pub fn compile_ast( &mut self, ast: AST, mode: &str ) -> Result<CompleteArtifact<CodeObj>, ErrorArtifact>
pub fn compile_module( &mut self ) -> Result<CompleteArtifact<CodeObj>, ErrorArtifact>
pub fn eval_compile( &mut self, src: String, mode: &str ) -> Result<CompleteArtifact<(CodeObj, Option<Expr>)>, ErrorArtifact>
pub fn initialize_generator(&mut self)
Trait Implementations§
source§impl ContextProvider for Compiler
impl ContextProvider for Compiler
source§impl Runnable for Compiler
impl Runnable for Compiler
type Err = CompileError
type Errs = CompileErrors
const NAME: &'static str = "Erg compiler"
fn cfg(&self) -> &ErgConfig
fn cfg_mut(&mut self) -> &mut ErgConfig
fn finish(&mut self)
source§fn initialize(&mut self)
fn initialize(&mut self)
Erase all but immutable information.
fn set_input(&mut self, input: Input)
fn exec(&mut self) -> Result<ExitStatus, Self::Errs>
fn eval(&mut self, src: String) -> Result<String, CompileErrors>
fn expect_block(&self, src: &str) -> BlockKind
fn input(&self) -> &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 !Freeze for Compiler
impl !RefUnwindSafe for Compiler
impl !Send for Compiler
impl !Sync for Compiler
impl Unpin for Compiler
impl !UnwindSafe for Compiler
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