New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fwd: [BUG] [REGEX] error : “Cannot find method 'ann' on object of type NQPMu” #5861
Comments
From rongshenmd@gmail.com---------- Forwarded message ---------- My system: uname -a My perl6 version: perl6 --version Okay, I am still having trouble with perl6 grammar and action. I want to my $test = "xx, 1-March-23, 23.feb.21, yy foo 12/january/2099 , grammar month { But it says: ===SORRY!===Cannot find method 'ann' on object of type NQPMu What did I do wrong ? Thank you for your help !!! This looks like a bug in Rakudo to me, possibly related to before being It can already be triggered with a simple / <before> /: $ perl6 --versionThis is Rakudo version 2016.11-20-gbd42363 built on $ perl6 -e '/ <before> /'===SORRY!===Cannot find method 'ann' on At the very least, it's a case of a less than awesome error message. You should report this to rakudobug@perl.org, cf How to report a bug |
From @jnthnOn Mon, 05 Dec 2016 22:58:27 -0800, rongshenmd@gmail.com wrote:
Both `before` and `after` happen to be the names of a couple of the standard rules (for doing lookahead and lookbehind), inherited from the base Grammar class. In theory overriding these as you have is fine enough (until you try to use the built-in ones and then get confused because yours took precedence, at least ;-)). In practice, part of the regex compiler treated the name `before` specially and then got very upset when it was not something of the form `<before some regex here>`. I've now made it more robust in Raku/nqp@768b20d and with that patch your grammar seems to work nicely. What needs a bit more discussion is whether we'd like to simply leave it at that and add a spectest to codify that overriding before/after this way is fine (I'm good with this), or treat those two names a bit more specially (but then where do we draw the line on which built-ins get such treatment?) Thanks, /jnthn |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#130273 (status was 'open')
Searchable as RT130273$
The text was updated successfully, but these errors were encountered: