diff options
| author | kr_angelov <kr_angelov@gmail.com> | 2006-12-28 16:35:16 +0000 |
|---|---|---|
| committer | kr_angelov <kr_angelov@gmail.com> | 2006-12-28 16:35:16 +0000 |
| commit | 48b4e3de1dd02a9956a7a051ea5c44fb24b6130a (patch) | |
| tree | 292dd64ddffd9feb9f0eef12c0f72eb56a5171cf /src/GF/Canon/GFCC/PrintGFCC.hs | |
| parent | 46c8026b9d7e5f6d061b7dd340bfeb4a012b07c8 (diff) | |
simplify GFCC syntax
Diffstat (limited to 'src/GF/Canon/GFCC/PrintGFCC.hs')
| -rw-r--r-- | src/GF/Canon/GFCC/PrintGFCC.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/GF/Canon/GFCC/PrintGFCC.hs b/src/GF/Canon/GFCC/PrintGFCC.hs index b8a98532e..1ef7cfbe3 100644 --- a/src/GF/Canon/GFCC/PrintGFCC.hs +++ b/src/GF/Canon/GFCC/PrintGFCC.hs @@ -69,6 +69,10 @@ prPrec :: Int -> Int -> Doc -> Doc prPrec i j = if j<i then parenth else id +instance Print Int where + prt _ x = doc (shows x) + + instance Print Integer where prt _ x = doc (shows x) @@ -153,7 +157,8 @@ instance Print Term where R terms -> prPrec i 0 (concatD [doc (showString "[") , prt 0 terms , doc (showString "]")]) P term0 term -> prPrec i 0 (concatD [doc (showString "(") , prt 0 term0 , doc (showString "!") , prt 0 term , doc (showString ")")]) S terms -> prPrec i 0 (concatD [doc (showString "(") , prt 0 terms , doc (showString ")")]) - K tokn -> prPrec i 0 (concatD [prt 0 tokn]) + KS str -> prPrec i 0 (concatD [prt 0 str]) + KP strs variants -> prPrec i 0 (concatD [doc (showString "[") , doc (showString "pre") , prt 0 strs , doc (showString "[") , prt 0 variants , doc (showString "]") , doc (showString "]")]) V n -> prPrec i 0 (concatD [doc (showString "$") , prt 0 n]) C n -> prPrec i 0 (concatD [prt 0 n]) F cid -> prPrec i 0 (concatD [prt 0 cid]) @@ -169,11 +174,6 @@ instance Print Term where [x] -> (concatD [prt 0 x]) x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) -instance Print Tokn where - prt i e = case e of - KS str -> prPrec i 0 (concatD [prt 0 str]) - KP strs variants -> prPrec i 0 (concatD [doc (showString "[") , doc (showString "pre") , prt 0 strs , doc (showString "[") , prt 0 variants , doc (showString "]") , doc (showString "]")]) - instance Print Variant where prt i e = case e of |
