Skip to content

Klug76/hxjson5

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MIT License Build Status

json5mod

JSON5 parser and encoder for Haxe.

This library uses some ideas from https://github.com/nadako/hxjsonast/. It implements the JSON5 parser with some extensions from HJSON:

  • Identifiers not wrapped in quotes.
  • Single-quotes for strings.
  • HJSON style comments.
  • HJSON style multi-line strings.
  • Dangling commas (commas are even optional).
  • Numbers may be hexadecimal.
  • Numbers may have a leading or trailing decimal point.
  • The parser returns a typed object (which can be converted to Any)

Usage

import gs.json5mod.Json5;
var y = Json5.parse("{}");

The demo folder contains an example for openfl with simple live reload support. demo

Links:

https://json5.org/

https://github.com/json5/json5

http://hjson.org/

https://github.com/hjson/

https://github.com/nadako/hxjsonast