From 87b66d52057cca6c002c8ce9da2e93030fba1443 Mon Sep 17 00:00:00 2001 From: bringert Date: Tue, 12 Dec 2006 10:37:45 +0000 Subject: [PATCH] SRGS generation: don't include debug script stuff if debugging is disabled. Place category comments better. --- src/GF/Speech/GrammarToVoiceXML.hs | 2 +- src/GF/Speech/PrSRGS.hs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GF/Speech/GrammarToVoiceXML.hs b/src/GF/Speech/GrammarToVoiceXML.hs index c2bf32b58..b2142b50c 100644 --- a/src/GF/Speech/GrammarToVoiceXML.hs +++ b/src/GF/Speech/GrammarToVoiceXML.hs @@ -110,7 +110,7 @@ skel2vxml name language start skel qs = vxml language (prelude ++ [startForm] ++ concatMap (uncurry (catForms gr qs)) skel) where gr = grammarURI name - prelude = (if debug then [var "debug" (Just "0")] else []) ++ scriptLib + prelude = if debug then [var "debug" (Just "0")] ++ scriptLib else [] startForm = Tag "form" [] [subdialog "sub" [("src", "#"++start)] []] grammarURI :: String -> String diff --git a/src/GF/Speech/PrSRGS.hs b/src/GF/Speech/PrSRGS.hs index 175b97366..2d401bb4a 100644 --- a/src/GF/Speech/PrSRGS.hs +++ b/src/GF/Speech/PrSRGS.hs @@ -56,9 +56,9 @@ prSrgsXml sisr (SRG{grammarName=name,startCat=start, meta "generator" ("Grammatical Framework " ++ version ++ " (compiled " ++ today ++ ")")] ++ topCatRules - ++ map ruleToXML rs + ++ concatMap ruleToXML rs ruleToXML (SRGRule cat origCat alts) = - rule (prCat cat) (comments ["Category " ++ origCat] ++ prRhs isList alts) + comments ["Category " ++ origCat] ++ [rule (prCat cat) (prRhs isList alts)] where isList = False -- Disabled list build since OptimTalk can't handle it ATM {- "List" `isPrefixOf` origCat && length cs == 2