We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5d13c1 commit 620ebf0Copy full SHA for 620ebf0
t/nqp/031-grammar.t
@@ -9,6 +9,10 @@ grammar ABC {
9
token integer { \d+ }
10
token TOP2 { ok ' ' <int-num> }
11
token int-num { \d+ }
12
+
13
+ token a-or-b { <[ab]> }
14
15
+ token not_a_or_b { ^ <- a-or-b>+ $ }
16
}
17
18
my $match := ABC.parse('not ok');
@@ -25,3 +29,6 @@ $match := ABC.parse('ok 123', :rule<TOP2> );
25
29
ok( ?$match, 'parse method works with :rule');
26
30
27
31
ok( $match<int-num> == 123, 'captured $<int-num>');
32
33
+ok(?ABC.parse('ccc', :rule<not_a_or_b> ), "<- name-with-hyphen> matches");
34
+ok(!ABC.parse('cac', :rule<not_a_or_b> ), "<- name-with-hyphen> doesn't match");
0 commit comments