summaryrefslogtreecommitdiff
path: root/test/scan2.rl
blob: a1ae959d88511a041363e5c5fae225fe99cb7a34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
 * @LANG: indep
 */
ptr ts;
ptr te;
int act;
int token;
%%
%%{
	machine scanner;

	# Warning: changing the patterns or the input string will affect the
	# coverage of the scanner action types.
	main := |*
        'a' => {
			prints "pat1\n";
		};

        [ab]+ . 'c' => {
			prints "pat2\n";
		};

        any => {
			prints "any\n";
		};
	*|;
}%%
/* _____INPUT_____
"a"
_____INPUT_____ */
/* _____OUTPUT_____
pat1
ACCEPT
_____OUTPUT_____ */