# std.zig: resolve syntactic ambiguity · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/0cc8435a830d9d3850add163be4f12e5bd4f2f5c)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 0cc8435a830d9d3850add163be4f12e5bd4f2f5c

Requested commit: 0cc8435a830d9d3850add163be4f12e5bd4f2f5c

Commit: 0cc8435a830d9d3850add163be4f12e5bd4f2f5c

Tree: f2b11a2c14628ed80865e6336ef2237504a107a7

Author: mlugg

Committer: mlugg

## Message

```
std.zig: resolve syntactic ambiguity

The parse of `fn foo(a: switch (...) { ... })` was previously handled
incorrectly; `a` was treated as both the parameter name and a label.

The same issue exists for `for` and `while` expressions -- they should
be fixed too, and the grammar amended appropriately. This commit does
not do this: it only aims to avoid introducing regressions from labeled
switch syntax.

```

## Parents

- [5e12ca9fe3c77ce1d2a3ea1c22c4bcb6d9b2bb0c](https://git.cafe/gitcafe/zig/commit/5e12ca9fe3c77ce1d2a3ea1c22c4bcb6d9b2bb0c?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/0cc8435a830d9d3850add163be4f12e5bd4f2f5c?format=markdown)
