LucaCappelletti94 commented on code in PR #2371:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2371#discussion_r3713794878


##########
src/parser/mod.rs:
##########
@@ -2531,8 +2531,47 @@ impl<'a> Parser<'a> {
         })
     }
 
+    /// Parse `XMLPARSE({ DOCUMENT | CONTENT } value)`, whose mode keyword is
+    /// carried by the single argument as a name with no operator. Neither mode
+    /// word is reserved, so both arrive as plain words rather than keywords.
+    fn parse_xmlparse_call(&mut self, name: ObjectName) -> Result<Function, 
ParserError> {
+        self.expect_token(&Token::LParen)?;
+        let is_mode = matches!(&self.peek_token_ref().token, Token::Word(word)
+            if word.quote_style.is_none()
+                && (word.value.eq_ignore_ascii_case("content")
+                    || word.value.eq_ignore_ascii_case("document")));
+        if !is_mode {
+            return self.expected_ref("CONTENT or DOCUMENT", 
self.peek_token_ref());
+        }

Review Comment:
   Done. Note the mode word is not dropped, it becomes the `name` of the 
`FunctionArg::Named`, which keeps the round trip exact.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to