shuvamk commented on PR #2424: URL: https://github.com/apache/datafusion-sqlparser-rs/pull/2424#issuecomment-5225673232
Good catch — narrowed it. A space is now inserted only where the operator's glyph and the operand's leading glyph would tokenize as a single token, so `++a`, `+@a`, `!!~a` and `-NOT a` all print unchanged. (`+` and `!!` are `consume_and_return` in the tokenizer, so they never absorb what follows; a keyword operand can't merge either.) I swept every prefix-operator pair across all dialects before and after the change and the set of round-trip breaks is identical, so the narrowing costs no coverage. It does leave two cosmetic spaces, `SELECT - !a` and `SELECT ~ !a`. Those pairs do merge into a Postgres custom operator, and they're only unreachable because `BangNot` parses on Hive/Databricks alone — I'd rather not have `Display` encode that coincidence, but it's one token to exclude `BangNot` if you want it exactly minimal. Your four cases are pinned in `parse_adjacent_unary_ops_that_do_not_combine` and `parse_adjacent_pg_unary_ops_that_do_not_combine`. -- 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]
