summaryrefslogtreecommitdiff
path: root/tests/test_loop
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-10-25 21:44:02 +0200
committerKevin Chabowski <kevin@kch42.de>2013-10-25 21:44:02 +0200
commitdd03af69265ad686ae8daff6ecbd9df763e6d19f (patch)
treea86dae876afae2dcea9a3d70e3b513e305b38415 /tests/test_loop
parent91b965181f907b169aeeff63a6c15f9b8df9d9a9 (diff)
parenteebf5cb885f266104333ac145355ef6e2599e5f6 (diff)
downloadste-dd03af69265ad686ae8daff6ecbd9df763e6d19f.tar.gz
ste-dd03af69265ad686ae8daff6ecbd9df763e6d19f.tar.bz2
ste-dd03af69265ad686ae8daff6ecbd9df763e6d19f.zip
Merge branch 'parser2'
STE gets a new, more robust parser. The previous parser was very fragile and relied on some ugly regular expressions. Other advantages of the new parser: * No precompile phase to implement short tags (?{}, ~{}), that means short tags can now be nested in any order. * The parses now uses the mb_* functions, so it should handle non-ascii text correctly. There were also some improvements to the compiler: * Various small bugfixes. * The compiler accepts and compiles tag parameters that have tags in them. The parser still doesn't accept this (and probably never will), this is mainly used to allow arbitrary code inside of short cmp tags (~{..}). There are now (finally!) tests for the language to maintain a certain quality and consistency (which STE lacked in the past, to be honest). And finally the code was reformatted. Now 1TBS is used instead of Allman.
Diffstat (limited to 'tests/test_loop')
-rw-r--r--tests/test_loop/.gitignore3
-rw-r--r--tests/test_loop/code.php5
-rw-r--r--tests/test_loop/test.tpl3
-rw-r--r--tests/test_loop/want11
4 files changed, 22 insertions, 0 deletions
diff --git a/tests/test_loop/.gitignore b/tests/test_loop/.gitignore
new file mode 100644
index 0000000..de2a41b
--- /dev/null
+++ b/tests/test_loop/.gitignore
@@ -0,0 +1,3 @@
+have
+*.ast
+*.transc.php
diff --git a/tests/test_loop/code.php b/tests/test_loop/code.php
new file mode 100644
index 0000000..de8c553
--- /dev/null
+++ b/tests/test_loop/code.php
@@ -0,0 +1,5 @@
+<?php
+
+function test_func($ste) {
+
+}
diff --git a/tests/test_loop/test.tpl b/tests/test_loop/test.tpl
new file mode 100644
index 0000000..399f05a
--- /dev/null
+++ b/tests/test_loop/test.tpl
@@ -0,0 +1,3 @@
+<ste:for start="10" stop="0" step="-1" counter="i">
+$i
+</ste:for> \ No newline at end of file
diff --git a/tests/test_loop/want b/tests/test_loop/want
new file mode 100644
index 0000000..30b148d
--- /dev/null
+++ b/tests/test_loop/want
@@ -0,0 +1,11 @@
+10
+9
+8
+7
+6
+5
+4
+3
+2
+1
+0