News for hackers. Stuff that matters.
Re:Rust for C++ programmers – part 2: control flow by pcwalton on Sunday April 20, 2014 @04:38PM (#7618397)
It would require making "expression" and "pattern" into the same nonterminal in the grammar, and then deciding afterwards whether something that was parsed was an expression or a pattern. This is sometimes called a "cover grammar" because it "covers" two distinct nonterminals. It is possible--ECMAScript 6 does it--but it's definitely a complex way to parse. It doesn't seem compatible with Rust's design goal of being easy to parse and regular, e.g. for tooling.

There are no comments on this comment yet.