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
sourceimpl Compiler
impl Compiler
pub fn compile_and_dump_as_pyc<P: AsRef<Path>>(
&mut self,
pyc_path: P,
src: String,
mode: &str
) -> Result<(), CompileErrors>
pub fn eval_compile_and_dump_as_pyc<P: AsRef<Path>>(
&mut self,
pyc_path: P,
src: String,
mode: &str
) -> Result<Option<Expr>, CompileErrors>
pub fn compile(
&mut self,
src: String,
mode: &str
) -> Result<CodeObj, CompileErrors>
pub fn eval_compile(
&mut self,
src: String,
mode: &str
) -> Result<(CodeObj, Option<Expr>), CompileErrors>
Trait Implementations
sourceimpl Runnable for Compiler
impl Runnable for Compiler
type Err = CompileError
type Errs = CompileErrors
const NAME: &'static str = "Erg compiler"
fn new(cfg: ErgConfig) -> Self
fn cfg(&self) -> &ErgConfig
fn finish(&mut self)
fn clear(&mut self)
fn exec(&mut self) -> Result<i32, Self::Errs>
fn eval(&mut self, src: String) -> Result<String, CompileErrors>
fn input(&self) -> &Input
fn start_message(&self) -> String
fn ps1(&self) -> String
fn ps2(&self) -> String
fn quit(&self, code: i32)
fn run(cfg: ErgConfig)
Auto Trait Implementations
impl !RefUnwindSafe for Compiler
impl !Send for Compiler
impl !Sync for Compiler
impl Unpin for Compiler
impl !UnwindSafe for Compiler
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more