Use the new import feature of Ragel for bringing in defines from the parser
[ragel.git] / test / eofact.rl
blob890b73c9715f2651cd199446e2990d73b7f57982
1 /*
2  * @LANG: indep
3  * @ALLOW_GENFLAGS: -T0 -T1 -F0 -F1 -G0 -G1 -G2 -P
4  */
5 %%
6 %%{
7         machine eofact;
9         action a1 { prints "a1\n"; }
10         action a2 { prints "a2\n"; }
11         action a3 { prints "a3\n"; }
12         action a4 { prints "a4\n"; }
15         main := (
16                 'hello' @eof a1 %eof a2 '\n'? |
17                 'there' @eof a3 %eof a4
18         );
20 }%%
21 /* _____INPUT_____
23 "h"
24 "hell"
25 "hello"
26 "hello\n"
27 "t"
28 "ther"
29 "there"
30 "friend"
31 _____INPUT_____ */
32 /* _____OUTPUT_____
35 FAIL
37 FAIL
39 FAIL
41 ACCEPT
42 ACCEPT
44 FAIL
46 FAIL
48 ACCEPT
49 FAIL
50 _____OUTPUT_____ */