Skip to content

Commit

Permalink
Merge pull request #5442 from kylegoetz/5441
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Nov 6, 2024
2 parents e663e56 + ea2586b commit 6c8000d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions parser-typechecker/src/Unison/Syntax/TermParser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,22 +1243,20 @@ verifyRelativeName' name = do

-- example:
-- (x, y) = foo
-- hd +: tl | hd < 10 = [1,2,3]
-- stuff
--
-- desugars to:
--
-- match foo with
-- (x,y) -> match [1,2,3] with
-- hd +: tl | hd < 10 -> stuff
-- (x,y) -> stuff
--
destructuringBind :: forall m v. (Monad m, Var v) => P v m (Ann, Term v Ann -> Term v Ann)
destructuringBind = do
-- We have to look ahead as far as the `=` to know if this is a bind or
-- just an action, for instance:
-- Some 42
-- (Some 42)
-- vs
-- Some 42 = List.head elems
-- (Some 42) = List.head elems
(p, boundVars) <- P.try do
(p, boundVars) <- parsePattern
let boundVars' = snd <$> boundVars
Expand Down

0 comments on commit 6c8000d

Please sign in to comment.