Skip to content

Commit 620ebf0

Browse files
committed
Test <- name-with-hyphen>.
1 parent a5d13c1 commit 620ebf0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

t/nqp/031-grammar.t

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ grammar ABC {
99
token integer { \d+ }
1010
token TOP2 { ok ' ' <int-num> }
1111
token int-num { \d+ }
12+
13+
token a-or-b { <[ab]> }
14+
15+
token not_a_or_b { ^ <- a-or-b>+ $ }
1216
}
1317

1418
my $match := ABC.parse('not ok');
@@ -25,3 +29,6 @@ $match := ABC.parse('ok 123', :rule<TOP2> );
2529
ok( ?$match, 'parse method works with :rule');
2630

2731
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

Comments
 (0)