We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eb0041b commit 28fa618Copy full SHA for 28fa618
2 files changed
.DS_Store
6 KB
src/lib.rs
@@ -62,6 +62,16 @@ pub fn parse_expression(expr: &str) -> Result<ExprAST> {
62
parser::Parser::new(expr)?.parse_stmt()
63
}
64
65
+pub fn parse_expression_to_bytecode(expr: &str) -> Result<bytecode::Program> {
66
+ init();
67
+ let ast = parser::Parser::new(expr)?.parse_stmt()?;
68
+ bytecode::compile_expression(&ast)
69
+}
70
+
71
+pub fn execute_program(program: &bytecode::Program, ctx: &mut Context) -> Result<value::Value> {
72
+ bytecode::execute_program(program, ctx)
73
74
75
/// ## Usage
76
///
77
/// You can register some inner functions in advance via this method
0 commit comments