Improve tokenizer error (#347)

* Improve tokenizer error

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Add test for TokenizerError

Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
Qinxuan Chen 2021-09-10 23:33:13 +08:00 committed by GitHub
parent 10ec257e21
commit 3d6637c4f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 14 deletions

View file

@ -68,10 +68,7 @@ use IsLateral::*;
impl From<TokenizerError> for ParserError {
fn from(e: TokenizerError) -> Self {
ParserError::TokenizerError(format!(
"{} at Line: {}, Column {}",
e.message, e.line, e.col
))
ParserError::TokenizerError(e.to_string())
}
}