From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: two json.el bugs Date: Sat, 27 May 2017 13:32:20 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11417fb252dec50550817ccf" X-Trace: blaine.gmane.org 1495891998 20739 195.159.176.226 (27 May 2017 13:33:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 27 May 2017 13:33:18 +0000 (UTC) Cc: Emacs developers To: Yuri Khan , "Theresa O'Connor" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 27 15:33:13 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dEbqD-0005HL-9l for ged-emacs-devel@m.gmane.org; Sat, 27 May 2017 15:33:13 +0200 Original-Received: from localhost ([::1]:40838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEbqI-0003A0-SN for ged-emacs-devel@m.gmane.org; Sat, 27 May 2017 09:33:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39132) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dEbpY-00038y-9U for emacs-devel@gnu.org; Sat, 27 May 2017 09:32:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dEbpX-0002iY-4Q for emacs-devel@gnu.org; Sat, 27 May 2017 09:32:32 -0400 Original-Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:33210) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dEbpW-0002iH-VT for emacs-devel@gnu.org; Sat, 27 May 2017 09:32:31 -0400 Original-Received: by mail-oi0-x235.google.com with SMTP id w10so40549230oif.0 for ; Sat, 27 May 2017 06:32:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=auQhBeF2ozxi1TqDyim6enh4ZJpfVCTnDRq8Kjs8THU=; b=t71t/LEkJBixPqwyB5M8Orv7ricYkvYlWSIj0MwGuzXSmxYig+yMK2+5Fkvhfx1eDZ XhRJ/87bF0JZz6IX522+pPSgv19SfaG/FBNfuiBYelkMJWwI+NdGTKL3pf6o5AOPlmu2 IMQn6ITE7x9hkyVrgrg8HUUJktE2OliIF0bsj/cHt9AgR8xX23v70j4NqB636aJH2mwk kVgnHAVrLCiUC7DPctbaU3YGIFUgO0r3H8W32qv46mTnaJ0OWcWEHgLVTrhhIcfTsTLS D2xcyyrnULXgZdmx7Z5wnApjpABq3izvVZVNmT9hNAzcecLss4Ivu22UuO6i+8T29n/r u6LQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=auQhBeF2ozxi1TqDyim6enh4ZJpfVCTnDRq8Kjs8THU=; b=ZFKLDwSc41//T42JF4vQAI91Psambl+hhSwSRUoKXgjK3fPweScwCbOo1A9gvVbRbd BbR8Lc+GuJZG5SAK9eAXZHNGc3YHhlswy63/cuGhy3UAxD/7GQ7uVq/nMxBXiFYms4Y+ +M/Acd5zml2SOEGhaRFPc7LE7rNlDQgTSO0LdC2csMBMGmtoFXrmnQOndyj8H5L0spLW 2VkcTxUiRj+MTR2R+lbpdML2dXwfRlzvsXMuGri41PZSwpNhne++15o25svLRI3nSs2V JeTorL4wVvxBs5G7lNFP608mXRCM9xHxv+ggglBuTTsnvbdxhQTZnJOMy5c+GdnEZ3Je 7KmA== X-Gm-Message-State: AODbwcBswMWGQIbWoFddcSvYLGBUuAcLfHHWPwzedTTe/5wjC5L8YMI7 9PpnOauRHPzvYDKqpZzJOelMDVrS6Q== X-Received: by 10.157.54.204 with SMTP id s12mr3090138otd.143.1495891950360; Sat, 27 May 2017 06:32:30 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4003:c06::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:215266 Archived-At: --001a11417fb252dec50550817ccf Content-Type: text/plain; charset="UTF-8" Yuri Khan schrieb am Fr., 5. Mai 2017 um 20:45 Uhr: > On Sat, May 6, 2017 at 12:51 AM, Theresa O'Connor > wrote: > > > 1. `json-skip-whitespace' uses a hardcoded list of whitespace > > characters, which means it fails to skip over other WSpace=Y > > characters. It should probably use `search-whitespace-regexp' from > > isearch.el (or an equivalent value from elsewhere) instead. > > JSON is defined by the standard [ECMA-404][1]. > > [1]: > http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf > > Section 4, paragraph the last: > > | Insignificant whitespace is allowed before or after any token. > | The whitespace characters are: character tabulation (U+0009), > | line feed (U+000A), carriage return (U+000D), and space (U+0020). > > In my copy of Emacs 25.1, json-skip-whitespace looks like this: > > (defun json-skip-whitespace () > "Skip past the whitespace at point." > (skip-chars-forward "\t\r\n\f\b ")) > > that is, it skips the whitespace characters defined by the spec, and > in addition to that, also form feed (U+000C) and backspace (U+0007). > > If anything, \f\b should be *removed* from characters to be skipped. > > I've done that in commit 32f80eb678c4dc6335063cc39975bbce2766829a. --001a11417fb252dec50550817ccf Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Yuri K= han <yuri.v.khan@gmail.com&= gt; schrieb am Fr., 5. Mai 2017 um 20:45=C2=A0Uhr:
On Sat, May 6, 2017 at 12:51 AM, Theresa O'Connor <<= a href=3D"mailto:hober0@gmail.com" target=3D"_blank">hober0@gmail.com&g= t; wrote:

> 1. `json-skip-whitespace' uses a hardcoded list of whitespace
> characters, which means it fails to skip over other WSpace=3DY
> characters. It should probably use `search-whitespace-regexp' from=
> isearch.el (or an equivalent value from elsewhere) instead.

JSON is defined by the standard [ECMA-404][1].

[1]: http://www.ecma-intern= ational.org/publications/files/ECMA-ST/ECMA-404.pdf

Section 4, paragraph the last:

| Insignificant whitespace is allowed before or after any token.
| The whitespace characters are: character tabulation (U+0009),
| line feed (U+000A), carriage return (U+000D), and space (U+0020).

In my copy of Emacs 25.1, json-skip-whitespace looks like this:

(defun json-skip-whitespace ()
=C2=A0 "Skip past the whitespace at point."
=C2=A0 (skip-chars-forward "\t\r\n\f\b "))

that is, it skips the whitespace characters defined by the spec, and
in addition to that, also form feed (U+000C) and backspace (U+0007).

If anything, \f\b should be *removed* from characters to be skipped.


I've done that in commit 32f80eb67= 8c4dc6335063cc39975bbce2766829a.=C2=A0
--001a11417fb252dec50550817ccf--