Re: [Json] Leading and trailing whitespace

Paul Hoffman <paul.hoffman@vpnc.org> Tue, 11 June 2013 16:06 UTC

Return-Path: <paul.hoffman@vpnc.org>
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 5B14821F8F2F for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 09:06:14 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.45
X-Spam-Level:
X-Spam-Status: No, score=-102.45 tagged_above=-999 required=5 tests=[AWL=0.149, BAYES_00=-2.599, USER_IN_WHITELIST=-100]
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 dYE9wFRcLZp1 for <json@ietfa.amsl.com>; Tue, 11 Jun 2013 09:06:13 -0700 (PDT)
Received: from hoffman.proper.com (IPv6.Hoffman.Proper.COM [IPv6:2605:8e00:100:41::81]) by ietfa.amsl.com (Postfix) with ESMTP id C810E21F8D6D for <json@ietf.org>; Tue, 11 Jun 2013 09:06:13 -0700 (PDT)
Received: from [10.20.30.90] (50-0-66-165.dsl.dynamic.sonic.net [50.0.66.165]) (authenticated bits=0) by hoffman.proper.com (8.14.5/8.14.5) with ESMTP id r5BG6BFN088236 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO) for <json@ietf.org>; Tue, 11 Jun 2013 09:06:12 -0700 (MST) (envelope-from paul.hoffman@vpnc.org)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Mac OS X Mail 6.5 \(1508\))
From: Paul Hoffman <paul.hoffman@vpnc.org>
In-Reply-To: <B0660BD8-5D82-4D35-BD0E-DC2212198C7B@tzi.org>
Date: Tue, 11 Jun 2013 09:06:11 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <51B73868-AA72-439E-B422-BF6A2B0E83ED@vpnc.org>
References: <06c101ce6625$0f891bf0$2e9b53d0$@augustcellars.com> <379266A1-82C1-4FF5-BD7C-EE657F1FD41F@vpnc.org> <06e901ce6638$e8f27a90$bad76fb0$@augustcellars.com> <51DE7E41-D682-4340-A234-7F7CFE513C10@vpnc.org> <070b01ce664b$e5e0ac10$b1a20430$@augustcellars.com> <6E03D281-D6BA-424D-A30A-3DA18E61A051@vpnc.org> <CAK3OfOiBmzCdQtyUFoBkSFMFJijE7K8eR+9YUv7bhD2YaQBW2Q@mail.gmail.com> <B0660BD8-5D82-4D35-BD0E-DC2212198C7B@tzi.org>
To: json@ietf.org
X-Mailer: Apple Mail (2.1508)
Subject: Re: [Json] Leading and trailing whitespace
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: Tue, 11 Jun 2013 16:06:14 -0000

On Jun 10, 2013, at 10:14 PM, Carsten Bormann <cabo@tzi.org> wrote:

> On Jun 11, 2013, at 05:42, Nico Williams <nico@cryptonector.com> wrote:
> 
>> Do implementations that allow any value type at the top-level allow
>> leading and/or trailing whitespace?
> 
> Yes.  E.g.,
> 
>>> JSON.parse("\r\n \t 27 \r\n \t", quirks_mode: true)
> => 27
> 
> (quirks_mode is the flag that switches on the non-coforming acceptance of any "value".)
> 
>> *Should* they?
> 
> Yes.
> 
> (If you are not convinced from first principles: people have argued you can do streaming by adding whitespace, and that required being allowed to add whitespace :-)
> 
> So we will have to add a production:
> 
> 	JSON-value = ws value ws
> 
> That didn't seem too hard.

Question: are you saying we should do that even if we don't allow all values at the top level, or only if we add them at the top level?

--Paul Hoffman