Closed postmodern closed 7 years ago
Rewriting the expression as below seems to work:
rule(:foo) {
(
(str('foo=') >> str('bar').maybe) |
(str('foo=').maybe >> str('bar'))
).maybe.as(:value)
}
Should we act on this? What could be done?
Our merging algo is a bit finnicky - in theory, we would have to complicate things to cover all cases. But in practice, the heuristics work nicely apart from a few edge cases like this one. SOO ... it's a tradeoff...
Can we add a note about this unexpected behavior somewhere? Kind of surprised me when I stumbled across this.
Example
Actual Output
Expected Output