From a47fcbcbf23ead0cf3d7144ee23906bd5f6cb440 Mon Sep 17 00:00:00 2001 From: bjorn Date: Mon, 16 Jun 2008 16:44:33 +0000 Subject: Handled renaming external SRG categories centrally. --- src-3.0/GF/Speech/JSGF.hs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src-3.0/GF/Speech/JSGF.hs') diff --git a/src-3.0/GF/Speech/JSGF.hs b/src-3.0/GF/Speech/JSGF.hs index d49646152..dc9f4170a 100644 --- a/src-3.0/GF/Speech/JSGF.hs +++ b/src-3.0/GF/Speech/JSGF.hs @@ -44,10 +44,8 @@ prJSGF sisr srg comment "Generated by GF" $$ text ("grammar " ++ srgName srg ++ ";") lang = maybe empty text (srgLanguage srg) - mainCat = rule True "MAIN" [prCat (externalCat (srgStartCat srg))] - prRule (SRGRule cat rhs) - | isExternalCat srg cat = rule True (externalCat cat) (map prAlt rhs) - | otherwise = rule False cat (map prAlt rhs) + mainCat = rule True "MAIN" [prCat (srgStartCat srg)] + prRule (SRGRule cat rhs) = rule (isExternalCat srg cat) cat (map prAlt rhs) prAlt (SRGAlt mp n rhs) = sep [initTag, p (prItem sisr n rhs), finalTag] where initTag | isEmpty t = empty | otherwise = text "" <+> t @@ -55,9 +53,6 @@ prJSGF sisr srg finalTag = tag sisr (profileFinalSISR n) p = if isEmpty initTag && isEmpty finalTag then id else parens -externalCat :: Cat -> Cat -externalCat c = c ++ "_cat" - prCat :: Cat -> Doc prCat c = char '<' <> text c <> char '>' -- cgit v1.2.3