Andy - mainly I expect never to see an error message that says "internal error" from any software. If/when I do see that (or get a core dump), I expect the author of the software to want to be informed as it indicates a bug in their software.
Beyond that - I expect this:
$ awk 'BEGIN{ $i++ = 3; print i }'
awk: cmd. line:1: fatal: internal error line 5032, file: awkgram.y
to behave identically to either of these:
$ awk 'BEGIN{ $(i++) = 3; print i }'1
$ awk 'BEGIN{ ($i)++ = 3; print i }'awk: cmd. line:1: BEGIN{ ($i)++ = 3; print i }awk: cmd. line:1: ^ syntax error
When I first wrote "$i++" I expected the semantics to be the same as "$(i++)" since nothing else would make sense to write, but if for whatever reason it needs to be treated the same as "($i)++", that's fine too. Either way though I wouldn't expect to get an "internal error".
Ed.
From: "Andrew J. Schorr" <address@hidden>
To: "Ed Morton" <address@hidden>
Cc: address@hidden
Sent: Monday, October 7, 2013 8:57:44 AM
Subject: Re: [bug-gawk] gawk internal error on $i++
Hi,
On Mon, Oct 07, 2013 at 08:17:48AM -0500, Ed Morton wrote:
> On cygwin on Windows 7:
>
> $ awk 'BEGIN{ $i++ = 3; print i }'
> awk: cmd. line:1: fatal: internal error line 5032, file: awkgram.y
>
> $ awk --version
> GNU Awk 4.1.0, API: 1.0 (GNU MPFR 3.1.2, GNU MP 5.1.2)
Is your point that this script should be rejected by the parser as a syntax
error? Or do you expect some other behavior (and if so what)?
Regards,
Andy