Merge pull request #232 from erg-lang/split-err-msg

Split error messages
This commit is contained in:
Shunsuke Shibayama 2022-11-23 15:55:19 +09:00 committed by GitHub
commit 2caa6b6ec9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 1652 additions and 1006 deletions

View file

@ -11,7 +11,6 @@ use erg_common::error::Location;
use erg_common::option_enum_unwrap;
use erg_common::set::Set as HashSet;
use erg_common::str::Str;
use erg_common::style::THEME;
use erg_common::traits::Runnable;
use erg_common::traits::{Locational, Stream};
use erg_common::{
@ -207,16 +206,16 @@ impl ParserRunner {
pub fn parse_token_stream(&mut self, ts: TokenStream) -> Result<Module, ParserRunnerErrors> {
Parser::new(ts)
.parse()
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs, THEME))
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs))
}
pub fn parse(&mut self, src: String) -> Result<Module, ParserRunnerErrors> {
let ts = Lexer::new(Input::Str(src))
.lex()
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs, THEME))?;
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs))?;
Parser::new(ts)
.parse()
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs, THEME))
.map_err(|errs| ParserRunnerErrors::convert(self.input(), errs))
}
}