mirror of
https://github.com/apache/datafusion-sqlparser-rs.git
synced 2025-08-22 23:14:07 +00:00
[parser] Return error instead of panic (#316)
* [parser] return error instead of panic * Fix clippy warning * Fix cargo fmt warning
This commit is contained in:
parent
35ef0eee38
commit
56e50dccd4
3 changed files with 16 additions and 7 deletions
|
@ -883,7 +883,7 @@ impl<'a> Parser<'a> {
|
|||
}
|
||||
}
|
||||
// Can only happen if `get_next_precedence` got out of sync with this function
|
||||
_ => panic!("No infix parser for token {:?}", tok),
|
||||
_ => parser_err!(format!("No infix parser for token {:?}", tok)),
|
||||
}
|
||||
} else if Token::DoubleColon == tok {
|
||||
self.parse_pg_cast(expr)
|
||||
|
@ -897,7 +897,7 @@ impl<'a> Parser<'a> {
|
|||
self.parse_map_access(expr)
|
||||
} else {
|
||||
// Can only happen if `get_next_precedence` got out of sync with this function
|
||||
panic!("No infix parser for token {:?}", tok)
|
||||
parser_err!(format!("No infix parser for token {:?}", tok))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2202,8 +2202,8 @@ impl<'a> Parser<'a> {
|
|||
Ok(Query {
|
||||
with,
|
||||
body,
|
||||
limit,
|
||||
order_by,
|
||||
limit,
|
||||
offset,
|
||||
fetch,
|
||||
})
|
||||
|
@ -2414,8 +2414,8 @@ impl<'a> Parser<'a> {
|
|||
top,
|
||||
projection,
|
||||
from,
|
||||
selection,
|
||||
lateral_views,
|
||||
selection,
|
||||
group_by,
|
||||
cluster_by,
|
||||
distribute_by,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue