mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
post-cleaning of tailing pre expressions in synopsis generation
This commit is contained in:
@@ -70,10 +70,13 @@ prApiEx apexx = case M.toList apexx of
|
|||||||
(a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"):
|
(a,e):lexx -> (a ++ ": ``" ++ unwords (words e) ++ "``"):
|
||||||
[l ++ ": //" ++ mkEx e ++ "//" | (l,e) <- lexx]
|
[l ++ ": //" ++ mkEx e ++ "//" | (l,e) <- lexx]
|
||||||
|
|
||||||
mkEx e = case words e of
|
mkEx = unwords . bind . mkE . words where
|
||||||
"atomic":"term":_ -> "*"
|
mkE e = case e of
|
||||||
"[]":_ -> "''"
|
"atomic":"term":_ -> ["*"]
|
||||||
es -> unwords (bind es)
|
"[]":_ -> ["''"]
|
||||||
|
"pre":p@('{':_):es -> init (init (drop 2 p)) : mkE es
|
||||||
|
e0:es -> e0:mkE es
|
||||||
|
_ -> e
|
||||||
|
|
||||||
bind ws = case ws of
|
bind ws = case ws of
|
||||||
w : "&+" : u : ws2 -> bind ((w ++ u) : ws2)
|
w : "&+" : u : ws2 -> bind ((w ++ u) : ws2)
|
||||||
|
|||||||
Reference in New Issue
Block a user