The Nim AST renderer should have a "strict" mode on top of the current, default behavior, to output code that is easier to parse.
Motivation
There are issues like https://github.com/nim-lang/Nim/issues/19735 which will impact performance of the renderer if fixed exhaustively. Making it opt-in makes it easier to justify.
Description
Obviously it might still be that a strict mode will not be able to output correct code in some cases (for example some identifiers are not possible without the double-backtick syntax proposed here and here). But it will still account for more cases than normal rendering would.
Abstract
The Nim AST renderer should have a "strict" mode on top of the current, default behavior, to output code that is easier to parse.
Motivation
There are issues like https://github.com/nim-lang/Nim/issues/19735 which will impact performance of the renderer if fixed exhaustively. Making it opt-in makes it easier to justify.
Description
Obviously it might still be that a strict mode will not be able to output correct code in some cases (for example some identifiers are not possible without the double-backtick syntax proposed here and here). But it will still account for more cases than normal rendering would.
Code Examples
From https://github.com/nim-lang/Nim/issues/19735:
Output:
Backwards Compatibility
No response