-
Notifications
You must be signed in to change notification settings - Fork 95
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
Concatinated .maybe statements match "" as "" instead of nil #155
Comments
Rewriting the expression as below seems to work:
|
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. |
Prompted by: trailofbits#8 When creating a new `Mechanism`, check whether the supplied `value` is an empty string. If it is, convert it to `nil` as `#to_s` has logic to avoid outputting `value` when it's nil. This works around an issue in [Parslet](kschiess/parslet#155) where the parser is returning an empty string when it should return `nil`.
Example
Actual Output
Expected Output
The text was updated successfully, but these errors were encountered: