1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<scxml datamodel="lua" initial="StateShape1" name="ScxmlShape1" version="1.0" xmlns="http://www.w3.org/2005/07/scxml">
<datamodel>
<data id="t_DifficultTable">{
[2] = {
[1]={ 5,5,5,5 },
[2]={ 5,5,5,5 },
[3]= { 10,10 }
},
[1] = {
[1]= { 4,4,4,4,4,4,4,4 },
[2]= { 8,8,8,8 },
[3]= { 16,16 }
},
[3] = {
[1]={ 2,2,2 },
test = false,
good = true,
xxx = 'asdf'
},
zzz = {
1,2,3,"different types",
[[bbbbbbb\nbbbbbb]],
qq = "asdf 'asdf' [[asdf]]"
}
}
</data>
<data expr="{
[3]=3,
[2]=2,
[1]=1
}" id="t_mixed"/>
</datamodel>
<state id="StateShape1">
<onentry>
<script>function PrintTable(t_val, s_tab)
if type(t_val)=="table" then
for k,v in pairs(t_val) do
print(string.format("%sk=%s[%s],v=%s[%s]",s_tab,tostring(k),type(k),tostring(v),type(v)))
PrintTable(v,s_tab .. "\t")
end
end
end
PrintTable(t_DifficultTable,"")
</script>
<foreach array="t_mixed" index="s_index" item="s_item">
<log expr="s_item" label="s_item"/>
<log expr="s_index" label="s_index"/>
</foreach>
</onentry>
<transition cond="t_DifficultTable[2][3][1]==10 and
#t_DifficultTable[1]==3 and
t_DifficultTable[3][1][2]==2 and
t_DifficultTable[3].test==false and
t_DifficultTable[3].xxx=="asdf" and
t_DifficultTable.zzz.qq=="asdf 'asdf' [[asdf]]" and
t_DifficultTable.zzz[1]==1 and
t_DifficultTable.zzz[2]==2 and
t_DifficultTable.zzz[3]==3 and
t_DifficultTable.zzz[4]=="different types" and
t_DifficultTable.zzz[5]==[[bbbbbbb\nbbbbbb]]" target="pass"/>
<transition event="error.*" target="fail"/>
<transition target="fail"/>
</state>
<final id="pass"/>
<final id="fail">
<onentry/>
</final>
</scxml>
|