parser debugging utilities + fixed paren sometimes producing unbalanced events
parser events now have a `from` field which has the source location of where the event was emitted. this location is pretty-printed when using `Debug`
This commit is contained in:
parent
c5b2eb376f
commit
084012d65f
7 changed files with 116 additions and 58 deletions
|
@ -18,7 +18,10 @@ fn parse(s: &str, f: fn(&mut Parser)) -> (Ast, NodeId) {
|
|||
f(&mut parser);
|
||||
|
||||
if !parser.diagnostics.is_empty() {
|
||||
panic!("parser emitted diagnostics: {:#?}", parser.diagnostics);
|
||||
panic!(
|
||||
"parser: {parser:#?}\nemitted diagnostics: {:#?}",
|
||||
parser.diagnostics
|
||||
);
|
||||
}
|
||||
|
||||
let mut ast = Ast::new(1024);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue