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 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§
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 new(cfg: ErgConfig) -> Self
fn cfg(&self) -> &ErgConfig
fn finish(&mut self)
source§fn initialize(&mut self)
fn initialize(&mut self)
Erase all but immutable information.