mirror of
https://github.com/erg-lang/erg.git
synced 2025-09-29 12:24:45 +00:00
Update Runnable
API types
This change allows Erg to pass information in a thread-safe manner.
This commit is contained in:
parent
c04fdcdc68
commit
14df5ce94c
8 changed files with 33 additions and 41 deletions
|
@ -194,7 +194,7 @@ impl Runnable for ParserRunner {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
fn eval(&mut self, src: Str) -> Result<String, ParserRunnerErrors> {
|
||||
fn eval(&mut self, src: String) -> Result<String, ParserRunnerErrors> {
|
||||
let ast = self.parse_with_input(src)?;
|
||||
Ok(format!("{ast}"))
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ impl ParserRunner {
|
|||
self_.parse()
|
||||
}
|
||||
|
||||
fn parse_with_input(&mut self, src: Str) -> Result<AST, ParserRunnerErrors> {
|
||||
fn parse_with_input(&mut self, src: String) -> Result<AST, ParserRunnerErrors> {
|
||||
let ts = Lexer::new(Input::Str(src))
|
||||
.lex()
|
||||
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs))?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue