Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fudge S05-grammar/protoregex.t for niecza
  • Loading branch information
sorear committed Feb 16, 2011
1 parent ecfd67a commit 0a53d82
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions S05-grammar/protoregex.t
Expand Up @@ -5,9 +5,7 @@ plan 11;
grammar Alts {
token TOP { ^ <alt> $ };

# no idea what I have to put in the proto token, and if matters;
# the <...> is just cargo-culted from STD.pm
proto token alt { <...> }
proto token alt {*}
token alt:sym<foo> { <sym> };
token alt:sym<bar> { 'bar' };
token alt:sym<baz> { 'argl' };
Expand All @@ -18,6 +16,7 @@ ok (my $match = Alts.parse('foo')), 'can parse with proto regexes (1)';
is $match, 'foo', 'and matched the full string';
is $match<alt>, 'foo', 'got the right name of the capture';

#?niecza skip '.parse sets $/'
is $/, 'foo', 'also works with $/';

ok Alts.parse('bar'), 'can parse with second alternative';
Expand Down

0 comments on commit 0a53d82

Please sign in to comment.