develooper Front page | perl.perl5.porters | Postings from July 2016

Re: Indented here docs?

Thread Previous | Thread Next
From:
Kent Fredric
Date:
July 2, 2016 12:46
Subject:
Re: Indented here docs?
Message ID:
CAATnKFB7EoA4Th-VuSsqKE6VtdZcnH4bXfC-WGCONY7i2Ma8hw@mail.gmail.com
On 3 July 2016 at 00:21, Matthew Horsfall (alh) <wolfsage@gmail.com> wrote:
> Earlier on:
>
>     PERL_ARGS_ASSERT_SCAN_HEREDOC;
>
>     s += 2;
>     d = PL_tokenbuf + 1;
>     e = PL_tokenbuf + sizeof PL_tokenbuf - 1;
>     *PL_tokenbuf = '\n';
>     peek = s;
>
> So PL_tokenbuf becomes \nDELIMITER\n. Although looking at the code
> again, I can probably just do PL_tokenbuf+1 later where needed. I'll
> look into that.


I was thinking you should add an exception for "constant indentation"
if the line itself contains no characters other than a trailing \n.

Mostly because otherwise you'll start fighting with various tools that
check for "excess trailing whitespace"

-- 
Kent

KENTNL - https://metacpan.org/author/KENTNL

Thread Previous | Thread Next


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