Allow unquoted object field names #10

Open
opened 2020-11-05 03:14:58 +01:00 by p · 0 comments
Owner

Just like in jq:

If the keys are "identifier-like", then the quotes can be left off

This is hugely more convenient to write. The highlighter already contains a lot of the necessary parsing code, it just needs to learn to recognize bare words ([a-zA-Z_]*), which we'll simply wrap in strings before passing the whole chunk to Jansson like we do now.

Of course, the shell could make use of way more extensions but:

  1. C is the wrong language entirely to build anything of such complexity just for fun, and
  2. fuck terminal UI in general.
Just like in `jq`: > If the keys are "identifier-like", then the quotes can be left off This is hugely more convenient to write. The highlighter already contains a lot of the necessary parsing code, it just needs to learn to recognize bare words ([a-zA-Z\_]\*), which we'll simply wrap in strings before passing the whole chunk to Jansson like we do now. Of course, the shell could make use of way more extensions but: 1. C is the wrong language entirely to build anything of such complexity just for fun, and 2. fuck terminal UI in general.
p added this to the v1.3.0 milestone 2020-11-05 03:14:59 +01:00
p self-assigned this 2020-11-05 03:14:59 +01:00
Sign in to join this conversation.
No Label
WIP
easy
priority
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: p/json-rpc-shell#10
No description provided.