summaryrefslogtreecommitdiff
path: root/test/func3.lm
diff options
context:
space:
mode:
Diffstat (limited to 'test/func3.lm')
-rw-r--r--test/func3.lm40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/func3.lm b/test/func3.lm
new file mode 100644
index 0000000..cdfcbc3
--- /dev/null
+++ b/test/func3.lm
@@ -0,0 +1,40 @@
+##### LM #####
+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
+}