summaryrefslogtreecommitdiff
path: root/test/ragel.d/scan4.rl
blob: 44f24b16a9455d0ca2919eb50eb1f436f5dc706a (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
 * @NEEDS_EOF: yes
 */

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' => {
		  print_str "pat1\n";
	  };

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

	  any;
	*|;
}%%

##### INPUT #####
"ba a"
##### OUTPUT #####
pat1
pat1
ACCEPT