@@ -5320,12 +5320,7 @@ impl<'a> Parser<'a> {
5320
5320
&& self.parse_keyword(Keyword::COMMENT)
5321
5321
{
5322
5322
self.expect_token(&Token::Eq)?;
5323
- let next_token = self.next_token();
5324
- match next_token.token {
5325
- Token::SingleQuotedString(str) => Some(str),
5326
- Token::DollarQuotedString(str) => Some(str.value),
5327
- _ => self.expected("string literal", next_token)?,
5328
- }
5323
+ Some(self.parse_comment_value()?)
5329
5324
} else {
5330
5325
None
5331
5326
};
@@ -6926,12 +6921,7 @@ impl<'a> Parser<'a> {
6926
6921
pub fn parse_optional_inline_comment(&mut self) -> Result<Option<CommentDef>, ParserError> {
6927
6922
let comment = if self.parse_keyword(Keyword::COMMENT) {
6928
6923
let has_eq = self.consume_token(&Token::Eq);
6929
- let next_token = self.next_token();
6930
- let comment = match next_token.token {
6931
- Token::SingleQuotedString(str) => str,
6932
- Token::DollarQuotedString(str) => str.value,
6933
- _ => self.expected("comment", next_token)?,
6934
- };
6924
+ let comment = self.parse_comment_value()?;
6935
6925
Some(if has_eq {
6936
6926
CommentDef::WithEq(comment)
6937
6927
} else {
@@ -6943,6 +6933,16 @@ impl<'a> Parser<'a> {
6943
6933
Ok(comment)
6944
6934
}
6945
6935
6936
+ fn parse_comment_value(&mut self) -> Result<String, ParserError> {
6937
+ let next_token = self.next_token();
6938
+ let value = match next_token.token {
6939
+ Token::SingleQuotedString(str) => str,
6940
+ Token::DollarQuotedString(str) => str.value,
6941
+ _ => self.expected("string literal", next_token)?,
6942
+ };
6943
+ Ok(value)
6944
+ }
6945
+
6946
6946
pub fn parse_optional_procedure_parameters(
6947
6947
&mut self,
6948
6948
) -> Result<Option<Vec<ProcedureParam>>, ParserError> {
0 commit comments