On Sun, Apr 22, 2012 at 1:41 AM, Father Chrysostomos via RT <
perlbug-comment@perl.org> wrote:
> On Wed Apr 04 13:53:55 2012, ikegami@adaelis.com wrote:
> > The builtin "if" should expect the following to follow it (ignoring
> > whitespace)
> >
> > "(" EXPR ")" BLOCK ( "elsif" "(" EXPR ")" BLOCK )* ( "else" BLOCK )?
> >
> > None of those tokens should be overridable when parsing that rule
> (although
> > EXPR and BLOCK may use overridden tokens).
>
> In that case, is there any reason why elsif needs to be a reserved word
> outside of that context?
>
I was wondering that myself when I typed the above. We allow C<< sub if { }
>>, so why not C<< sub elsif { } >>?
I'm not seeing the value of C<< elsif(); >> being a syntax error. The two
reasons I can come up for continuing to be a syntax error are confusion
avoidance and syntax error detection, but neither reason is valid. We
already allow C<< sub if { } >>, and C<< elsif (...) { ... } >> would still
be a syntax error if C<< elsif(...); >> isn't.
Thread Previous
|
Thread Next