Closed lysnikolaou closed 4 years ago
+1 on the test fix too.
How did you find this?
I was investigating the Travis failures from #213, which all were related to this.
Also, eventually this may point to some possible relaxation of the grammar? Or would there be some ambiguity that PEG resolves by taking the first match?
What do you mean relaxation of the grammar?
Relaxation: turn e.g. disjunction into expression. But in this case probably there’s a reason.
Relaxation: turn e.g. disjunction into expression.
But doesn't this PR then do the opposite of relaxation?
Indeed, but presumably that to match the old parser.
I was hypothesizing that using pegen will allow us to see some restrictions in the grammar and let us relax them. Though on second thought probably not this case.
For example, pegen currently accepts the invalid
(a for a in lambda: b)
.I found this out, while investigating the Travis failures in #213. This also stresses the need for testing with invalid input.