Dave Mitchell <davem@iabyn.com> writes: > 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. LGTM - ilmari -- - Twitter seems more influential [than blogs] in the 'gets reported in the mainstream press' sense at least. - Matt McLeod - That'd be because the content of a tweet is easier to condense down to a mainstream media article. - Calle DybedahlThread Previous | Thread Next