1
0
forked from GitHub/gf-core

Some pgf-pretty fixes, including note by Peter about W "apa" (S []).

This commit is contained in:
bjorn
2008-09-30 07:24:01 +00:00
parent bfcfb513f3
commit 662663ffa3

View File

@@ -52,7 +52,7 @@ prCnc abstr name c = prAll prLinCat (lincats c) $$ prAll prLin (lins (expand c))
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 (map (pr 2) ts))
pr p (S ts) = prec p 2 (hsep (punctuate (text " ++") (map (pr 2) ts)))
pr p (K (KS t)) = doubleQuotes (text t)
pr p (V i) = text ("argv_" ++ show (i+1))
pr p (C i) = text (show (i+1))
@@ -72,8 +72,8 @@ expand cnc = cnc { lins = Map.map (f "") (lins cnc) }
-- FIXME: handle KP
f :: String -> Term -> Term
f w (R ts) = R (map (f w) ts)
f "" (P t1 t2) = P (f "" t1) (f "" t2)
f w (S []) = S []
f w (P t1 t2) = P (f w t1) (f w t2)
f w (S []) = S [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