mirror of
https://github.com/edwinb/Idris2-boot.git
synced 2025-01-06 21:28:25 +03:00
Lift ! out of 'let' in do blocks
This commit is contained in:
parent
cf27bbed66
commit
8d8d281fb4
@ -388,10 +388,13 @@ mutual
|
|||||||
(PatClause fc bpat rest'
|
(PatClause fc bpat rest'
|
||||||
:: alts')))
|
:: alts')))
|
||||||
expandDo side ps topfc (DoLet fc n rig ty tm :: rest)
|
expandDo side ps topfc (DoLet fc n rig ty tm :: rest)
|
||||||
= do tm' <- desugar side ps tm
|
= do b <- newRef Bang initBangs
|
||||||
|
tm' <- desugarB side ps tm
|
||||||
ty' <- desugar side ps ty
|
ty' <- desugar side ps ty
|
||||||
rest' <- expandDo side ps topfc rest
|
rest' <- expandDo side ps topfc rest
|
||||||
pure $ ILet fc rig n ty' tm' rest'
|
let bind = ILet fc rig n ty' tm' rest'
|
||||||
|
bd <- get Bang
|
||||||
|
pure $ bindBangs (bangNames bd) bind
|
||||||
expandDo side ps topfc (DoLetPat fc pat ty tm alts :: rest)
|
expandDo side ps topfc (DoLetPat fc pat ty tm alts :: rest)
|
||||||
= do pat' <- desugar LHS ps pat
|
= do pat' <- desugar LHS ps pat
|
||||||
ty' <- desugar side ps ty
|
ty' <- desugar side ps ty
|
||||||
|
@ -159,7 +159,8 @@ mutual
|
|||||||
arg <- implicitArg fname indents
|
arg <- implicitArg fname indents
|
||||||
pure (ImpArg (fst arg) (snd arg))
|
pure (ImpArg (fst arg) (snd arg))
|
||||||
<|> if withOK q
|
<|> if withOK q
|
||||||
then do symbol "|"
|
then do continue indents
|
||||||
|
symbol "|"
|
||||||
arg <- expr (record { withOK = False} q) fname indents
|
arg <- expr (record { withOK = False} q) fname indents
|
||||||
pure (WithArg arg)
|
pure (WithArg arg)
|
||||||
else fail "| not allowed here"
|
else fail "| not allowed here"
|
||||||
|
Loading…
Reference in New Issue
Block a user