2 ms·
The post shows how parsing functions call each other so it isn't really so far off: fn parse_money(&mut self) -> ParseResult<MoneyNode> { let currency =
by eatonphil 5y ago
The post shows how parsing functions call each other so it isn't really so far off:
fn parse_money(&mut self) -> ParseResult<MoneyNode> {
let currency = self.parse_currency_symbol()?;
let amount = self.parse_amount()?;
return Ok(MoneyNode {
currency,
amount
});
}
- KptMarchewa 5y agoThat code could be copied directly from some real-world examples - sqlparser-rs code looks pretty much exactly the same. https://github.com/sqlparser-rs/sqlparser-rs https://github.com/sqlparser-rs/sqlparser-rs