Split AST into separate files.

This commit is contained in:
Stephen Chung
2021-12-17 16:07:13 +08:00
parent b1b2c62d7d
commit c7ec27acc7
16 changed files with 2693 additions and 2614 deletions

View File

@@ -83,17 +83,15 @@ impl Engine {
.map(|f| {
f.func
.get_script_fn_def()
.expect("scripted function")
.expect("script-defined function")
.clone()
})
.collect();
let statements = std::mem::take(ast.statements_mut());
crate::optimizer::optimize_into_ast(
self,
scope,
statements,
ast.take_statements(),
#[cfg(not(feature = "no_function"))]
lib,
optimization_level,