diff options
Diffstat (limited to 'test/colm.d/balance1.lm')
-rw-r--r-- | test/colm.d/balance1.lm | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/test/colm.d/balance1.lm b/test/colm.d/balance1.lm new file mode 100644 index 00000000..e5ec8e6b --- /dev/null +++ b/test/colm.d/balance1.lm @@ -0,0 +1,33 @@ +lex + token id /[a-z]+/ + ignore /[ \t\n]/ + + literal `; + + token PLUS /'+'/ { + input->pull( match_length ) + + parse S: stmt "there is more;" + input->push( S ) + 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 +a b ; there is more; c d; +<- |