diff options
| author | aarne <aarne@cs.chalmers.se> | 2006-10-07 14:08:58 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2006-10-07 14:08:58 +0000 |
| commit | f9cc79eba6f12a5306987478ec99c4d1dae72863 (patch) | |
| tree | 2efab0251feeaf7afa6029e3636df1747af30588 /src/GF/Canon/GFCC/PrintGFCC.hs | |
| parent | 2f284deb1ce3071b86efcabb5e57028cc5d2c52f (diff) | |
slight change in gfcc syntax and evaluation
Diffstat (limited to 'src/GF/Canon/GFCC/PrintGFCC.hs')
| -rw-r--r-- | src/GF/Canon/GFCC/PrintGFCC.hs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/GF/Canon/GFCC/PrintGFCC.hs b/src/GF/Canon/GFCC/PrintGFCC.hs index 65f2520ed..86690e9ac 100644 --- a/src/GF/Canon/GFCC/PrintGFCC.hs +++ b/src/GF/Canon/GFCC/PrintGFCC.hs @@ -30,7 +30,7 @@ render d = rend 0 (map ($ "") $ d []) "" where t :ts -> space t . rend i ts _ -> id new i = showChar '\n' . replicateS (2*i) (showChar ' ') . dropWhile isSpace - space t = showString t . (\s -> if null s then "" else (' ':s)) + space t = showString t . id ----(\s -> if null s then "" else (' ':s)) parenth :: Doc -> Doc parenth ss = doc (showChar '(') . ss . doc (showChar ')') @@ -82,13 +82,14 @@ instance Print CId where prt _ (CId i) = doc (showString i) prtList es = case es of [] -> (concatD []) - x:xs -> (concatD [prt 0 x , prt 0 xs]) + [x] -> (concatD [prt 0 x]) + x:xs -> (concatD [prt 0 x , doc (showString ",") , prt 0 xs]) instance Print Grammar where prt i e = case e of - Grm header abstract concretes -> prPrec i 0 (concatD [prt 0 header , doc (showString ";") , prt 0 abstract , doc (showString ";") , prt 0 concretes , doc (showString ";")]) + Grm header abstract concretes -> prPrec i 0 (concatD [prt 0 header , doc (showString ";") , prt 0 abstract , doc (showString ";") , prt 0 concretes]) instance Print Header where @@ -98,7 +99,7 @@ instance Print Header where instance Print Abstract where prt i e = case e of - Abs absdefs -> prPrec i 0 (concatD [doc (showString "abstract") , doc (showString "{") , prt 0 absdefs , doc (showString "}") , doc (showString ";")]) + Abs absdefs -> prPrec i 0 (concatD [doc (showString "abstract") , doc (showString "{") , prt 0 absdefs , doc (showString "}")]) instance Print Concrete where @@ -152,7 +153,7 @@ instance Print Atom where instance Print Term where prt i e = case e of R terms -> prPrec i 0 (concatD [doc (showString "[") , prt 0 terms , doc (showString "]")]) - P term0 term -> prPrec i 0 (concatD [prt 0 term0 , doc (showString "[") , prt 0 term , 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]) V n -> prPrec i 0 (concatD [doc (showString "$") , prt 0 n]) @@ -161,6 +162,7 @@ instance Print Term where FV terms -> prPrec i 0 (concatD [doc (showString "[|") , prt 0 terms , doc (showString "|]")]) W str term -> prPrec i 0 (concatD [doc (showString "(") , prt 0 str , doc (showString "+") , prt 0 term , doc (showString ")")]) RP term0 term -> prPrec i 0 (concatD [doc (showString "(") , prt 0 term0 , doc (showString "@") , prt 0 term , doc (showString ")")]) + TM -> prPrec i 0 (concatD [doc (showString "?")]) prtList es = case es of [] -> (concatD []) |
