GithubHelp home page GithubHelp logo

etsangsplk / hujson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tailscale/hujson

0.0 1.0 0.0 208 KB

HuJSON: JSON for Humans (comments and trailing commas)

License: BSD 3-Clause "New" or "Revised" License

Go 100.00%

hujson's Introduction

HuJSON - Human JSON

The HuJSON decoder is a JSON decoder that also allows

  • comments, both /* ... */ and // to end of line
  • trailing commas on arrays and object members

It is a soft fork of the Go standard library encoding/json package. The plan is to merge in all changes from each Go release.

Currently HuJSON is based on Go 1.13.

Grammar

The changes to the JSON grammar are:

--- grammar.json
+++ grammar.hujson
@@ -1,13 +1,31 @@
 members
 	member
+	member ',' ws
 	member ',' members
 
 elements
 	element
+	element ',' ws
 	element ',' elements
 
+comments
+	"*/"
+	comment comments
+
+comment
+	'0000' . '10FFFF'
+
+linecomments
+	'\n'
+	linecomment
+
+linecomment
+	'0000' . '10FFFF' - '\n'
+
 ws
 	""
+	"/*" comments
+	"//" linecomments
 	'0020' ws
 	'000A' ws
 	'000D' ws

hujson's People

Contributors

bradfitz avatar crawshaw avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.