From a835cf263bab61468435f2d6f059bde6bc17ff30 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 24 Oct 2011 12:53:24 +0000 Subject: [PATCH] post-cleaning of tailing pre expressions in synopsis generation --- lib/doc/MkExxTable.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/doc/MkExxTable.hs b/lib/doc/MkExxTable.hs index bcc874ac5..934b7cdef 100644 --- a/lib/doc/MkExxTable.hs +++ b/lib/doc/MkExxTable.hs @@ -70,10 +70,13 @@ prApiEx apexx = case M.toList apexx of (a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"): [l ++ ": //" ++ mkEx e ++ "//" | (l,e) <- lexx] -mkEx e = case words e of - "atomic":"term":_ -> "*" - "[]":_ -> "''" - es -> unwords (bind es) +mkEx = unwords . bind . mkE . words where + mkE e = case e of + "atomic":"term":_ -> ["*"] + "[]":_ -> ["''"] + "pre":p@('{':_):es -> init (init (drop 2 p)) : mkE es + e0:es -> e0:mkE es + _ -> e bind ws = case ws of w : "&+" : u : ws2 -> bind ((w ++ u) : ws2)