diff options
Diffstat (limited to 'test/colm.d/list1.lm')
-rw-r--r-- | test/colm.d/list1.lm | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/colm.d/list1.lm b/test/colm.d/list1.lm new file mode 100644 index 00000000..8639556e --- /dev/null +++ b/test/colm.d/list1.lm @@ -0,0 +1,42 @@ +lex + ignore /space+/ + literal `* `( `) + token id /[a-zA-Z_]+/ +end + +def item + [id] +| [`( item* `)] + +def start + [item*] + +parse S: start[ stdin ] + +struct start_el + B0: start + S: start + B1: start + B2: start + B3: start +end + +L: list<start_el> = new list<start_el>() + +E: start_el = new start_el() +E->S = S +L->push_head( E ) + +E = new start_el() +E->S = S +L->push_head( E ) + +for SE: start_el in L { + print[ @SE->S ] +} + +##### IN ###### +a b c ( chocolate fudge ) d e +##### EXP ###### +a b c ( chocolate fudge ) d e +a b c ( chocolate fudge ) d e |