andygrove commented on code in PR #3007:
URL: 
https://github.com/apache/datafusion-sqlparser-rs/pull/3007#discussion_r4628703947


##########
src/tokenizer.rs:
##########
@@ -2365,9 +2365,13 @@ impl<'a> Tokenizer<'a> {
     /// Tokenize an identifier or keyword, after the first char is already 
consumed.
     fn tokenize_word(&self, first_chars: impl Into<String>, chars: &mut State) 
-> String {
         let mut s = first_chars.into();
-        s.push_str(&peeking_take_while(chars, |ch| {
-            self.dialect.is_identifier_part(ch)
-        }));
+        while let Some(&ch) = chars.peek() {
+            if !self.dialect.is_identifier_part(ch) {
+                break;
+            }
+            chars.next();
+            s.push(ch);
+        }

Review Comment:
   This looks reasonable, but could this be put into a helper method such as 
`peeking_push_while(chars, &mut s, pred)`?



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