Fix: ParserRunner::eval parsing with default cfgs

This commit is contained in:
Shunsuke Shibayama 2022-08-18 02:59:55 +09:00
parent fb3e42c57b
commit 15e7f8c5ad
2 changed files with 9 additions and 5 deletions

View file

@ -159,8 +159,10 @@ impl Compiler {
pub fn compile(&mut self, src: Str, mode: &str) -> Result<CodeObj, CompileErrors> {
log!("{GREEN}[DEBUG] the compiling process has started.{RESET}");
let mut dynamic = true;
let mut parser = ParserRunner::new(self.cfg.copy());
let ast = parser.parse_from_str(src)?;
let mut cfg = self.cfg.copy();
cfg.input = Input::Str(src);
let mut parser = ParserRunner::new(cfg);
let ast = parser.parse()?;
if ast.is_empty() {
return Ok(CodeObj::empty(
vec![],