[Top][All Lists]

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

Re: two json.el bugs

From: Yuri Khan
Subject: Re: two json.el bugs
Date: Sat, 6 May 2017 01:44:59 +0700

On Sat, May 6, 2017 at 12:51 AM, Theresa O'Connor <address@hidden> 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.

reply via email to

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