Skip to content

Commit

Permalink
Improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
runarorama committed Aug 13, 2024
1 parent 8736c4a commit b92dede
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions parser-typechecker/src/Unison/Syntax/TermParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1072,10 +1072,8 @@ data InfixParse v
-- 2. Starting at the leftmost operator subexpression, see if the next operator
-- has higher precedence. If so, rotate the expression to the right.
-- e.g. in `a + b * c`, we first parse `(a + b) * c` then rotate to `a + (b * c)`.
-- 3. Perform the algorithm on the right-hand side if necessary.
-- e.g. in `a + b + c * d`, we have `(a + (b + c)) * d` and `* d` is the next
-- operator to consider. We rotate to `(a + ((b + c) * d))` in step 2.
-- Step 3 is to rotate the subexpression `(b + c) * d` to be `b + (c * d)`.
-- 3. Perform the algorithm on the right-hand side if necessary, as `b` might be
-- an infix expression with lower precedence than `*`.
-- 4. Proceed to the next operator to the right in the original expression and
-- repeat steps 2-3 until we reach the end.
infixAppOrBooleanOp :: forall m v. (Monad m, Var v) => TermP v m
Expand Down

0 comments on commit b92dede

Please sign in to comment.