summaryrefslogtreecommitdiff
path: root/test/colm.d/balance3.lm
diff options
context:
space:
mode:
Diffstat (limited to 'test/colm.d/balance3.lm')
-rw-r--r--test/colm.d/balance3.lm32
1 files changed, 32 insertions, 0 deletions
diff --git a/test/colm.d/balance3.lm b/test/colm.d/balance3.lm
new file mode 100644
index 00000000..aae049b7
--- /dev/null
+++ b/test/colm.d/balance3.lm
@@ -0,0 +1,32 @@
+lex
+ token id /[a-z]+/
+ ignore /[ \t\n]/
+
+ literal `;
+
+ token PLUS /'+'/ {
+ input->pull( match_length )
+
+ parse M: main "there is more;"
+ input->push( M )
+ input->push( "; " )
+ }
+end
+
+def stmt
+ [id* `;]
+
+def main
+ [stmt+]
+
+parse M: main [stdin]
+
+print
+ "parsed tree
+ [M]
+ "<-
+##### IN #####
+a b + c d; @
+##### EXP #####
+parsed tree
+NIL<-