summaryrefslogtreecommitdiff
path: root/test/colm.d/func3.lm
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
committerAdrian Thurston <thurston@colm.net>2019-09-09 10:19:58 -0600
commitfff52cd5a567ec541cd487b9fee2d89bf9b6f6eb (patch)
tree046a3f0f457343f7c99bf096863daf023a085051 /test/colm.d/func3.lm
parent2d8e9c3f5c0417d6237c945c50f92bf8d28b32d5 (diff)
downloadcolm-fff52cd5a567ec541cd487b9fee2d89bf9b6f6eb.tar.gz
base (aapl, colm, ragel) test cases building
Diffstat (limited to 'test/colm.d/func3.lm')
-rw-r--r--test/colm.d/func3.lm39
1 files changed, 39 insertions, 0 deletions
diff --git a/test/colm.d/func3.lm b/test/colm.d/func3.lm
new file mode 100644
index 00000000..d0e323c1
--- /dev/null
+++ b/test/colm.d/func3.lm
@@ -0,0 +1,39 @@
+lex
+ literal `{ `}
+ literal `struct `type
+ token id /[A-Za-z_][A-Za-z_0-9]*/
+ ignore /[ \t\r\n]+/
+end
+
+def attribute
+ [`type id]
+
+def _struct
+ [`struct id `{ attribute* `}]
+
+def program
+ [_struct*]
+
+int func( P: program )
+{
+ print[ @ P ]
+}
+
+int main()
+{
+ parse P: program[ stdin ]
+ func( P )
+}
+
+main()
+
+##### IN #####
+struct S
+{
+ type T
+}
+##### EXP #####
+struct S
+{
+ type T
+}