[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-gawk] [PATCH] gawk: Comply with IEEE Std 1003.1
From: |
arnold |
Subject: |
Re: [bug-gawk] [PATCH] gawk: Comply with IEEE Std 1003.1 |
Date: |
Tue, 31 Jul 2018 00:46:02 -0600 |
User-agent: |
Heirloom mailx 12.4 7/29/08 |
Hi.
I have just pushed code and doc updates related to this. In short:
- In POSIX mode gawk rejects any physical newline in strings, even
escaped ones.
- The -v option now handles \-<newline> like the scanner does.
Thanks for bringing this issue to my attention.
Arnold
address@hidden wrote:
> Samy Mahmoudi <address@hidden> wrote:
>
> > Hello,
> >
> > When using the option -v *assignment*, POSIX awk "shall ensure
> > that the assignment argument is in the same form as an assignment
> > operand", in which "the characters following the equal sign shall
> > be interpreted as ... a *STRING* token".
> >
> > Moreover, lexical conventions demand that the *STRING* token "shall
> > represent a string constant" in which "a <newline> shall not occur".
> >
> > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html
> >
> > Best regards,
> > Samy Mahmoudi
>
> Thanks for the pointer and the patch. Unfortunately, your code
> doesn't quite match what Brian's awk does, since \-<newline> is
> allowed inside strings:
>
> $ nawk -v x='abc\
> > def' 'BEGIN { print x }'
> abc
> def
>
> I will look into adapting your patch to match his code. nawk and gawk
> are less picky about newlines.
>
> Thanks
>
> Arnold