mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-10-27 08:53:18 -06:00
the type checker may change the arity of an equation, so we handle it differently
This commit is contained in:
1 parent
14b4e82067
commit
3f35d779f1
16 files changed
+77
-79
No files matched your search
@@ -93,17 +93,16 @@ ppJudgement q (id, AbsCat pcont ) =
|
||||
(case pcont of
|
||||
Just (L _ cont) -> hsep (map (ppDecl q) cont)
|
||||
Nothing -> empty) <+> ';'
|
||||
ppJudgement q (id, AbsFun ptype _ pexp poper) =
|
||||
ppJudgement q (id, AbsFun ptype pexp) =
|
||||
let kind | isNothing pexp = "data"
|
||||
| poper == Just False = "oper"
|
||||
| otherwise = "fun"
|
||||
in
|
||||
(case ptype of
|
||||
Just (L _ typ) -> kind <+> id <+> ':' <+> ppTerm q 0 typ <+> ';'
|
||||
Nothing -> empty) $$
|
||||
(case pexp of
|
||||
Just [] -> empty
|
||||
Just eqs -> "def" <+> vcat [id <+> hsep (map (ppPatt q 2) ps) <+> '=' <+> ppTerm q 0 e <+> ';' | L _ (ps,e) <- eqs]
|
||||
Just (_,[]) -> empty
|
||||
Just (_,eqs) -> "def" <+> vcat [id <+> hsep (map (ppPatt q 2) ps) <+> '=' <+> ppTerm q 0 e <+> ';' | L _ (ps,e) <- eqs]
|
||||
Nothing -> empty)
|
||||
ppJudgement q (id, ResParam pparams _) =
|
||||
"param" <+> id <+>
|
||||
|
||||
Reference in new issue
Block a user