Skip to content

Commit 28fa618

Browse files
committed
面向云代理会话的 VS Code 中的检查点
1 parent eb0041b commit 28fa618

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.DS_Store

6 KB
Binary file not shown.

src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,16 @@ pub fn parse_expression(expr: &str) -> Result<ExprAST> {
6262
parser::Parser::new(expr)?.parse_stmt()
6363
}
6464

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+
6575
/// ## Usage
6676
///
6777
/// You can register some inner functions in advance via this method

0 commit comments

Comments
 (0)