All Projects → tailscale → Hujson

tailscale / Hujson

Licence: bsd-3-clause
HuJSON: JSON for Humans (comments and trailing commas)

Programming Languages

go
31211 projects - #10 most used programming language

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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].