repo.or.cz
/
ragel.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Scanners now ensure that a pattern's leaving actions are executed.
[ragel.git]
/
test
/
eofact.rl
blob
eeb91b89174700fdb19f5d3ad7ad683306569fff
1
/*
2
* @LANG: indep
3
*
4
* Test works with split code gen.
5
*/
6
%%
7
%%{
8
machine eofact;
9
10
action a1 { prints "a1\n"; }
11
action a2 { prints "a2\n"; }
12
action a3 { prints "a3\n"; }
13
action a4 { prints "a4\n"; }
14
15
16
main := (
17
'hello' @eof a1 %eof a2 '\n'? |
18
'there' @eof a3 %eof a4
19
);
20
21
}%%
22
/* _____INPUT_____
23
""
24
"h"
25
"hell"
26
"hello"
27
"hello\n"
28
"t"
29
"ther"
30
"there"
31
"friend"
32
_____INPUT_____ */
33
/* _____OUTPUT_____
34
a1
35
a3
36
FAIL
37
a1
38
FAIL
39
a1
40
FAIL
41
a2
42
ACCEPT
43
ACCEPT
44
a3
45
FAIL
46
a3
47
FAIL
48
a4
49
ACCEPT
50
FAIL
51
_____OUTPUT_____ */