Struct erg_compiler::transpile::Transpiler
source · pub struct Transpiler {
pub cfg: ErgConfig,
/* private fields */
}
Expand description
Generates a PyScript
from an String or other File inputs.
Fields§
§cfg: ErgConfig
Implementations§
source§impl Transpiler
impl Transpiler
pub fn new(cfg: ErgConfig) -> Self
pub fn new_with_cache( cfg: ErgConfig, mod_name: Str, shared: SharedCompilerResource ) -> Self
pub fn transpile( &mut self, src: String, mode: &str ) -> Result<CompleteArtifact<TranspiledFile>, ErrorArtifact>
pub fn transpile_from_ast( &mut self, ast: AST, mode: &str ) -> Result<CompleteArtifact<TranspiledFile>, ErrorArtifact>
pub fn transpile_module( &mut self ) -> Result<CompleteArtifact<TranspiledFile>, ErrorArtifact>
pub fn pop_mod_ctx(&mut self) -> Option<ModuleContext>
pub fn dir(&mut self) -> HashMap<&VarName, &VarInfo>
pub fn get_receiver_ctx(&self, receiver_name: &str) -> Option<&Context>
pub fn get_var_info(&self, name: &str) -> Option<(&VarName, &VarInfo)>
Trait Implementations§
source§impl BuildRunnable<TranspiledFile> for Transpiler
impl BuildRunnable<TranspiledFile> for Transpiler
fn build_module(&mut self) -> Result<CompleteArtifact<T>, IncompleteArtifact<T>>
source§impl Buildable<TranspiledFile> for Transpiler
impl Buildable<TranspiledFile> for Transpiler
fn inherit(cfg: ErgConfig, shared: SharedCompilerResource) -> Self
fn inherit_with_name( cfg: ErgConfig, mod_name: Str, shared: SharedCompilerResource ) -> Self
fn build( &mut self, src: String, mode: &str ) -> Result<CompleteArtifact<TranspiledFile>, IncompleteArtifact<TranspiledFile>>
fn build_from_ast( &mut self, ast: AST, mode: &str ) -> Result<CompleteArtifact<TranspiledFile>, IncompleteArtifact<TranspiledFile>>
fn pop_context(&mut self) -> Option<ModuleContext>
fn get_context(&self) -> Option<&ModuleContext>
source§impl ContextProvider for Transpiler
impl ContextProvider for Transpiler
source§impl Debug for Transpiler
impl Debug for Transpiler
source§impl Default for Transpiler
impl Default for Transpiler
source§impl Runnable for Transpiler
impl Runnable for Transpiler
type Err = CompileError
type Errs = CompileErrors
const NAME: &'static str = "Erg transpiler"
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 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 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 !Freeze for Transpiler
impl !RefUnwindSafe for Transpiler
impl Send for Transpiler
impl Sync for Transpiler
impl Unpin for Transpiler
impl !UnwindSafe for Transpiler
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