mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
Fix: ParserRunner::eval
parsing with default cfgs
This commit is contained in:
parent
fb3e42c57b
commit
15e7f8c5ad
2 changed files with 9 additions and 5 deletions
|
@ -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![],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue