summaryrefslogtreecommitdiff
path: root/test/ignore2.lm
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2014-02-01 19:49:33 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2014-02-01 19:49:33 +0000
commit404ae0f284a3b2d41fcdb53826550e4dfec5c65c (patch)
treecc446af26234e4465b8cc168b720ec44816ff5ab /test/ignore2.lm
downloadcolm-tarball-404ae0f284a3b2d41fcdb53826550e4dfec5c65c.tar.gz
Diffstat (limited to 'test/ignore2.lm')
-rw-r--r--test/ignore2.lm36
1 files changed, 36 insertions, 0 deletions
diff --git a/test/ignore2.lm b/test/ignore2.lm
new file mode 100644
index 0000000..f4aa963
--- /dev/null
+++ b/test/ignore2.lm
@@ -0,0 +1,36 @@
+##### LM #####
+lex
+ ignore /space+/
+ literal `* `( `)
+ token id /[a-zA-Z_]+/
+end
+
+def item
+ [id]
+| [`( item* `)]
+
+def start
+ [item*]
+
+parse Input: start[ stdin ]
+
+cons Output: accum<start> []
+
+for Id: id in Input {
+ send Output
+ "( [^Id] )
+}
+
+S: start = Output()
+
+print( S )
+##### IN #####
+a b c ( chocolate fudge ) d e
+##### EXP #####
+( a )
+( b )
+( c )
+( chocolate )
+( fudge )
+( d )
+( e )