diff options
| author | aarne <unknown> | 2003-10-01 12:46:44 +0000 |
|---|---|---|
| committer | aarne <unknown> | 2003-10-01 12:46:44 +0000 |
| commit | c985dab565416251d9973f5b3bafe4d9d205b249 (patch) | |
| tree | ada69513d8a20338af8058d35ce2bc75e5495d4b /src/GF/Source/PrintGF.hs | |
| parent | 8ed7749eb674e3afe4485cfb3d4d50485a2cf097 (diff) | |
Putting def definitions in place.
Diffstat (limited to 'src/GF/Source/PrintGF.hs')
| -rw-r--r-- | src/GF/Source/PrintGF.hs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/GF/Source/PrintGF.hs b/src/GF/Source/PrintGF.hs index 9d71dfe6e..fbb5afafa 100644 --- a/src/GF/Source/PrintGF.hs +++ b/src/GF/Source/PrintGF.hs @@ -165,7 +165,7 @@ instance Print TopDef where DefCat catdefs -> prPrec i 0 (concat [["cat"] , prt 0 catdefs]) DefFun fundefs -> prPrec i 0 (concat [["fun"] , prt 0 fundefs]) DefDef defs -> prPrec i 0 (concat [["def"] , prt 0 defs]) - DefData pardefs -> prPrec i 0 (concat [["data"] , prt 0 pardefs]) + DefData datadefs -> prPrec i 0 (concat [["data"] , prt 0 datadefs]) DefTrans flagdefs -> prPrec i 0 (concat [["transfer"] , prt 0 flagdefs]) DefPar pardefs -> prPrec i 0 (concat [["param"] , prt 0 pardefs]) DefOper defs -> prPrec i 0 (concat [["oper"] , prt 0 defs]) @@ -199,6 +199,24 @@ instance Print FunDef where [x] -> (concat [prt 0 x , [";"]]) x:xs -> (concat [prt 0 x , [";"] , prt 0 xs]) +instance Print DataDef where + prt i e = case e of + DataDef id dataconstrs -> prPrec i 0 (concat [prt 0 id , ["="] , prt 0 dataconstrs]) + + prtList es = case es of + [x] -> (concat [prt 0 x , [";"]]) + x:xs -> (concat [prt 0 x , [";"] , prt 0 xs]) + +instance Print DataConstr where + prt i e = case e of + DataId id -> prPrec i 0 (concat [prt 0 id]) + DataQId id0 id -> prPrec i 0 (concat [prt 0 id0 , ["."] , prt 0 id]) + + prtList es = case es of + [] -> (concat []) + [x] -> (concat [prt 0 x]) + x:xs -> (concat [prt 0 x , ["|"] , prt 0 xs]) + instance Print ParDef where prt i e = case e of ParDef id parconstrs -> prPrec i 0 (concat [prt 0 id , ["="] , prt 0 parconstrs]) |
