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


##########
src/parser/mod.rs:
##########
@@ -12904,6 +12904,9 @@ impl<'a> Parser<'a> {
         let _guard = self.recursion_counter.try_decrease()?;
 
         let dialect = self.dialect;
+        if let Some(custom) = self.maybe_parse(|p| 
p.parse_type_with_signed_modifier())? {

Review Comment:
   So first of all, thank you for pointing out the discarded error allocation. 
Now `supports_signed_type_modifier()` is checked before anything else and 
replaces `maybe_parse` with a non-allocating peek, so other dialects pay one 
flag call.
   
   I kept the flag because `supports_*` methods are preferably for grammar, and 
`GenericDialect` can enable them, which a hook in `SQLiteDialect` would not 
allow. `parse_optional_type_modifiers` rejects signs and has no two-modifier 
limit, so reusing it would change shared behaviour.



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