summaryrefslogtreecommitdiff
path: root/test/eofact.rl
diff options
context:
space:
mode:
authorthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>2007-01-21 22:58:22 +0000
committerthurston <thurston@052ea7fc-9027-0410-9066-f65837a77df0>2007-01-21 22:58:22 +0000
commit12056158053532946b53b6249cb0e6cfd4580051 (patch)
tree9b5449ef42e829f98bf7a6c6e0554b88d4ab9132 /test/eofact.rl
downloadragel-12056158053532946b53b6249cb0e6cfd4580051.tar.gz
ragel-12056158053532946b53b6249cb0e6cfd4580051.tar.bz2
ragel-12056158053532946b53b6249cb0e6cfd4580051.zip
Import from my private repository. Snapshot after version 5.16, immediately
following the rewrite of the parsers. Repository revision number 3961. git-svn-id: http://svn.complang.org/ragel/trunk@2 052ea7fc-9027-0410-9066-f65837a77df0
Diffstat (limited to 'test/eofact.rl')
-rw-r--r--test/eofact.rl50
1 files changed, 50 insertions, 0 deletions
diff --git a/test/eofact.rl b/test/eofact.rl
new file mode 100644
index 0000000..890b73c
--- /dev/null
+++ b/test/eofact.rl
@@ -0,0 +1,50 @@
+/*
+ * @LANG: indep
+ * @ALLOW_GENFLAGS: -T0 -T1 -F0 -F1 -G0 -G1 -G2 -P
+ */
+%%
+%%{
+ machine eofact;
+
+ action a1 { prints "a1\n"; }
+ action a2 { prints "a2\n"; }
+ action a3 { prints "a3\n"; }
+ action a4 { prints "a4\n"; }
+
+
+ main := (
+ 'hello' @eof a1 %eof a2 '\n'? |
+ 'there' @eof a3 %eof a4
+ );
+
+}%%
+/* _____INPUT_____
+""
+"h"
+"hell"
+"hello"
+"hello\n"
+"t"
+"ther"
+"there"
+"friend"
+_____INPUT_____ */
+/* _____OUTPUT_____
+a1
+a3
+FAIL
+a1
+FAIL
+a1
+FAIL
+a2
+ACCEPT
+ACCEPT
+a3
+FAIL
+a3
+FAIL
+a4
+ACCEPT
+FAIL
+_____OUTPUT_____ */