@cyklang/cli 0.2.2 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/test/t24.xml CHANGED
@@ -7,4 +7,24 @@
7
7
  </block>
8
8
  </function>
9
9
 
10
+ <string name="name">"Mortimer"</string>
11
+ <string name="country">"France"</string>
12
+ <string name="model" literal="">
13
+ My name is {{ name }}
14
+ I live in {{ country }}
15
+ </string>
16
+ <print>interpolate(model)</print>
17
+ <print>replace("php_script.php", "php","cyk", "g")</print>
18
+
19
+ <print>"while Loop "</print>
20
+ <number name="cpt">0</number>
21
+ <while>
22
+ <condition> <![CDATA[ cpt < 1000 ]]></condition>
23
+ <then>
24
+ <number name="nombre">1000</number>
25
+ <set name="cpt">cpt + 1</set>
26
+ <print>"cpt = " + cpt</print>
27
+ </then>
28
+ </while>
29
+ <print>"after 10 loop dcl NOMBRE and set"</print>
10
30
  </module>
@@ -0,0 +1,4 @@
1
+ task 1 begins
2
+ task 1 ended after 2000
3
+ task 2 begins
4
+ task 2 ended after 1000
package/test/t25.xml ADDED
@@ -0,0 +1,23 @@
1
+ <?xml-model href="https://www.cyklang.net/schema/cyklang.xsd" ?>
2
+ <module>
3
+ <function name="task" synchronized="">
4
+ <string name="name"/>
5
+ <number name="duration"/>
6
+ <block>
7
+ <print>name + " begins "</print>
8
+ <sleep>duration</sleep>
9
+ <print>name + " ended after " + duration </print>
10
+ </block>
11
+ </function>
12
+ <parallel>
13
+ <call function="task">
14
+ <string name="name">"task 1"</string>
15
+ <number name="duration">2000</number>
16
+ </call>
17
+ <call function="task">
18
+ <string name="name">"task 2"</string>
19
+ <number name="duration">1000</number>
20
+ </call>
21
+ </parallel>
22
+
23
+ </module>
@@ -0,0 +1,5 @@
1
+ nom : CHANE
2
+ date : <b>Gras</b> <i>Italic </i>
3
+ format 1 : Format sans paramètre
4
+ format 2 : Nom : CYK Final
5
+ format 3 : Nom : { CYK Prénom Philippe }
package/test/t26.xml ADDED
@@ -0,0 +1,35 @@
1
+ <?xml-model href="cyklang.xsd" ?>
2
+ <module>
3
+ <map name="hash">
4
+ <key>nom</key><value>CHANE</value>
5
+ <key>prénom</key><value>Philippe</value>
6
+ <key>Nom : {{ {0} Prénom {1} }}</key><value>Firstname : {{ {1} Name {0} }}</value>
7
+ </map>
8
+ <print>"nom : " + hash.get("nom")</print>
9
+ <call object="hash" method="set">
10
+ <string name="key">"date"</string>
11
+ <string name="value" literal=""><![CDATA[ <b>Gras</b> <i>Italic </i>]]></string>
12
+ </call>
13
+ <print>"date : " + hash.get("date")</print>
14
+ <print>"format 1 : " + format("Format sans paramètre")</print>
15
+ <print>"format 2 : " + format("Nom : {0} Final", "CYK")</print>
16
+ <print>"format 3 : " + format("Nom : {{ {0} Prénom {1} }}", "CYK", "Philippe")</print>
17
+
18
+ <object name="person">
19
+ <string name="name">"CYK"</string>
20
+ <string name="surname">"Philippe"</string>
21
+ <object name="adresses">
22
+ <object>
23
+ <string name="town">"Saint-Denis"</string>
24
+ <string name="department">"Reunion"</string>
25
+ </object>
26
+ <object>
27
+ <string name="town">"Paris"</string>
28
+ <string name="department">"Paris"</string>
29
+ </object>
30
+ </object>
31
+ </object>
32
+
33
+ <print>json(person)</print>
34
+
35
+ </module>