equal
deleted
inserted
replaced
1 // parse_labels.ysl2 |
1 // parse_labels.ysl2 |
2 |
2 |
3 |
3 |
4 // Parses: |
4 // Parses: |
5 // "HMI:WidgetType:param1:param2@path1,path1min,path1max@path2" |
5 // "HMI:WidgetType|freq:param1:param2@path1,path1min,path1max@path2" |
6 // |
6 // |
7 // Into: |
7 // Into: |
8 // widget type="WidgetType" id="blah456" { |
8 // widget type="WidgetType" id="blah456" { |
9 // arg value="param1"; |
9 // arg value="param1"; |
10 // arg value="param2"; |
10 // arg value="param2"; |
26 const "args" choose { |
26 const "args" choose { |
27 when "$_args" value "$_args"; |
27 when "$_args" value "$_args"; |
28 otherwise value "$description"; |
28 otherwise value "$description"; |
29 } |
29 } |
30 |
30 |
31 const "_type", "substring-before($args,':')"; |
31 const "_typefreq", "substring-before($args,':')"; |
32 const "type" choose { |
32 const "typefreq" choose { |
33 when "$_type" value "$_type"; |
33 when "$_typefreq" value "$_typefreq"; |
34 otherwise value "$args"; |
34 otherwise value "$args"; |
35 } |
35 } |
36 |
36 |
|
37 const "freq", "substring-after($typefreq,'|')"; |
|
38 |
|
39 const "_type", "substring-before($typefreq,'|')"; |
|
40 const "type" choose { |
|
41 when "$_type" value "$_type"; |
|
42 otherwise value "$typefreq"; |
|
43 } |
37 if "$type" widget { |
44 if "$type" widget { |
38 attrib "id" > «$id» |
45 attrib "id" > «$id» |
39 attrib "type" > «$type» |
46 attrib "type" > «$type» |
|
47 if "$freq" attrib "freq" > «$freq» |
40 foreach "str:split(substring-after($args, ':'), ':')" { |
48 foreach "str:split(substring-after($args, ':'), ':')" { |
41 arg { |
49 arg { |
42 attrib "value" > «.» |
50 attrib "value" > «.» |
43 } |
51 } |
44 } |
52 } |