iffyio commented on code in PR #2034:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/2034#discussion_r2773722986


##########
src/tokenizer.rs:
##########
@@ -980,7 +1036,7 @@ impl<'a> Tokenizer<'a> {
 
     /// Get the next token or return None
     fn next_token(
-        &self,
+        &mut self,

Review Comment:
   ```suggestion
           &self,
   ```
   the `mut` ref doesn't seem like it's being used?



##########
src/tokenizer.rs:
##########
@@ -4218,6 +4273,47 @@ mod tests {
                 Token::Whitespace(Whitespace::Space),
                 Token::make_word("y", None),
             ],
-        )
+        );
+    }
+
+    #[test]
+    fn tokenize_multiline_comment_with_comment_hint() {
+        let sql = String::from("0/*! word */1");
+
+        let dialect = MySqlDialect {};
+        let tokens = Tokenizer::new(&dialect, &sql).tokenize().unwrap();
+        let expected = vec![
+            Token::Number("0".to_string(), false),
+            Token::Word(Word {
+                value: "word".to_string(),
+                quote_style: None,
+                keyword: Keyword::NoKeyword,
+            }),
+            Token::Number("1".to_string(), false),
+        ];
+        compare(expected, tokens);
+    }
+
+    #[test]
+    fn tokenize_multiline_comment_with_comment_hint_and_version() {
+        let sql_multi = String::from("0 /*!50110 KEY_BLOCK_SIZE = 1024*/ 1");

Review Comment:
   can we add a similar test cases where the comment has an empty hint? e.g.
   ```
   0 /*!50110 */
   0 /*!*/
   0 /*!   */
   ```



##########
src/tokenizer.rs:
##########
@@ -2227,13 +2283,12 @@ impl<'a> Tokenizer<'a> {
     }
 
     fn tokenize_multiline_comment(
-        &self,
+        &mut self,

Review Comment:
   ```suggestion
           &self,
   ```
   similarly, looks unused?



-- 
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