libpdjson5/JSON5E.md at master · boris-kolpackov/libpdjson5 · GitHub
//blob/show" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
//blob/show;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
boris-kolpackov
libpdjson5
Public
Notifications<br>You must be signed in to change notification settings
Fork
Star
FilesExpand file tree
master
/JSON5E.md
Copy path
Blame<br>More file actions
Blame<br>More file actions
Latest commit
History<br>History<br>History
138 lines (101 loc) · 2 KB
master
/JSON5E.md
Copy path
Top
File metadata and controls<br>Preview
Code
Blame
138 lines (101 loc) · 2 KB
Raw<br>Copy raw file<br>Download raw file
Edit and raw actions
JSON5E - JSON5 for Humans
JSON5E is an extension of the JSON5 format that aims to be even more natural<br>to write and maintain by hand. Where JSON5 retains the overall JSON shape and<br>draws on ECMAScript 5 for inspiration, JSON5E tries harder to approximate the<br>look and feel of a typical configuration file found in /etc while retaining<br>the JSON object model.
Specifically, JSON5E extends JSON5 with the following syntax:
Implied top-level objects.
JSON5:
delay: 10,<br>timeout: 30
JSON5E:
delay: 10,<br>timeout: 30
Note that top-level arrays and simple values are still supported (but there<br>are no implied top-level arrays).
Newline in addition to comma as a separator.
JSON5:
delay: 10,<br>timeout: 30
JSON5E:
delay: 10<br>timeout: 30
Note that it must be a newline, not just a whitespace.
- and . are allowed in unquoted object member names.
But not as a first character.
JSON5:
'connection-delay': 10,<br>'connection-timeout': 30
JSON5E:
connection-delay: 10,<br>connection-timeout: 30
#-style comments in addition to // and /* */.
JSON5:
// Initial delay before connecting.<br>//<br>delay: 10,
// Connection timeout.<br>//<br>timeout: 30
JSON5E:
# Initial delay before connecting.<br>delay: 10,
# Connection timeout.<br>timeout: 30
Putting it all together, JSON5:
// Initial delay before connecting.<br>//<br>'connection-delay': 10,
// Connection timeout.<br>//<br>'connection-timeout': 30
JSON5E:
# Initial delay before connecting.<br>connection-delay: 10
# Connection timeout.<br>connection-timeout: 30
Which looks a lot more like a typical configuration file.
The following parser implementations support JSON5E:
C: libpdjson5
C++: libstud-json
You can’t perform that action at this time.