aharpervc commented on code in PR #1834: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/1834#discussion_r2069458988
########## src/parser/mod.rs: ########## @@ -15095,14 +15099,28 @@ impl<'a> Parser<'a> { let name = self.parse_object_name(false)?; let params = self.parse_optional_procedure_parameters()?; self.expect_keyword_is(Keyword::AS)?; - self.expect_keyword_is(Keyword::BEGIN)?; - let statements = self.parse_statements()?; - self.expect_keyword_is(Keyword::END)?; + + let begin_token: AttachedToken = self + .expect_keyword(Keyword::BEGIN) + .map(AttachedToken) + .unwrap_or_else(|_| AttachedToken::empty()); + let statements = self.parse_statement_list(&[Keyword::END])?; + let end_token = match &begin_token.0.token { + Token::Word(w) if w.keyword == Keyword::BEGIN => { + AttachedToken(self.expect_keyword(Keyword::END)?) + } + _ => AttachedToken::empty(), + }; Review Comment: Could also do it like this: https://github.com/apache/datafusion-sqlparser-rs/pull/1810/files#diff-6f6a082c3ddfc1f16cc4a455e3e2e2d2508f77b682ab18cabee69471bbb3edb3R244-R260, not sure which is best -- 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