bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] pretty-print eats parentheses (3)


From: arnold
Subject: Re: [bug-gawk] pretty-print eats parentheses (3)
Date: Tue, 20 Jun 2017 11:56:07 -0600
User-agent: Heirloom mailx 12.4 7/29/08

Well, that's an interesting one. I'll look into it.

Thanks,

Arnold

Hermann Peifer <address@hidden> wrote:

> Hi,
>
> I just noted a case where original and pretty-printed
> code have different calculation results, see the sample
> code below. I remember having reported similar issues earlier,
> e.g. http://lists.gnu.org/archive/html/bug-gawk/2014-11/msg00006.html. I
> guess it is tricky to get these parentheses exactly right.
>
> Hermann
>
> # Sample code: so far, so good
> $ gawk 'BEGIN{ print 10 - (1 + 3 * 3) }'
> 0
>
> # Pretty-printed code gets to a different result
> $ gawk -o 'BEGIN{ print 10 - (1 + 3 * 3) }' && gawk -f awkprof.out
> 18
>
> $ cat awkprof.out
> BEGIN {
>       print 10 - 1 + 3 * 3
> }
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]