mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
VoiceXML generation: catch up with children array in SISR.
This commit is contained in:
@@ -148,7 +148,7 @@ cat2form gr qs cat fs =
|
|||||||
cat2form :: String -> CatQuestions -> VIdent -> [(VIdent, [VIdent])] -> XML
|
cat2form :: String -> CatQuestions -> VIdent -> [(VIdent, [VIdent])] -> XML
|
||||||
cat2form gr qs cat fs =
|
cat2form gr qs cat fs =
|
||||||
form (catFormId cat) $
|
form (catFormId cat) $
|
||||||
[var "value" (Just "{ name : '?' }"),
|
[var "value" Nothing,
|
||||||
-- var "callbacks" Nothing,
|
-- var "callbacks" Nothing,
|
||||||
blockCond "value.name != '?'" [assign (catFieldId cat) "value"],
|
blockCond "value.name != '?'" [assign (catFieldId cat) "value"],
|
||||||
-- block [doCallback "entered" cat [return_ [catFieldId cat]] []],
|
-- block [doCallback "entered" cat [return_ [catFieldId cat]] []],
|
||||||
@@ -175,14 +175,14 @@ fun2sub gr cat fun args =
|
|||||||
++ concat (intersperse ", " (map prid args))
|
++ concat (intersperse ", " (map prid args))
|
||||||
++ ") " ++ prid cat] ++ ss
|
++ ") " ++ prid cat] ++ ss
|
||||||
where
|
where
|
||||||
argNames = zip ["arg"++show n | n <- [0..]] args
|
ss = zipWith mkSub [0..] args
|
||||||
ss = map (uncurry mkSub) argNames
|
mkSub n t = subdialog s [("src","#"++catFormId t),
|
||||||
mkSub a t = subdialog s [("src","#"++catFormId t),
|
|
||||||
("cond",catFieldId cat++".name == "++string (prid fun))]
|
("cond",catFieldId cat++".name == "++string (prid fun))]
|
||||||
[param "value" (catFieldId cat++"."++a),
|
[param "value" v,
|
||||||
-- param "callbacks" "callbacks",
|
-- param "callbacks" "callbacks",
|
||||||
filled [] [assign (catFieldId cat++"."++a) (s++"."++catFieldId t)]]
|
filled [] [assign v (s++"."++catFieldId t)]]
|
||||||
where s = prid fun ++ "_" ++ a
|
where s = prid fun ++ "_" ++ show n
|
||||||
|
v = catFieldId cat++".children["++show n++"]"
|
||||||
|
|
||||||
doCallback :: String -> VIdent -> [XML] -> [XML] -> XML
|
doCallback :: String -> VIdent -> [XML] -> [XML] -> XML
|
||||||
doCallback f cat i e =
|
doCallback f cat i e =
|
||||||
|
|||||||
Reference in New Issue
Block a user