bug-gawk
[Top][All Lists]
Advanced

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

[bug-gawk] use of ;; as terminator, request for grammar help


From: Eric Blake
Subject: [bug-gawk] use of ;; as terminator, request for grammar help
Date: Thu, 03 Apr 2014 10:18:54 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0

Hello GNU awk readers,

On today's Austin Group call (the people in charge of POSIX), we visited
http://austingroupbugs.net/view.php?id=226.

This is in regards to the POSIX awk specification at:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html

Among other things, there were two action items pointed out that this
list might be able to help with:

1. GNU awk has a bug regarding ;; as a terminator.  The POSIX grammar
allows for:
awk '{print};;{print}'
but gawk rejects this case.  This was deemed to be a bug in gawk, since
POSIX was based on the nawk behavior at the time POSIX was standardized,
and nawk has always supported this.  Remember, the grammar specified in
POSIX states:

> terminator : terminator ';'
> | terminator NEWLINE
> | ';'
> | NEWLINE
> ;

which allows two ';' in a row, and nothing else in the normative text
mentions that an empty statement must be rejected.

2. Based on existing implementations, there is consensus that the POSIX
grammar is overly restrictive, and that we should change it to permit:
    awk '{print} {print}'
and:
    awk '/foo/; {print}'

since existing implementations all support it.  But to do that, we need
someone with help in writing grammars to propose the changes to the one
appearing on the POSIX page.  Any input would be appreciated.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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