From: Alex Kost <alezost@gmail.com>
To: ndame <emacsuser@freemail.hu>
Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
Subject: Re: Can the json reader be a bit more lenient?
Date: Sat, 03 Aug 2019 19:14:52 +0300 [thread overview]
Message-ID: <87mugqmdj7.fsf@gmail.com> (raw)
In-Reply-To: <AxvIkQ.ehfYo24vcBXB.C7wgqAJ4FGqa5rtCEF@freemail.hu> (ndame's message of "Wed, 31 Jul 2019 13:52:38 +0200 (CEST)")
ndame (2019-07-31 13:52 +0200) wrote:
> Lately I've been using emacs for some text data processing, and the
> input is json sometimes. The problem is the json often comes like
> this:
>
> [{'time1: '8:00', 'time2': '13:00', ...
>
> and the emacs reader chokes on it saying
>
> doesn't start with "!
This error comes from 'json-read-string' function.
> Now I know the json standard says attribute names should be double quoted,
> but can it be somehow persuaded to accept single quotes instead?
Not easily: I think the only way is to override the mentioned function.
> It would be great to have an option for this when I know the data is
> correct, only it uses single quotes instead of doubles.
I think this feature request should be sent with "M-x report-emacs-bug".
It's unlikely it will be noticed on this mailing list.
--
Alex
next prev parent reply other threads:[~2019-08-03 16:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-31 11:52 Can the json reader be a bit more lenient? ndame
2019-08-03 16:14 ` Alex Kost [this message]
2019-08-03 18:47 ` Yuri Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mugqmdj7.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=emacsuser@freemail.hu \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.