summaryrefslogtreecommitdiff
path: root/src/GF/Compile
diff options
context:
space:
mode:
authorbjorn <bjorn@bringert.net>2008-09-30 09:31:31 +0000
committerbjorn <bjorn@bringert.net>2008-09-30 09:31:31 +0000
commit8716e48c21a61c8db9cae4a74fc1c3faa9ff085e (patch)
treee4b34dcf3c5a859efd3850792351dc09582935c4 /src/GF/Compile
parent664bebf5cee4b79aed0fc5a32c8281397db29927 (diff)
pgf-pretty: remove single field record lincat hack. handle f "" (S []) correctly.
Diffstat (limited to 'src/GF/Compile')
-rw-r--r--src/GF/Compile/PGFPretty.hs3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/GF/Compile/PGFPretty.hs b/src/GF/Compile/PGFPretty.hs
index ef69b710b..a9b820c1e 100644
--- a/src/GF/Compile/PGFPretty.hs
+++ b/src/GF/Compile/PGFPretty.hs
@@ -49,7 +49,6 @@ prCnc abstr name c = prAll prLinCat (lincats c) $$ prAll prLin (lins (expand c))
prLin f t = text "lin" <+> text (prCId f) <+> text "=" <+> pr 0 t
where
pr :: Int -> Term -> Doc
- pr p (R [t]) = pr p t
pr p (R ts) = text "<" <+> hsep (punctuate (text ",") (map (pr 0) ts)) <+> text ">"
pr p (P t1 t2) = prec p 3 (pr 3 t1 <> text "!" <> pr 3 t2)
pr p (S ts) = prec p 2 (hsep (punctuate (text " ++") (map (pr 2) ts)))
@@ -73,7 +72,7 @@ expand cnc = cnc { lins = Map.map (f "") (lins cnc) }
f :: String -> Term -> Term
f w (R ts) = R (map (f w) ts)
f w (P t1 t2) = P (f w t1) (f w t2)
- f w (S []) = S [K (KS w)]
+ f w (S []) = S (if null w then [] else [K (KS w)])
f w (S (t:ts)) = S (f w t : map (f "") ts)
f w (FV ts) = FV (map (f w) ts)
f w (W s t) = f (w++s) t