improve errors location (#23)

Signed-off-by: eric-therond <eric.therond.fr@gmail.com>
This commit is contained in:
eric-therond
2023-09-27 18:41:30 +02:00
committed by GitHub
parent b7420aceba
commit 2ba718ba72
4 changed files with 33 additions and 18 deletions

View File

@@ -99,7 +99,7 @@ impl<'source> Parser<'source> {
}
Expr::Var(v) => comps.push(v.clone()),
Expr::String(s) => comps.push(s.clone()),
_ => bail!("not a simple ref"),
_ => bail!("internal error: not a simple ref"),
}
Ok(())
}
@@ -252,7 +252,7 @@ impl<'source> Parser<'source> {
_ => {
// Not a comprehension. Restore state.
*self = state;
bail!("internal - not a compr");
bail!("internal error: not a compr");
}
};
@@ -268,7 +268,7 @@ impl<'source> Parser<'source> {
// No progress was made in parsing the query.
// Restore state and try parsing as set, array or object.
*self = state;
bail!("internal - not a compr");
bail!("internal error: not a compr");
}
Err(err) => Err(err),
}