Raku / old-issue-tracker

Tickets from RT
https://github.com/Raku/old-issue-tracker/issues
2 stars 1 forks source link

Lexical character classes cannot be used for complement or combined #4619

Open p6rt opened 8 years ago

p6rt commented 8 years ago

Migrated from rt.perl.org#126252 (status was 'open')

Searchable as RT126252$

p6rt commented 8 years ago

From @ronaldxs

The last two cases below fail and they should not. The problem was discussed on IRC here​: http://irclog.perlgeek.de/perl6/2015-10-02#i_11309820 .

The error in both cases on my system reads​: Method 'hexlet' not found for invocant of class 'Cursor'   in block \ 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 $!;

p6rt commented 7 years ago

@coke - Status changed from 'new' to 'open'

p6rt commented 7 years ago

From @smls

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" ~~ /\/; # 「A」␤ hexlet => 「A」   say "A" ~~ /\<- hexlet>/; # Method 'hexlet' not found for invocant of class 'Cursor'

p6rt commented 7 years ago

From @ronaldxs

Possibly more complete test case​:

my token hexlet { \<[A..F]> }; say "A" ~~ /\/; # 「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​: $!";