diff options
| author | bringert <bringert@cs.chalmers.se> | 2006-12-15 16:08:39 +0000 |
|---|---|---|
| committer | bringert <bringert@cs.chalmers.se> | 2006-12-15 16:08:39 +0000 |
| commit | 1e1401472fdc55ba8f208baa7f07e2a4a3cb906c (patch) | |
| tree | c03e2b7511189ba775381341159c8895d64b6d99 /src | |
| parent | 1f1be57279d2c79ee9d79119f592dffc7b97b13a (diff) | |
Include update function in generated VoiceXML. Generated linearization javaScript now uses the same abstract syntax representation as SISR.
Diffstat (limited to 'src')
| -rw-r--r-- | src/GF/Speech/GrammarToVoiceXML.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/GF/Speech/GrammarToVoiceXML.hs b/src/GF/Speech/GrammarToVoiceXML.hs index b2142b50c..2e3ea1096 100644 --- a/src/GF/Speech/GrammarToVoiceXML.hs +++ b/src/GF/Speech/GrammarToVoiceXML.hs @@ -157,7 +157,9 @@ catForms gr qs cat fs = cat2form :: String -> CatQuestions -> VIdent -> [(VIdent, [VIdent])] -> XML cat2form gr qs cat fs = - form cat $ [var "value" (Just "'?'"), formDebug cat, + form cat $ [var "value" (Just "'?'"), + var "update" Nothing, + formDebug cat, blockCond "value != '?'" [assign cat "value"], field cat [] [promptString (getCatQuestion cat qs), grammar (gr++"#"++cat), @@ -167,7 +169,7 @@ cat2form gr qs cat fs = catDebug] ++ concatMap (uncurry (fun2sub gr cat)) fs ++ [block [return_ [cat]]] - where feedback = [] + where feedback = [if_ ("typeof update != 'undefined' && !update("++string cat++","++ cat ++ ")") [return_ []]] catDebug = debugLog [Data (cat ++ " = "), value ("dump("++cat++")")] retDebug = debugLog [Data "return ", value ("dump("++cat++")")] @@ -178,6 +180,7 @@ fun2sub gr cat fun args = comments [fun ++ " : " ++ cat] ++ ss ss = map (uncurry mkSub) argNames mkSub a t = subdialog s [("src","#"++t),("cond",cat++".name == "++string fun)] [param "value" (cat++"."++a), + param "update" "update", filled [] [assign (cat++"."++a) (s++"."++t)]] where s = fun ++ "_" ++ a |
