Re: [Json] ABNF nits

"Manger, James H" <James.H.Manger@team.telstra.com> Fri, 07 June 2013 03:16 UTC

Return-Path: <James.H.Manger@team.telstra.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id B826021F9050 for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 20:16:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.364
X-Spam-Level:
X-Spam-Status: No, score=-0.364 tagged_above=-999 required=5 tests=[AWL=0.537, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id w6+VB19lfWEJ for <json@ietfa.amsl.com>; Thu, 6 Jun 2013 20:16:02 -0700 (PDT)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by ietfa.amsl.com (Postfix) with ESMTP id D217E21F90A5 for <json@ietf.org>; Thu, 6 Jun 2013 20:15:54 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.87,819,1363093200"; d="scan'208";a="140016758"
Received: from unknown (HELO ipcavi.tcif.telstra.com.au) ([10.97.217.200]) by ipobvi.tcif.telstra.com.au with ESMTP; 07 Jun 2013 13:15:50 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7098"; a="189240457"
Received: from wsmsg3703.srv.dir.telstra.com ([172.49.40.171]) by ipcavi.tcif.telstra.com.au with ESMTP; 07 Jun 2013 13:15:50 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3703.srv.dir.telstra.com ([172.49.40.171]) with mapi; Fri, 7 Jun 2013 13:15:49 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: "Joe Hildebrand (jhildebr)" <jhildebr@cisco.com>, "json@ietf.org" <json@ietf.org>
Date: Fri, 07 Jun 2013 13:15:48 +1000
Thread-Topic: ABNF nits
Thread-Index: AQHOYxhuLNPlu69CpUeh/eSpf1GKTZkpg97A///1nACAABksoA==
Message-ID: <255B9BB34FB7D647A506DC292726F6E1151B21F8CA@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E1151B21F79E@WSMSG3153V.srv.dir.telstra.com> <A723FC6ECC552A4D8C8249D9E07425A70FC326C8@xmb-rcd-x10.cisco.com>
In-Reply-To: <A723FC6ECC552A4D8C8249D9E07425A70FC326C8@xmb-rcd-x10.cisco.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Subject: Re: [Json] ABNF nits
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/json>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 07 Jun 2013 03:16:09 -0000

> >> Some things I found futzing with the ABNF:
> >>
> >> - normalize the indentation (makes it easier to pull out)
> >> - Hex literals need to be uppercase.  The false and null rules are
> >> wrong.
> >
> >Lowercase is allowed in hex literals.
> >It links back to HEXDIG in RFC5234 (or RFC 4234).
> >You have to remember the sneaky ABNF rule that quoted strings (eg "A")
> >are case insensitive. "A" is equivalent to %x41 / %x61.
> 
> Crap.  I didn't see that because it's in a "Note:" in section 2.3.

I didn't call it "sneaky" for nothing ;)

> Regardless, we should change  both of those rules for consistency with
> the rest of the doc.
> 
> >> - DIGIT and HEXDIG are neither defined nor imported, as far as I can
> >> tell.
> >>  I suggest:
> >>
> >> DIGIT = %x30-39                        ; 0-9
> >> HEXDIG = %x30-39 / %x41-46 / %x61-66   ; 0-9, A-F, or a-f
> 
> I still recommend being explicit about this, like the rule for e.

I agree.
Add DIGIT and HEXDIG to the doc so all the ABNF is present.
Use your definition of HEXDIG above, not the RFC5234 one, to avoid the sneaky ABNF rule.
Optionally add a note "; DIGIT and HEXDIG are equivalent to rules with the same names in [RFC5234]".

--
James Manger