Merge branch 'main' into feat-definitions
This commit is contained in:
@@ -222,10 +222,10 @@ impl Engine {
|
||||
self.token_mapper.as_ref().map(<_>::as_ref),
|
||||
);
|
||||
let mut state = ParseState::new(self, scope, tokenizer_control);
|
||||
let mut ast = self.parse(&mut stream.peekable(), &mut state, optimization_level)?;
|
||||
let mut _ast = self.parse(&mut stream.peekable(), &mut state, optimization_level)?;
|
||||
#[cfg(feature = "metadata")]
|
||||
ast.set_doc(state.tokenizer_control.borrow().global_comments.join("\n"));
|
||||
Ok(ast)
|
||||
_ast.set_doc(state.tokenizer_control.borrow().global_comments.join("\n"));
|
||||
Ok(_ast)
|
||||
}
|
||||
/// Compile a string containing an expression into an [`AST`],
|
||||
/// which can be used later for evaluation.
|
||||
|
@@ -2,7 +2,6 @@
|
||||
#![cfg(not(feature = "no_optimize"))]
|
||||
|
||||
use crate::{Engine, OptimizationLevel, Scope, AST};
|
||||
use std::mem;
|
||||
|
||||
impl Engine {
|
||||
/// Control whether and how the [`Engine`] will optimize an [`AST`] after compilation.
|
||||
@@ -60,7 +59,7 @@ impl Engine {
|
||||
.map(|f| f.func.get_script_fn_def().unwrap().clone())
|
||||
.collect();
|
||||
|
||||
let mut new_ast = crate::optimizer::optimize_into_ast(
|
||||
let mut _new_ast = crate::optimizer::optimize_into_ast(
|
||||
self,
|
||||
scope,
|
||||
ast.take_statements(),
|
||||
@@ -70,8 +69,8 @@ impl Engine {
|
||||
);
|
||||
|
||||
#[cfg(feature = "metadata")]
|
||||
new_ast.set_doc(mem::take(ast.doc_mut()));
|
||||
_new_ast.set_doc(std::mem::take(ast.doc_mut()));
|
||||
|
||||
new_ast
|
||||
_new_ast
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user