bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] errout: wrong source line reported


From: Wolfgang Laun
Subject: Re: [bug-gawk] errout: wrong source line reported
Date: Sun, 2 Apr 2017 09:16:58 +0200

To the parser, the error isn't really manifest until "firm ground" is reached. A colon is a valid symbol, and so the _expression_ cannot be processed until a delimiter (;) or EOF is seen. Note that the lines below are a valid if rather useless awk program:

some text
# comment
# comment
is fine

(Remember Brian Kernighan's statement re awk's concatenation operator: "It seemed like a good idea at the time.")

If you like puzzles, here is one: If you add a BEGIN { ... } to this program, what is the minimum you need to insert at the ellipsis to make the program produce some output?

-W

On 1 April 2017 at 23:15, Denis Shirokov <address@hidden> wrote:
No. Actually no :)

2 апр. 2017 г. 0:14 пользователь "Andrew J. Schorr" <address@hiddeninvestments.com> написал:

Are you having trouble finding the bug? :-)
Probably just some weirdness in the YACC parsing
related to comments and/or white space. Does it actually
matter?

On Sat, Apr 01, 2017 at 11:22:48PM +0300, Denis Shirokov wrote:
> hello
>
> (please see screenshot attached)
>
> there is two examples of how we can reproduce the issue.
> at the left part of the screen you may see the gawk source, at the
> right part of the screen - it's error output.
>
> it's seems like the gawk reporting wrong source line error
>
> kind regards
> Denis Shirokov


reply via email to

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