add comments, fix fc on an error, add constructor for U
This commit is contained in:
@@ -889,11 +889,9 @@ buildCase ctx prob scnm scty (dcName, arity, ty) = do
|
||||
|
||||
makeConstr : List Bind -> List Pattern -> M (List (String, Pattern))
|
||||
makeConstr [] [] = pure $ []
|
||||
-- would need M in here to throw, and I'm building stuff as I go, I suppose I could <$>
|
||||
makeConstr [] (pat :: pats) = error ctx.ctxFC "too many patterns"
|
||||
makeConstr [] (pat :: pats) = error (getFC pat) "too many patterns"
|
||||
makeConstr ((MkBind nm Implicit x) :: xs) [] = pure $ (nm, PatWild emptyFC Implicit) :: !(makeConstr xs [])
|
||||
makeConstr ((MkBind nm Auto x) :: xs) [] = pure $ (nm, PatWild emptyFC Auto) :: !(makeConstr xs [])
|
||||
-- FIXME need a proper error, but requires wiring M three levels down
|
||||
makeConstr ((MkBind nm Explicit x) :: xs) [] = error ctx.ctxFC "not enough patterns"
|
||||
makeConstr ((MkBind nm Explicit x) :: xs) (pat :: pats) =
|
||||
if getIcit pat == Explicit
|
||||
|
||||
@@ -55,8 +55,9 @@ writeSource fn = do
|
||||
docs <- compile
|
||||
let src = unlines $
|
||||
[ "\"use strict\";"
|
||||
, "const PiType = (h0, h1) => ({ tag: \"PiType\", h0, h1 })" ]
|
||||
++ map (render 90) docs
|
||||
, "const PiType = (h0, h1) => ({ tag: \"PiType\", h0, h1 })"
|
||||
, "const U = { tag: \"U\" };"
|
||||
] ++ map (render 90) docs
|
||||
Right _ <- writeFile fn src
|
||||
| Left err => fail (show err)
|
||||
Right _ <- chmodRaw fn 493 | Left err => fail (show err)
|
||||
|
||||
Reference in New Issue
Block a user