refact: make FialedParserResult to implement std::Error:Error.

This commit is contained in:
2024-11-19 21:34:32 +08:00
parent 91c6c42a02
commit e2c4388a0c
6 changed files with 56 additions and 45 deletions

View File

@@ -78,7 +78,7 @@ fn file_lexical_parser_test() -> anyhow::Result<()> {
let context = ParserContext::new_with_str(source_file.content.as_str(), ());
let borrowed_context = context.borrow();
let (_, zero_tokens) = zero_lexical_parser(context.clone(), borrowed_context.input_slice())
.or_else(|e| Err(anyhow!("{}", e.1)))?;
.or_else(|e| Err(anyhow!("{}", e)))?;
assert_eq!(nom_tokens.len(), zero_tokens.len());