syn icon indicating copy to clipboard operation
syn copied to clipboard

Consider inserting invisible groups, rather than parens, when applying grouping for precedence

Open dtolnay opened this issue 1 year ago • 1 comments

As of https://github.com/dtolnay/syn/pull/1659, we are currently using code like token::Paren::default().surround(tokens, |tokens| e.to_tokens(tokens)) .

But maybe a better behavior would be token::Group::default().surround(...).

dtolnay avatar May 16 '24 06:05 dtolnay

I think using parens still is better because you may want to dump the tokens to a file, which breaks with invisible delimiters afaik

programmerjake avatar Aug 15 '24 00:08 programmerjake