Commit 4ad36206 authored by Dmitry Ivanov's avatar Dmitry Ivanov Committed by Ben Gamari

Fix parsing of And chains in BoolFormula

Parse `foo, bar, baz` into `And [foo, bar, baz]`
instead of `And [foo, And [bar, baz]]`.

Fixes #11024.

Test Plan: read and think

Reviewers: austin, bgamari, mpickering

Reviewed By: bgamari, mpickering

Subscribers: ezyang, thomie, alanz

Differential Revision: https://phabricator.haskell.org/D3139
parent 8f8016a5
......@@ -2959,9 +2959,13 @@ name_boolformula :: { LBooleanFormula (Located RdrName) }
>> return (sLL $1 $> (Or [$1,$3])) }
name_boolformula_and :: { LBooleanFormula (Located RdrName) }
: name_boolformula_atom { $1 }
| name_boolformula_atom ',' name_boolformula_and
{% aa $1 (AnnComma,$2) >> return (sLL $1 $> (And [$1,$3])) }
: name_boolformula_and_list
{ sLL (head $1) (last $1) (And ($1)) }
name_boolformula_and_list :: { [LBooleanFormula (Located RdrName)] }
: name_boolformula_atom { [$1] }
| name_boolformula_atom ',' name_boolformula_and_list
{% aa $1 (AnnComma, $2) >> return ($1 : $3) }
name_boolformula_atom :: { LBooleanFormula (Located RdrName) }
: '(' name_boolformula ')' {% ams (sLL $1 $> (Parens $2)) [mop $1,mcp $3] }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment