summaryrefslogtreecommitdiff
path: root/src/GF
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2006-12-11 15:20:26 +0000
committerbringert <bringert@cs.chalmers.se>2006-12-11 15:20:26 +0000
commitce62977188226dedb402daedbdb11f91b0109b2e (patch)
tree147b2f61d2721c2988df3196712d78e63b581aa7 /src/GF
parentc34c26a8378bc0dbea9515361ef923af58f2813c (diff)
VoiceXML: print without debugging stuff by default.
Diffstat (limited to 'src/GF')
-rw-r--r--src/GF/Speech/GrammarToVoiceXML.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/GF/Speech/GrammarToVoiceXML.hs b/src/GF/Speech/GrammarToVoiceXML.hs
index c5dd80e01..6b784a729 100644
--- a/src/GF/Speech/GrammarToVoiceXML.hs
+++ b/src/GF/Speech/GrammarToVoiceXML.hs
@@ -30,6 +30,11 @@ import Data.Maybe (fromMaybe)
import Debug.Trace
+debug = False
+
+debugLog xs | debug = blockCond "debug == 1" [prompt xs]
+ | otherwise = Empty
+
-- | the main function
grammar2vxml :: String -> StateGrammar -> String
grammar2vxml startcat gr = showsXMLDoc (skel2vxml name startcat gr' qs) ""
@@ -105,7 +110,7 @@ skel2vxml name start skel qs =
vxml (prelude ++ [startForm] ++ concatMap (uncurry (catForms gr qs)) skel)
where
gr = grammarURI name
- prelude = var "debug" (Just "0") : scriptLib
+ prelude = (if debug then [var "debug" (Just "0")] else []) ++ scriptLib
startForm = Tag "form" [] [subdialog "sub" [("src", "#"++start)] []]
grammarURI :: String -> String
@@ -163,8 +168,8 @@ cat2form gr qs cat fs =
++ concatMap (uncurry (fun2sub gr cat)) fs
++ [block [return_ [cat]]]
where feedback = []
- catDebug = blockCond "debug == 1" [prompt [Data (cat ++ " = "), value ("dump("++cat++")")]]
- retDebug = blockCond "debug == 1" [prompt [Data "return ", value ("dump("++cat++")")]]
+ catDebug = debugLog [Data (cat ++ " = "), value ("dump("++cat++")")]
+ retDebug = debugLog [Data "return ", value ("dump("++cat++")")]
fun2sub :: String -> VIdent -> VIdent -> [VIdent] -> [XML]
fun2sub gr cat fun args = comments [fun ++ " : " ++ cat] ++ ss
@@ -176,7 +181,7 @@ fun2sub gr cat fun args = comments [fun ++ " : " ++ cat] ++ ss
filled [] [assign (cat++"."++a) (s++"."++t)]]
where s = fun ++ "_" ++ a
-formDebug id = blockCond "debug == 1" [prompt [Data ("Entering form " ++ id ++ ". value = "), value "dump(value)"]]
+formDebug id = debugLog [Data ("Entering form " ++ id ++ ". value = "), value "dump(value)"]
--
-- * VoiceXML stuff