Process pattern in correct order

This commit is contained in:
2024-08-07 21:49:35 -07:00
parent 9c5bdf5983
commit 13dd77345c
5 changed files with 92 additions and 44 deletions

View File

@@ -12,15 +12,20 @@ data JSExp : Type where
data JSStmt : Type where
-- Need to sort out
compile : Nat -> Tm -> Doc
-- Oh, we don't have local names...
compile l (Bnd k) = text "_\{show k}"
compile l (Bnd _ k) = text "_\{show k}"
-- this is tied to Bnd
-- And we probably want `{...}` with statements...
compile l (Lam str t) = text "(_\{show l}) => " <+> compile (S l) t
compile l (Ref str mt) = text str
compile l (App t u) = compile l t <+> "(" <+> compile l u <+> ")"
compile l (Lam _ str t) = text "(_\{show l}) => " <+> compile (S l) t
compile l (Ref _ str mt) = text str
compile l (App _ t u) = compile l t <+> "(" <+> compile l u <+> ")"
compile l U = "undefined"
compile l (Pi str icit t u) = "undefined"
compile l (Meta k) = text "ZONKME \{show k}"
compile l (U _) = "undefined"
compile l (Pi _ str icit t u) = "undefined"
compile l (Meta _ k) = text "ZONKME \{show k}"
compile l (Case fc tm alts) = ?rhs_8