Scanners now ensure that a pattern's leaving actions are executed.
[ragel.git] / test / eofact.rl
blobeeb91b89174700fdb19f5d3ad7ad683306569fff
1 /*
2  * @LANG: indep
3  *
4  * Test works with split code gen.
5  */
6 %%
7 %%{
8         machine eofact;
10         action a1 { prints "a1\n"; }
11         action a2 { prints "a2\n"; }
12         action a3 { prints "a3\n"; }
13         action a4 { prints "a4\n"; }
16         main := (
17                 'hello' @eof a1 %eof a2 '\n'? |
18                 'there' @eof a3 %eof a4
19         );
21 }%%
22 /* _____INPUT_____
24 "h"
25 "hell"
26 "hello"
27 "hello\n"
28 "t"
29 "ther"
30 "there"
31 "friend"
32 _____INPUT_____ */
33 /* _____OUTPUT_____
36 FAIL
38 FAIL
40 FAIL
42 ACCEPT
43 ACCEPT
45 FAIL
47 FAIL
49 ACCEPT
50 FAIL
51 _____OUTPUT_____ */