LucaCappelletti94 opened a new pull request, #2541: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2541
This PR ensures prefix `!` operators render with a separating space when immediately followed by an expression starting with an operator character, and replaces `starts_with_operator_char`'s formatting sink with an iterative, non-recursive AST traversal. When displaying nested unary `!` operators or `!` followed by another operator (`!`, `~`, `-`, etc.), omitting spaces caused tokens to fuse into multi-character operators like `!!` or `!~`, altering the parsed AST or breaking re-parsing: ```sql -- Before: SET eaac_cion = ! !o; -- Displayed as: SET eaac_cion = !!o (re-parsed as postfix factorial) -- 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]
