haskell / haskell/parsec

conflict between infix and prefix ops in `Text.Parser.Expr`

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
892
Forks
99
PR merge metrics
No merged PRs in 30d

Description

The function `buildExpressionParser` in module `Text.Parser.Expr` has a bug.
In the uncommon case where a prefix operator has lower precedence than an infix operator, such as in boolean expressions, _e.g_
- `&&` is an infix operator.
- `!` is a prefix operator of lower precedence.

The input `!a && b` is correctly parsed `Not (And a b)`, but the parser fails to parse `a && !b` (as `And a (Not b)`).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.