summaryrefslogtreecommitdiff
path: root/test/erract2.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/erract2.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/erract2.rl')
-rw-r--r--test/erract2.rl80
1 files changed, 80 insertions, 0 deletions
diff --git a/test/erract2.rl b/test/erract2.rl
new file mode 100644
index 0000000..a4d0ef9
--- /dev/null
+++ b/test/erract2.rl
@@ -0,0 +1,80 @@
+/*
+ * @LANG: indep
+ *
+ * Test error actions.
+ */
+%%
+%%{
+ machine ErrAct;
+
+ action err_start { prints "err_start\n"; }
+ action err_all { prints "err_all\n"; }
+ action err_middle { prints "err_middle\n"; }
+ action err_out { prints "err_out\n"; }
+
+ action eof_start { prints "eof_start\n"; }
+ action eof_all { prints "eof_all\n"; }
+ action eof_middle { prints "eof_middle\n"; }
+ action eof_out { prints "eof_out\n"; }
+
+ main := ( 'hello'
+ >err err_start $err err_all <>err err_middle %err err_out
+ >eof eof_start $eof eof_all <>eof eof_middle %eof eof_out
+ ) '\n';
+}%%
+
+/* _____INPUT_____
+""
+"h"
+"x"
+"he"
+"hx"
+"hel"
+"hex"
+"hell"
+"helx"
+"hello"
+"hellx"
+"hello\n"
+"hellox"
+_____INPUT_____ */
+
+/* _____OUTPUT_____
+eof_start
+eof_all
+FAIL
+eof_all
+eof_middle
+FAIL
+err_start
+err_all
+FAIL
+eof_all
+eof_middle
+FAIL
+err_all
+err_middle
+FAIL
+eof_all
+eof_middle
+FAIL
+err_all
+err_middle
+FAIL
+eof_all
+eof_middle
+FAIL
+err_all
+err_middle
+FAIL
+eof_all
+eof_out
+FAIL
+err_all
+err_middle
+FAIL
+ACCEPT
+err_all
+err_out
+FAIL
+_____OUTPUT_____ */