summaryrefslogtreecommitdiff
path: root/test/reparse.lm
diff options
context:
space:
mode:
Diffstat (limited to 'test/reparse.lm')
-rw-r--r--test/reparse.lm26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/reparse.lm b/test/reparse.lm
new file mode 100644
index 0000000..907ca6a
--- /dev/null
+++ b/test/reparse.lm
@@ -0,0 +1,26 @@
+##### LM #####
+lex
+ ignore /space+/
+ literal `* `( `)
+ token id /[a-zA-Z_]+/
+end
+
+def item
+ [id]
+| [`( item* `)]
+
+def start
+ [item*]
+
+parse Input: item*[ stdin ]
+
+S: start = cons start[ Input ]
+
+parse Again: start[ %Input ]
+
+print( Again )
+
+##### IN #####
+a b c ( chocolate fudge ) d e
+##### EXP #####
+a b c ( chocolate fudge ) d e