develooper Front page | perl.perl5.porters | Postings from November 2017

Re: [perl #119823] LABEL<newline>: only works in string eval

From:
Zefram
Date:
November 27, 2017 13:37
Subject:
Re: [perl #119823] LABEL<newline>: only works in string eval
Message ID:
20171127133644.GH4913@fysh.org
Brian Fraser wrote:
>Ideally we should be using PEEKSPACE() there, but that calls
>lex_read_space, which swallows up # and anything following it, and that
>would break s#foo#bar#.

It's not as simple as breaking that, and actually that worry is easily
dealt with because we can see before doing the whitespace skipping that
the word is "s" which isn't eligible to become a label.  In fact, we
can see from how well "=>" on a following line works that it should be
possible to detect ":" on a following line, by postponing the recognition
until we know it's OK to process whitespace normally.

-zefram



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About