On Mon, 26 Feb 2018 23:48:20 GMT, davem wrote: > On Thu, Feb 22, 2018 at 10:27:18AM +0000, Dave Mitchell wrote: > > I plan to do the following two things shortly (assuming they prove > > feasible): > > > > 1) change the parser so that subs under 'use feature signatures' use > > a different grammar rule than subs not under it - possibly by making > > the > > toker return two different sub tokens, e.g. 'SUB' and a new 'SIGSUB' > > token say, depending on whether the feature is in scope. > > > > This will then help reduce confusing errors, e.g. this code with a > > syntax > > error (attrs before prototype): > > > > no feature 'signatures'; > > sub f :lvalue ($$@) { $x = 1 } > > > > currently gives: > > > > Illegal character following sigil in a subroutine signature at > > ..., near "($" > > > > It's parsing the ($$@) as a sub signature even though signatures > > aren't in > > scope, so the error message is confusing. > > > > 2) For the signature sub grammar rule, allow it to spot attributes > > following a signature and croak with a meaningful error. Which is > > what the > > OP requested. > > I've now done this and pushed as branch smoke-me/davem/sig_attr_croak. > If there's a rough consensus, I'll merge it soon. > I built this branch on FreeBSD-11.0, then installed 'cpanm' against it and used cpanm to try to install the three modules cited in this ticket: List::Lazy, Evo, and Moxie. Tests failed in all three with this kind of message: ##### Subroutine attributes must come before the signature at /usr/home/jkeenan/.cpanm/work/1519692082.14147/Moxie-0.07/blib/lib/Moxie/Traits/Provider/Accessor.pm line 19. ##### Output of perl -V and gzipped build.log attached. Should I have expected better results? Thank you very much. -- James E Keenan (jkeenan@cpan.org) --- via perlbug: queue: perl5 status: open https://rt.perl.org/Ticket/Display.html?id=132760Thread Previous | Thread Next