mirror of
https://github.com/idris-lang/Idris2.git
synced 2024-11-28 11:05:17 +03:00
commit
80f4ced386
2
.github/workflows/ci-full-bootstrap.yml
vendored
2
.github/workflows/ci-full-bootstrap.yml
vendored
@ -2,7 +2,7 @@ name: Idris bootstrap
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- '*'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
|
|
||||||
|
@ -54,14 +54,17 @@ genName =
|
|||||||
pure $ MN "imp_gen" i
|
pure $ MN "imp_gen" i
|
||||||
|
|
||||||
mutual
|
mutual
|
||||||
|
ifThenElse : Bool -> a -> a -> a
|
||||||
|
ifThenElse True t e = t
|
||||||
|
ifThenElse False t e = e
|
||||||
|
|
||||||
pairToReturn : (toReturn : Bool) -> (ImperativeStatement, ImperativeExp) ->
|
pairToReturn : (toReturn : Bool) -> (ImperativeStatement, ImperativeExp) ->
|
||||||
Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp))
|
Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp))
|
||||||
pairToReturn False (s, e) = pure (s, e)
|
pairToReturn False (s, e) = pure (s, e)
|
||||||
pairToReturn True (s, e) = pure $ s <+> ReturnStatement e
|
pairToReturn True (s, e) = pure $ s <+> ReturnStatement e
|
||||||
|
|
||||||
expToReturn : (toReturn : Bool) -> ImperativeExp ->
|
expToReturn : (toReturn : Bool) -> ImperativeExp ->
|
||||||
Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp))
|
Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp))
|
||||||
expToReturn False e = pure $ (DoNothing, e)
|
expToReturn False e = pure $ (DoNothing, e)
|
||||||
expToReturn True e = pure $ ReturnStatement e
|
expToReturn True e = pure $ ReturnStatement e
|
||||||
|
|
||||||
@ -78,7 +81,7 @@ mutual
|
|||||||
pure (concat (map fst a), map snd a)
|
pure (concat (map fst a), map snd a)
|
||||||
|
|
||||||
impExp : {auto c : Ref Imps ImpSt} -> (toReturn : Bool) -> NamedCExp ->
|
impExp : {auto c : Ref Imps ImpSt} -> (toReturn : Bool) -> NamedCExp ->
|
||||||
Core (if toReturn then ImperativeStatement else (ImperativeStatement, ImperativeExp))
|
Core (ifThenElse toReturn ImperativeStatement (ImperativeStatement, ImperativeExp))
|
||||||
impExp toReturn (NmLocal fc n) = expToReturn toReturn $ IEVar n
|
impExp toReturn (NmLocal fc n) = expToReturn toReturn $ IEVar n
|
||||||
impExp toReturn (NmRef fc n) = expToReturn toReturn $ IEVar n
|
impExp toReturn (NmRef fc n) = expToReturn toReturn $ IEVar n
|
||||||
impExp toReturn (NmLam fc n e) = expToReturn toReturn $ IELambda [n] !(impExp True e)
|
impExp toReturn (NmLam fc n e) = expToReturn toReturn $ IELambda [n] !(impExp True e)
|
||||||
|
Loading…
Reference in New Issue
Block a user