mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-09 04:59:31 -06:00
Some pgf-pretty fixes, including note by Peter about W "apa" (S []).
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user