New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Literal brace expansion is buggy #9351
Comments
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
The behavior was introduced in #6565, which was a patch that we knew broke some things but punted on fixing them until after the 3.1 release. For what it is worth, it seems that at least some of the behavior we all agreed is buggy or out-of-spec was intentional at the time the PR was drafted, though in the comments everyone seems to mostly agree that it's wrong and should be changed. |
Thanks for linking the previous discussion. The gist is
so at least for matching braces without an enclosed comma, we should probably remove the special treatment |
After reading the previous issues, I no longer know what is the desired behavior here. (I know what I would like, but that's not the same question.) |
A while ago, a patch was added when it was observed that the majority of cases involving
{}
were accidental and intended the literal braces to be printed/evaluated rather than invoking cartesian expansion. This was then also expanded to consider{x}
wherex
is anything that doesn't contain an unescaped,
to also be taken as a literal expression and not enter a special parsing mode.I've recently discovered that this isn't done quite right and that whitespace within
{}
braces is emitted literally as if escaped rather than coalesced:I don't believe this is intentional, and even if it were, I believe it shouldn't be parsed as such. Treating
{
and}
as literal tokens at the parser level is fine, but we don't have any concepts of literal whitespace except when individually prefixed with\
or when in a quoted context. It also goes against how brace expansion handles whitespace in general:It's ok to treat
{one}
as a single, literal token but IMHO{ one }
should be treated as three separate tokens.The text was updated successfully, but these errors were encountered: