pub struct RubyBackend { /* private fields */ }Expand description
Ruby code generation backend.
Compiles LCNF function declarations to Ruby methods and bundles
them into a RubyModule.
Implementations§
Source§impl RubyBackend
impl RubyBackend
Sourcepub fn mangle_name(&mut self, name: &str) -> String
pub fn mangle_name(&mut self, name: &str) -> String
Mangle an LCNF name to a valid Ruby identifier (snake_case).
Sourcepub fn compile_decl(&mut self, decl: &LcnfFunDecl) -> Result<RubyMethod, String>
pub fn compile_decl(&mut self, decl: &LcnfFunDecl) -> Result<RubyMethod, String>
Compile an LCNF function declaration to a RubyMethod.
Sourcepub fn emit_module(decls: &[LcnfFunDecl]) -> Result<String, String>
pub fn emit_module(decls: &[LcnfFunDecl]) -> Result<String, String>
Compile a complete set of LCNF declarations to a Ruby source string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RubyBackend
impl RefUnwindSafe for RubyBackend
impl Send for RubyBackend
impl Sync for RubyBackend
impl Unpin for RubyBackend
impl UnsafeUnpin for RubyBackend
impl UnwindSafe for RubyBackend
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