iffyio commented on code in PR #1769: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1769#discussion_r2004872907
########## src/parser/mod.rs: ########## @@ -2403,7 +2404,7 @@ impl<'a> Parser<'a> { } } - pub fn parse_substring_expr(&mut self) -> Result<Expr, ParserError> { + pub fn parse_substring_expr(&mut self, shorthand: bool) -> Result<Expr, ParserError> { Review Comment: would it make sense to change this function to include parsing the keyword? thinking in order to avoid the flag as a parameter and it would better suit the function definition to avoid the split parsing ```rust pub fn parse_substring_expr(&mut self, shorthand: bool) -> Result<Expr, ParserError> { let shorthand = self.parse_one_of_keywords(SUBSTR SUBSTRING) { }; // ... } ``` on the caller side would do ```rust Keyword::SUBSTR | Keyword::SUBSTRING => { self.prev_token() self.parse_substring_expr() } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: github-unsubscr...@datafusion.apache.org For additional commands, e-mail: github-h...@datafusion.apache.org