You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The error in both cases on my system reads:
Method 'hexlet' not found for invocant of class 'Cursor'
in block <unit> at unreserved.pl6:11
my token hexlet { <[A..F]> }
grammar G {
token TOP { <- hexlet> }
token hexlet { <[A..F]> }
}
say so G.parse('.');
say so G.parse('A');
say so '.' ~~ /<- alpha>/;
try { say so '.' ~~ /<- hexlet>/ }
say $!;
try { say so '.' ~~ /<[Q..Z] + hexlet>/ }
say $!;
This bug is still present in
Rakudo version 2016.09-21-g3ed51de built on MoarVM version 2016.09 implementing Perl 6.c.
Shorter test-case:
my token hexlet { <[A..F]> };
say "A" ~~ /<hexlet>/; # 「A」 hexlet => 「A」
say "A" ~~ /<- hexlet>/; # Method 'hexlet' not found for invocant of class 'Cursor'
my token hexlet { <[A..F]> };
say "A" ~~ /<hexlet>/; # 「A」 hexlet => 「A」
try { # Method 'hexlet' not found for invocant of class 'Cursor'
say "A" ~~ /<+ hexlet>/
} // say "error: $!";
try { # also Method 'hexlet' not found for invocant of class 'Cursor'
say "A" ~~ /<- hexlet>/
} // say "error: $!";
p6rt
added
the
regex
Regular expressions, pattern matching, user-defined grammars, tokens and rules
label
Jan 5, 2020
Migrated from rt.perl.org#126252 (status was 'open')
Searchable as RT126252$
The text was updated successfully, but these errors were encountered: