pax_global_header00006660000000000000000000000064137306107710014517gustar00rootroot0000000000000052 comment=9aabfb5014722eab97bfd0afb2bc8a1f8f91425c hjson-go-3.1.0/000077500000000000000000000000001373061077100132445ustar00rootroot00000000000000hjson-go-3.1.0/.gitignore000066400000000000000000000000001373061077100152220ustar00rootroot00000000000000hjson-go-3.1.0/.travis.yml000066400000000000000000000033571373061077100153650ustar00rootroot00000000000000language: go go: - 1.6 - 1.7 - 1.8 - tip install: true script: - go install github.com/hjson/hjson-go - go install github.com/hjson/hjson-go/hjson-cli - go test -v github.com/hjson/hjson-go before_deploy: - ./build_release.sh deploy: provider: releases file: - _dist/darwin_386.tar.gz - _dist/darwin_amd64.tar.gz - _dist/dragonfly_amd64.tar.gz - _dist/freebsd_386.tar.gz - _dist/freebsd_amd64.tar.gz - _dist/freebsd_arm.tar.gz - _dist/linux_386.tar.gz - _dist/linux_amd64.tar.gz - _dist/linux_arm.tar.gz - _dist/linux_arm64.tar.gz - _dist/linux_mips64.tar.gz - _dist/linux_mips64le.tar.gz - _dist/linux_ppc64.tar.gz - _dist/linux_ppc64le.tar.gz - _dist/netbsd_386.tar.gz - _dist/netbsd_amd64.tar.gz - _dist/netbsd_arm.tar.gz - _dist/openbsd_386.tar.gz - _dist/openbsd_amd64.tar.gz - _dist/openbsd_arm.tar.gz - _dist/plan9_386.tar.gz - _dist/plan9_amd64.tar.gz - _dist/solaris_amd64.tar.gz - _dist/windows_386.zip - _dist/windows_amd64.zip overwrite: true skip_cleanup: true on: tags: true go: 1.7 api-key: secure: RAnrBG7xantKdUBlIsv8Od9yZ0GTwCsJ7d1V+hSEC3JSz76+Ie4v1nJw+rD0Rp25zxDAM2qSkMfIaQJVSQ5tYg3N8C/d+/lfeRNBwLhHEsQztsaE5BU0I/qrkKq0pGMoG+cu6ZJ06xEgECPKOamwQ2wSY0IiIwVn0eNN/ufMsZUTmPgBE4+lx9eEWYDqMxy4tfgLMC/ry2fnA3zc4fQk0TboodLkI0SgwMq7cHcm95j9kHWpydbwr8IhQ6pucLM9YuKGv2fNHywlQ6Z9rhpYdiK/9KUofW20Rm4OB1MBHLLhLdQ0qCkVPswhGRdFPcBcN7lvv8Czcp3Hl4LQ4UzxOXf58mEWbh4r6VbUjZgRnpMy8Ms9CcyLjwaRbJPKA/kI53yjeEViFbDlOtBV8qdVqx5orCUrpU2ML/iEltVDL7pukhjuKd0K/2c3s8gJwH4LaGEfQjj2DvYkQgK0XsWSOXhYF4LaN0qhiQ3xiss1bhjJIIIhD3PHPy+dCsazKoJtNRHoUyP9RYz8EjcwI7BsaEEzskaXuUSvLz3+k6f6DZvPydUDXDGYqX0H2dXCT5H0IaCrSAkDVcGageXt4vkzKb45/el1W5VME/q/WpGAIPfsJ2beR7ALlm1RhXdWTJpwq6LM/YbYy/6U/HlqQCwB4x/nwKXy1ToDukCrHy57yGU= hjson-go-3.1.0/LICENSE000066400000000000000000000020661373061077100142550ustar00rootroot00000000000000MIT License Copyright (c) 2016, 2017 Christian Zangl Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. hjson-go-3.1.0/README.md000066400000000000000000000103551373061077100145270ustar00rootroot00000000000000# hjson-go [![Build Status](https://img.shields.io/travis/hjson/hjson-go.svg?style=flat-square)](https://travis-ci.org/hjson/hjson-go) [![Go Pkg](https://img.shields.io/github/release/hjson/hjson-go.svg?style=flat-square&label=go-pkg)](https://github.com/hjson/hjson-go/releases) [![Go Report Card](https://goreportcard.com/badge/github.com/hjson/hjson-go?style=flat-square)](https://goreportcard.com/report/github.com/hjson/hjson-go) [![coverage](https://img.shields.io/badge/coverage-ok-brightgreen.svg?style=flat-square)](http://gocover.io/github.com/hjson/hjson-go/) [![godoc](https://img.shields.io/badge/godoc-reference-blue.svg?style=flat-square)](https://godoc.org/github.com/hjson/hjson-go) ![Hjson Intro](https://hjson.github.io/hjson1.gif) ``` { # specify rate in requests/second (because comments are helpful!) rate: 1000 // prefer c-style comments? /* feeling old fashioned? */ # did you notice that rate doesn't need quotes? hey: look ma, no quotes for strings either! # best of all notice: [] anything: ? # yes, commas are optional! } ``` The Go implementation of Hjson is based on [hjson-js](https://github.com/hjson/hjson-js). For other platforms see [hjson.github.io](https://hjson.github.io). # Install Make sure you have a working Go environment. See the [install instructions](http://golang.org/doc/install.html). 1. Get the sources ```bash $ go get -u github.com/hjson/hjson-go ``` 2. Build the **hjson-cli** commandline tool (optional) ```bash $ cd $(go env GOPATH)/src/github.com/hjson/hjson-go/hjson-cli && go install $ hjson-cli --version ``` # Usage as command line tool ``` usage: hjson-cli [OPTIONS] [INPUT] hjson can be used to convert JSON from/to Hjson. hjson will read the given JSON/Hjson input file or read from stdin. Options: -allowMinusZero Allow -0. -bracesSameLine Print braces on the same line. -c Output as JSON. -h Show this screen. -indentBy string The indent string. (default " ") -j Output as formatted JSON. -omitRootBraces Omit braces at the root. -quoteAlways Always quote string values. ``` Sample: - run `hjson-cli test.json > test.hjson` to convert to Hjson - run `hjson-cli -j test.hjson > test.json` to convert to JSON # Usage as a GO library ```go package main import ( "github.com/hjson/hjson-go" "fmt" ) func main() { // Now let's look at decoding Hjson data into Go // values. sampleText := []byte(` { # specify rate in requests/second rate: 1000 array: [ foo bar ] }`) // We need to provide a variable where Hjson // can put the decoded data. var dat map[string]interface{} // Decode and a check for errors. if err := hjson.Unmarshal(sampleText, &dat); err != nil { panic(err) } fmt.Println(dat) // In order to use the values in the decoded map, // we'll need to cast them to their appropriate type. rate := dat["rate"].(float64) fmt.Println(rate) array := dat["array"].([]interface{}) str1 := array[0].(string) fmt.Println(str1) // To encode to Hjson with default options: sampleMap := map[string]int{"apple": 5, "lettuce": 7} hjson, _ := hjson.Marshal(sampleMap) // this is short for: // options := hjson.DefaultOptions() // hjson, _ := hjson.MarshalWithOptions(sampleMap, options) fmt.Println(string(hjson)) } ``` If you prefer, you can also unmarshal to Go objects by converting to JSON: ```go package main import ( "github.com/hjson/hjson-go" "encoding/json" "fmt" ) type Sample struct { Rate int Array []string } func main() { sampleText := []byte(` { # specify rate in requests/second rate: 1000 array: [ foo bar ] }`) // read Hjson var dat map[string]interface{} hjson.Unmarshal(sampleText, &dat) // convert to JSON b, _ := json.Marshal(dat) // unmarshal var sample Sample json.Unmarshal(b, &sample) fmt.Println(sample.Rate) fmt.Println(sample.Array) } ``` # API [![godoc](https://godoc.org/github.com/hjson/hjson-go?status.svg)](http://godoc.org/github.com/hjson/hjson-go) # History [see releases](https://github.com/hjson/hjson-go/releases) hjson-go-3.1.0/assets/000077500000000000000000000000001373061077100145465ustar00rootroot00000000000000hjson-go-3.1.0/assets/charset2_result.hjson000066400000000000000000000001271373061077100207220ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" umlaut: äöüßÄÖÜ hex: ģ䕧覫췯ꯍ }hjson-go-3.1.0/assets/charset2_result.json000066400000000000000000000001401373061077100205450ustar00rootroot00000000000000{ "uescape": "\u0000,\u0001,￿", "umlaut": "äöüßÄÖÜ", "hex": "ģ䕧覫췯ꯍ" }hjson-go-3.1.0/assets/charset2_test.hjson000066400000000000000000000001551373061077100203640ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" umlaut: äöüßÄÖÜ hex: "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A" } hjson-go-3.1.0/assets/charset_result.hjson000066400000000000000000000005071373061077100206420ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ }hjson-go-3.1.0/assets/charset_result.json000066400000000000000000000005331373061077100204710ustar00rootroot00000000000000{ "ql-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "js-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ml-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" }hjson-go-3.1.0/assets/charset_test.hjson000066400000000000000000000005401373061077100203000ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ml-ascii: ''' ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ''' } hjson-go-3.1.0/assets/comments_result.hjson000066400000000000000000000011151373061077100210320ustar00rootroot00000000000000{ foo1: This is a string value. # part of the string foo2: This is a string value. bar1: This is a string value. // part of the string bar2: This is a string value. foobar1: This is a string value./* part of the string */ foobar2: This is a string value. rem1: "# test" rem2: "// test" rem3: "/* test */" num1: 0 num2: 0 num3: 2 true1: true true2: true true3: true false1: false false2: false false3: false null1: null null2: null null3: null str1: 00 # part of the string str2: 00.0 // part of the string str3: 02 /* part of the string */ }hjson-go-3.1.0/assets/comments_result.json000066400000000000000000000012461373061077100206670ustar00rootroot00000000000000{ "foo1": "This is a string value. # part of the string", "foo2": "This is a string value.", "bar1": "This is a string value. // part of the string", "bar2": "This is a string value.", "foobar1": "This is a string value./* part of the string */", "foobar2": "This is a string value.", "rem1": "# test", "rem2": "// test", "rem3": "/* test */", "num1": 0, "num2": 0, "num3": 2, "true1": true, "true2": true, "true3": true, "false1": false, "false2": false, "false3": false, "null1": null, "null2": null, "null3": null, "str1": "00 # part of the string", "str2": "00.0 // part of the string", "str3": "02 /* part of the string */" }hjson-go-3.1.0/assets/comments_test.hjson000066400000000000000000000017041373061077100204770ustar00rootroot00000000000000// test # all // comment /* styles */ # with lf # ! { # hjson style comment foo1: This is a string value. # part of the string foo2: "This is a string value." # a comment // js style comment bar1: This is a string value. // part of the string bar2: "This is a string value." // a comment /* js block style comments */foobar1:/* more */This is a string value./* part of the string */ /* js block style comments */foobar2:/* more */"This is a string value."/* a comment */ rem1: "# test" rem2: "// test" rem3: "/* test */" num1: 0 # comment num2: 0.0 // comment num3: 2 /* comment */ true1: true # comment true2: true // comment true3: true /* comment */ false1: false # comment false2: false // comment false3: false /* comment */ null1: null # comment null2: null // comment null3: null /* comment */ str1: 00 # part of the string str2: 00.0 // part of the string str3: 02 /* part of the string */ } hjson-go-3.1.0/assets/empty_result.hjson000066400000000000000000000000171373061077100203430ustar00rootroot00000000000000{ "": empty }hjson-go-3.1.0/assets/empty_result.json000066400000000000000000000000211373061077100201660ustar00rootroot00000000000000{ "": "empty" }hjson-go-3.1.0/assets/empty_test.hjson000066400000000000000000000000201373061077100177760ustar00rootroot00000000000000{ "": empty } hjson-go-3.1.0/assets/failCharset1_test.hjson000066400000000000000000000000511373061077100211520ustar00rootroot00000000000000{ # invalid \u char char: "\uxxxx" } hjson-go-3.1.0/assets/failJSON02_test.json000066400000000000000000000000211373061077100202400ustar00rootroot00000000000000["Unclosed array"hjson-go-3.1.0/assets/failJSON05_test.json000066400000000000000000000000301373061077100202430ustar00rootroot00000000000000["double extra comma",,]hjson-go-3.1.0/assets/failJSON06_test.json000066400000000000000000000000321373061077100202460ustar00rootroot00000000000000[ , "<-- missing value"]hjson-go-3.1.0/assets/failJSON07_test.json000066400000000000000000000000321373061077100202470ustar00rootroot00000000000000["Comma after the close"],hjson-go-3.1.0/assets/failJSON08_test.json000066400000000000000000000000201373061077100202450ustar00rootroot00000000000000["Extra close"]]hjson-go-3.1.0/assets/failJSON10_test.json000066400000000000000000000000721373061077100202450ustar00rootroot00000000000000{"Extra value after close": true} "misplaced quoted value"hjson-go-3.1.0/assets/failJSON11_test.json000066400000000000000000000000351373061077100202450ustar00rootroot00000000000000{"Illegal expression": 1 + 2}hjson-go-3.1.0/assets/failJSON12_test.json000066400000000000000000000000371373061077100202500ustar00rootroot00000000000000{"Illegal invocation": alert()}hjson-go-3.1.0/assets/failJSON13_test.json000066400000000000000000000000531373061077100202470ustar00rootroot00000000000000{"Numbers cannot have leading zeroes": 013}hjson-go-3.1.0/assets/failJSON14_test.json000066400000000000000000000000371373061077100202520ustar00rootroot00000000000000{"Numbers cannot be hex": 0x14}hjson-go-3.1.0/assets/failJSON15_test.json000066400000000000000000000000421373061077100202470ustar00rootroot00000000000000["Illegal backslash escape: \x15"]hjson-go-3.1.0/assets/failJSON16_test.json000066400000000000000000000000101373061077100202430ustar00rootroot00000000000000[\naked]hjson-go-3.1.0/assets/failJSON17_test.json000066400000000000000000000000421373061077100202510ustar00rootroot00000000000000["Illegal backslash escape: \017"]hjson-go-3.1.0/assets/failJSON19_test.json000066400000000000000000000000261373061077100202550ustar00rootroot00000000000000{"Missing colon" null}hjson-go-3.1.0/assets/failJSON20_test.json000066400000000000000000000000271373061077100202460ustar00rootroot00000000000000{"Double colon":: null}hjson-go-3.1.0/assets/failJSON21_test.json000066400000000000000000000000401373061077100202420ustar00rootroot00000000000000{"Comma instead of colon", null}hjson-go-3.1.0/assets/failJSON22_test.json000066400000000000000000000000411373061077100202440ustar00rootroot00000000000000["Colon instead of comma": false]hjson-go-3.1.0/assets/failJSON23_test.json000066400000000000000000000000241373061077100202460ustar00rootroot00000000000000["Bad value", truth]hjson-go-3.1.0/assets/failJSON24_test.json000066400000000000000000000000201373061077100202430ustar00rootroot00000000000000['single quote']hjson-go-3.1.0/assets/failJSON26_test.json000066400000000000000000000000461373061077100202550ustar00rootroot00000000000000["tab\ character\ in\ string\ "]hjson-go-3.1.0/assets/failJSON28_test.json000066400000000000000000000000171373061077100202550ustar00rootroot00000000000000["line\ break"]hjson-go-3.1.0/assets/failJSON29_test.json000066400000000000000000000000041373061077100202520ustar00rootroot00000000000000[0e]hjson-go-3.1.0/assets/failJSON30_test.json000066400000000000000000000000051373061077100202430ustar00rootroot00000000000000[0e+]hjson-go-3.1.0/assets/failJSON31_test.json000066400000000000000000000000071373061077100202460ustar00rootroot00000000000000[0e+-1]hjson-go-3.1.0/assets/failJSON32_test.json000066400000000000000000000000501373061077100202450ustar00rootroot00000000000000{"Comma instead if closing brace": true,hjson-go-3.1.0/assets/failJSON33_test.json000066400000000000000000000000141373061077100202460ustar00rootroot00000000000000["mismatch"}hjson-go-3.1.0/assets/failJSON34_test.json000066400000000000000000000001011373061077100202440ustar00rootroot00000000000000A quoteless string is OK, but two must be contained in an array. hjson-go-3.1.0/assets/failKey1_test.hjson000066400000000000000000000000451373061077100203140ustar00rootroot00000000000000{ # invalid name wrong name: 0 } hjson-go-3.1.0/assets/failKey2_test.hjson000066400000000000000000000000401373061077100203100ustar00rootroot00000000000000{ # invalid name {name: 0 } hjson-go-3.1.0/assets/failKey3_test.hjson000066400000000000000000000000431373061077100203140ustar00rootroot00000000000000{ # invalid name key,name: 0 } hjson-go-3.1.0/assets/failKey4_test.hjson000066400000000000000000000000331373061077100203140ustar00rootroot00000000000000{ # invalid name : 0 } hjson-go-3.1.0/assets/failKey5_test.hjson000066400000000000000000000000441373061077100203170ustar00rootroot00000000000000{ # invalid name '''foo''': 0 } hjson-go-3.1.0/assets/failMLStr1_test.hjson000066400000000000000000000000511373061077100205620ustar00rootroot00000000000000{ # invalid multiline string ml: ''' hjson-go-3.1.0/assets/failObj1_test.hjson000066400000000000000000000000521373061077100202740ustar00rootroot00000000000000{ # invalid obj noDelimiter { } } hjson-go-3.1.0/assets/failObj2_test.hjson000066400000000000000000000000411373061077100202730ustar00rootroot00000000000000{ # invalid obj noEnd { } hjson-go-3.1.0/assets/failObj3_test.hjson000066400000000000000000000000461373061077100203010ustar00rootroot00000000000000{ # missing key [ test ] } hjson-go-3.1.0/assets/failStr1a_test.hjson000066400000000000000000000000511373061077100204720ustar00rootroot00000000000000{ # invalid quoteless string ql: ] } hjson-go-3.1.0/assets/failStr1b_test.hjson000066400000000000000000000000521373061077100204740ustar00rootroot00000000000000{ # invalid quoteless string ql: ]x } hjson-go-3.1.0/assets/failStr1c_test.hjson000066400000000000000000000000531373061077100204760ustar00rootroot00000000000000[ foo # invalid quoteless string ] ] hjson-go-3.1.0/assets/failStr1d_test.hjson000066400000000000000000000000541373061077100205000ustar00rootroot00000000000000[ foo # invalid quoteless string ]x ] hjson-go-3.1.0/assets/failStr2a_test.hjson000066400000000000000000000000511373061077100204730ustar00rootroot00000000000000{ # invalid quoteless string ql: } } hjson-go-3.1.0/assets/failStr2b_test.hjson000066400000000000000000000000521373061077100204750ustar00rootroot00000000000000{ # invalid quoteless string ql: }x } hjson-go-3.1.0/assets/failStr2c_test.hjson000066400000000000000000000000531373061077100204770ustar00rootroot00000000000000[ foo # invalid quoteless string } ] hjson-go-3.1.0/assets/failStr2d_test.hjson000066400000000000000000000000541373061077100205010ustar00rootroot00000000000000[ foo # invalid quoteless string }x ] hjson-go-3.1.0/assets/failStr3a_test.hjson000066400000000000000000000000511373061077100204740ustar00rootroot00000000000000{ # invalid quoteless string ql: { } hjson-go-3.1.0/assets/failStr3b_test.hjson000066400000000000000000000000521373061077100204760ustar00rootroot00000000000000{ # invalid quoteless string ql: {x } hjson-go-3.1.0/assets/failStr3c_test.hjson000066400000000000000000000000531373061077100205000ustar00rootroot00000000000000[ foo # invalid quoteless string { ] hjson-go-3.1.0/assets/failStr3d_test.hjson000066400000000000000000000000541373061077100205020ustar00rootroot00000000000000[ foo # invalid quoteless string {x ] hjson-go-3.1.0/assets/failStr4a_test.hjson000066400000000000000000000000511373061077100204750ustar00rootroot00000000000000{ # invalid quoteless string ql: [ } hjson-go-3.1.0/assets/failStr4b_test.hjson000066400000000000000000000000521373061077100204770ustar00rootroot00000000000000{ # invalid quoteless string ql: [x } hjson-go-3.1.0/assets/failStr4c_test.hjson000066400000000000000000000000531373061077100205010ustar00rootroot00000000000000[ foo # invalid quoteless string [ ] hjson-go-3.1.0/assets/failStr4d_test.hjson000066400000000000000000000000541373061077100205030ustar00rootroot00000000000000[ foo # invalid quoteless string [x ] hjson-go-3.1.0/assets/failStr5a_test.hjson000066400000000000000000000000511373061077100204760ustar00rootroot00000000000000{ # invalid quoteless string ql: : } hjson-go-3.1.0/assets/failStr5b_test.hjson000066400000000000000000000000521373061077100205000ustar00rootroot00000000000000{ # invalid quoteless string ql: :x } hjson-go-3.1.0/assets/failStr5c_test.hjson000066400000000000000000000000531373061077100205020ustar00rootroot00000000000000[ foo # invalid quoteless string : ] hjson-go-3.1.0/assets/failStr5d_test.hjson000066400000000000000000000000541373061077100205040ustar00rootroot00000000000000[ foo # invalid quoteless string :x ] hjson-go-3.1.0/assets/failStr6a_test.hjson000066400000000000000000000000511373061077100204770ustar00rootroot00000000000000{ # invalid quoteless string ql: , } hjson-go-3.1.0/assets/failStr6b_test.hjson000066400000000000000000000000521373061077100205010ustar00rootroot00000000000000{ # invalid quoteless string ql: ,x } hjson-go-3.1.0/assets/failStr6c_test.hjson000066400000000000000000000002301373061077100205000ustar00rootroot00000000000000[ # invalid quoteless string # note that if there were a preceding value the comma would # be allowed/ignored as a separator/trailing comma , ] hjson-go-3.1.0/assets/failStr6d_test.hjson000066400000000000000000000002311373061077100205020ustar00rootroot00000000000000[ # invalid quoteless string # note that if there were a preceding value the comma would # be allowed/ignored as a separator/trailing comma ,x ] hjson-go-3.1.0/assets/failStr7a_test.hjson000066400000000000000000000000721373061077100205030ustar00rootroot00000000000000{ # invalid string containing a newline foo : " " } hjson-go-3.1.0/assets/failStr8a_test.hjson000066400000000000000000000000551373061077100205050ustar00rootroot00000000000000{ # invalid ml-string foo : ""'text''' } hjson-go-3.1.0/assets/kan_result.hjson000066400000000000000000000006701373061077100177630ustar00rootroot00000000000000{ numbers: [ 0 0 0 42 42.1 -5 -5.1 1701 -1701 12.345 -12.345 ] native: [ true true false false null null ] strings: [ x 0 .0 00 01 0 0 0 42 x 42.1 asdf 1.2.3 -5 0 - -5.1 -- 17.01e2 + -17.01e2 : 12345e-3 @ -12345e-3 $ true true x true false false x false null null x null ] }hjson-go-3.1.0/assets/kan_result.json000066400000000000000000000010041373061077100176030ustar00rootroot00000000000000{ "numbers": [ 0, 0, 0, 42, 42.1, -5, -5.1, 1701, -1701, 12.345, -12.345 ], "native": [ true, true, false, false, null, null ], "strings": [ "x 0", ".0", "00", "01", "0 0 0", "42 x", "42.1 asdf", "1.2.3", "-5 0 -", "-5.1 --", "17.01e2 +", "-17.01e2 :", "12345e-3 @", "-12345e-3 $", "true true", "x true", "false false", "x false", "null null", "x null" ] }hjson-go-3.1.0/assets/kan_test.hjson000066400000000000000000000010071373061077100174170ustar00rootroot00000000000000{ # the comma forces a whitespace check numbers: [ 0 0 , -0 42 , 42.1 , -5 -5.1 17.01e2 -17.01e2 12345e-3 , -12345e-3 , ] native: [ true , true false , false null , null ] strings: [ x 0 .0 00 01 0 0 0 42 x 42.1 asdf 1.2.3 -5 0 - -5.1 -- 17.01e2 + -17.01e2 : 12345e-3 @ -12345e-3 $ true true x true false false x false null null x null ] } hjson-go-3.1.0/assets/keys_result.hjson000066400000000000000000000010571373061077100201650ustar00rootroot00000000000000{ unquoted_key: test _unquoted: test test-key: test -test: test .key: test trailing: test trailing2: test "#c1": test "foo#bar": test "//bar": test "foo//bar": test "/*foo*/": test "foo/*foo*/bar": test "/*": test "foo/*bar": test "\"": test "foo\"bar": test "'''": test "foo'''bar": test "'": test "'foo": test "foo'bar": test ":": test "foo:bar": test "{": test "foo{bar": test "}": test "foo}bar": test "[": test "foo[bar": test "]": test "foo]bar": test nl1: test nl2: test nl3: test }hjson-go-3.1.0/assets/keys_result.json000066400000000000000000000012531373061077100200130ustar00rootroot00000000000000{ "unquoted_key": "test", "_unquoted": "test", "test-key": "test", "-test": "test", ".key": "test", "trailing": "test", "trailing2": "test", "#c1": "test", "foo#bar": "test", "//bar": "test", "foo//bar": "test", "/*foo*/": "test", "foo/*foo*/bar": "test", "/*": "test", "foo/*bar": "test", "\"": "test", "foo\"bar": "test", "'''": "test", "foo'''bar": "test", "'": "test", "'foo": "test", "foo'bar": "test", ":": "test", "foo:bar": "test", "{": "test", "foo{bar": "test", "}": "test", "foo}bar": "test", "[": "test", "foo[bar": "test", "]": "test", "foo]bar": "test", "nl1": "test", "nl2": "test", "nl3": "test" }hjson-go-3.1.0/assets/keys_test.hjson000066400000000000000000000013501373061077100176220ustar00rootroot00000000000000{ # unquoted keys unquoted_key: test _unquoted: test test-key: test -test: test .key: test # trailing spaces in key names are ignored trailing : test trailing2 : test # comment char in key name "#c1": test "foo#bar": test "//bar": test "foo//bar": test "/*foo*/": test "foo/*foo*/bar": test "/*": test "foo/*bar": test # quotes in key name "\"": test "foo\"bar": test "'''": test "foo'''bar": test "'": test "'foo": test "foo'bar": test # control char in key name ":": test "foo:bar": test "{": test "foo{bar": test "}": test "foo}bar": test "[": test "foo[bar": test "]": test "foo]bar": test # newline nl1: test nl2 : test nl3 : test } hjson-go-3.1.0/assets/mltabs_result.hjson000066400000000000000000000001021373061077100204620ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' }hjson-go-3.1.0/assets/mltabs_result.json000066400000000000000000000000601373061077100203150ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" }hjson-go-3.1.0/assets/mltabs_test.json000066400000000000000000000000611373061077100177570ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" } hjson-go-3.1.0/assets/oa_result.hjson000066400000000000000000000001051373061077100176020ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ]hjson-go-3.1.0/assets/oa_result.json000066400000000000000000000001251373061077100174340ustar00rootroot00000000000000[ "a", {}, {}, [], [], { "b": 1, "c": [], "d": {} }, [] ]hjson-go-3.1.0/assets/oa_test.hjson000066400000000000000000000001061373061077100172440ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-3.1.0/assets/pass1_result.hjson000066400000000000000000000022641373061077100202420ustar00rootroot00000000000000[ JSON Test Pattern pass1 { "object with 1 member": [ array with 1 element ] } {} [] -42 true false null { integer: 1234567890 real: -9876.54321 e: 1.23456789e-13 E: 1.23456789e+34 -: 2.3456789012e+76 zero: 0 one: 1 space: " " quote: '''"''' backslash: \ controls: "\b\f\n\r\t" slash: / & / alpha: abcdefghijklmnopqrstuvwyz ALPHA: ABCDEFGHIJKLMNOPQRSTUVWYZ digit: 0123456789 0123456789: digit special: `1~!@#$%^&*()_+-={':[,]}|;.? hex: ģ䕧覫췯ꯍ true: true false: false null: null array: [] object: {} address: 50 St. James Street url: http://www.JSON.org/ comment: "// /* */": " " " s p a c e d ": [ 1 2 3 4 5 6 7 ] compact: [ 1 2 3 4 5 6 7 ] jsontext: '''{"object with 1 member":["array with 1 element"]}''' quotes: " " %22 0x22 034 " "/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?": A key can be any string } 0.5 98.6 99.44 1066 10 1 0.1 1 2 2 rosebud ]hjson-go-3.1.0/assets/pass1_result.json000066400000000000000000000024751373061077100200760ustar00rootroot00000000000000[ "JSON Test Pattern pass1", { "object with 1 member": [ "array with 1 element" ] }, {}, [], -42, true, false, null, { "integer": 1234567890, "real": -9876.54321, "e": 1.23456789e-13, "E": 1.23456789e+34, "-": 2.3456789012e+76, "zero": 0, "one": 1, "space": " ", "quote": "\"", "backslash": "\\", "controls": "\b\f\n\r\t", "slash": "/ & /", "alpha": "abcdefghijklmnopqrstuvwyz", "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", "digit": "0123456789", "0123456789": "digit", "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", "hex": "ģ䕧覫췯ꯍ", "true": true, "false": false, "null": null, "array": [], "object": {}, "address": "50 St. James Street", "url": "http://www.JSON.org/", "comment": "// /* */": " ", " s p a c e d ": [ 1, 2, 3, 4, 5, 6, 7 ], "compact": [ 1, 2, 3, 4, 5, 6, 7 ], "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", "quotes": "" \" %22 0x22 034 "", "/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string" }, 0.5, 98.6, 99.44, 1066, 10, 1, 0.1, 1, 2, 2, "rosebud" ]hjson-go-3.1.0/assets/pass1_test.json000066400000000000000000000026421373061077100175330ustar00rootroot00000000000000[ "JSON Test Pattern pass1", {"object with 1 member":["array with 1 element"]}, {}, [], -42, true, false, null, { "integer": 1234567890, "real": -9876.543210, "e": 0.123456789e-12, "E": 1.234567890E+34, "-": 23456789012E66, "zero": 0, "one": 1, "space": " ", "quote": "\"", "backslash": "\\", "controls": "\b\f\n\r\t", "slash": "/ & \/", "alpha": "abcdefghijklmnopqrstuvwyz", "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", "digit": "0123456789", "0123456789": "digit", "special": "`1~!@#$%^&*()_+-={':[,]}|;.?", "hex": "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A", "true": true, "false": false, "null": null, "array":[ ], "object":{ }, "address": "50 St. James Street", "url": "http://www.JSON.org/", "comment": "// /* */": " ", " s p a c e d " :[1,2 , 3 , 4 , 5 , 6 ,7 ],"compact":[1,2,3,4,5,6,7], "jsontext": "{\"object with 1 member\":[\"array with 1 element\"]}", "quotes": "" \u0022 %22 0x22 034 "", "\/\\\"\uCAFE\uBABE\uAB98\uFCDE\ubcda\uef4A\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?" : "A key can be any string" }, 0.5 ,98.6 , 99.44 , 1066, 1e1, 0.1e1, 1e-1, 1e00,2e+00,2e-00 ,"rosebud"]hjson-go-3.1.0/assets/pass2_result.hjson000066400000000000000000000014521373061077100202410ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ Not too deep ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]hjson-go-3.1.0/assets/pass2_result.json000066400000000000000000000014541373061077100200730ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ "Not too deep" ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]hjson-go-3.1.0/assets/pass2_test.json000066400000000000000000000000641373061077100175300ustar00rootroot00000000000000[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]hjson-go-3.1.0/assets/pass3_result.hjson000066400000000000000000000002041373061077100202340ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": must be an object or array. "In this test": It is an object. } }hjson-go-3.1.0/assets/pass3_result.json000066400000000000000000000002071373061077100200670ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } }hjson-go-3.1.0/assets/pass3_test.json000066400000000000000000000002241373061077100175270ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } hjson-go-3.1.0/assets/pass4_result.hjson000066400000000000000000000000021373061077100202310ustar00rootroot0000000000000010hjson-go-3.1.0/assets/pass4_result.json000066400000000000000000000000021373061077100200610ustar00rootroot0000000000000010hjson-go-3.1.0/assets/pass4_test.json000066400000000000000000000000041373061077100175240ustar00rootroot00000000000000 10 hjson-go-3.1.0/assets/passSingle_result.hjson000066400000000000000000000000271373061077100213160ustar00rootroot00000000000000allow quoteless stringshjson-go-3.1.0/assets/passSingle_result.json000066400000000000000000000000311373061077100211410ustar00rootroot00000000000000"allow quoteless strings"hjson-go-3.1.0/assets/passSingle_test.hjson000066400000000000000000000000271373061077100207570ustar00rootroot00000000000000allow quoteless stringshjson-go-3.1.0/assets/root_result.hjson000066400000000000000000000000711373061077100201700ustar00rootroot00000000000000{ database: { host: 127.0.0.1 port: 555 } }hjson-go-3.1.0/assets/root_result.json000066400000000000000000000001001373061077100200110ustar00rootroot00000000000000{ "database": { "host": "127.0.0.1", "port": 555 } }hjson-go-3.1.0/assets/root_test.hjson000066400000000000000000000001251373061077100176310ustar00rootroot00000000000000// a object with the root braces omitted database: { host: 127.0.0.1 port: 555 } hjson-go-3.1.0/assets/sorted/000077500000000000000000000000001373061077100160465ustar00rootroot00000000000000hjson-go-3.1.0/assets/sorted/charset2_result.hjson000066400000000000000000000001271373061077100222220ustar00rootroot00000000000000{ hex: ģ䕧覫췯ꯍ uescape: "\u0000,\u0001,\uffff" umlaut: äöüßÄÖÜ }hjson-go-3.1.0/assets/sorted/charset2_result.json000066400000000000000000000001401373061077100220450ustar00rootroot00000000000000{ "hex": "ģ䕧覫췯ꯍ", "uescape": "\u0000,\u0001,￿", "umlaut": "äöüßÄÖÜ" }hjson-go-3.1.0/assets/sorted/charset_result.hjson000066400000000000000000000005071373061077100221420ustar00rootroot00000000000000{ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ }hjson-go-3.1.0/assets/sorted/charset_result.json000066400000000000000000000005331373061077100217710ustar00rootroot00000000000000{ "js-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ml-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ql-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" }hjson-go-3.1.0/assets/sorted/comments_result.hjson000066400000000000000000000011151373061077100223320ustar00rootroot00000000000000{ bar1: This is a string value. // part of the string bar2: This is a string value. false1: false false2: false false3: false foo1: This is a string value. # part of the string foo2: This is a string value. foobar1: This is a string value./* part of the string */ foobar2: This is a string value. null1: null null2: null null3: null num1: 0 num2: 0 num3: 2 rem1: "# test" rem2: "// test" rem3: "/* test */" str1: 00 # part of the string str2: 00.0 // part of the string str3: 02 /* part of the string */ true1: true true2: true true3: true }hjson-go-3.1.0/assets/sorted/comments_result.json000066400000000000000000000012461373061077100221670ustar00rootroot00000000000000{ "bar1": "This is a string value. // part of the string", "bar2": "This is a string value.", "false1": false, "false2": false, "false3": false, "foo1": "This is a string value. # part of the string", "foo2": "This is a string value.", "foobar1": "This is a string value./* part of the string */", "foobar2": "This is a string value.", "null1": null, "null2": null, "null3": null, "num1": 0, "num2": 0, "num3": 2, "rem1": "# test", "rem2": "// test", "rem3": "/* test */", "str1": "00 # part of the string", "str2": "00.0 // part of the string", "str3": "02 /* part of the string */", "true1": true, "true2": true, "true3": true }hjson-go-3.1.0/assets/sorted/empty_result.hjson000066400000000000000000000000171373061077100216430ustar00rootroot00000000000000{ "": empty }hjson-go-3.1.0/assets/sorted/empty_result.json000066400000000000000000000000211373061077100214660ustar00rootroot00000000000000{ "": "empty" }hjson-go-3.1.0/assets/sorted/kan_result.hjson000066400000000000000000000006701373061077100212630ustar00rootroot00000000000000{ native: [ true true false false null null ] numbers: [ 0 0 0 42 42.1 -5 -5.1 1701 -1701 12.345 -12.345 ] strings: [ x 0 .0 00 01 0 0 0 42 x 42.1 asdf 1.2.3 -5 0 - -5.1 -- 17.01e2 + -17.01e2 : 12345e-3 @ -12345e-3 $ true true x true false false x false null null x null ] }hjson-go-3.1.0/assets/sorted/kan_result.json000066400000000000000000000010041373061077100211030ustar00rootroot00000000000000{ "native": [ true, true, false, false, null, null ], "numbers": [ 0, 0, 0, 42, 42.1, -5, -5.1, 1701, -1701, 12.345, -12.345 ], "strings": [ "x 0", ".0", "00", "01", "0 0 0", "42 x", "42.1 asdf", "1.2.3", "-5 0 -", "-5.1 --", "17.01e2 +", "-17.01e2 :", "12345e-3 @", "-12345e-3 $", "true true", "x true", "false false", "x false", "null null", "x null" ] }hjson-go-3.1.0/assets/sorted/keys_result.hjson000066400000000000000000000010571373061077100214650ustar00rootroot00000000000000{ "\"": test "#c1": test "'": test "'''": test "'foo": test -test: test .key: test "/*": test "/*foo*/": test "//bar": test ":": test "[": test "]": test _unquoted: test "foo\"bar": test "foo#bar": test "foo'''bar": test "foo'bar": test "foo/*bar": test "foo/*foo*/bar": test "foo//bar": test "foo:bar": test "foo[bar": test "foo]bar": test "foo{bar": test "foo}bar": test nl1: test nl2: test nl3: test test-key: test trailing: test trailing2: test unquoted_key: test "{": test "}": test }hjson-go-3.1.0/assets/sorted/keys_result.json000066400000000000000000000012531373061077100213130ustar00rootroot00000000000000{ "\"": "test", "#c1": "test", "'": "test", "'''": "test", "'foo": "test", "-test": "test", ".key": "test", "/*": "test", "/*foo*/": "test", "//bar": "test", ":": "test", "[": "test", "]": "test", "_unquoted": "test", "foo\"bar": "test", "foo#bar": "test", "foo'''bar": "test", "foo'bar": "test", "foo/*bar": "test", "foo/*foo*/bar": "test", "foo//bar": "test", "foo:bar": "test", "foo[bar": "test", "foo]bar": "test", "foo{bar": "test", "foo}bar": "test", "nl1": "test", "nl2": "test", "nl3": "test", "test-key": "test", "trailing": "test", "trailing2": "test", "unquoted_key": "test", "{": "test", "}": "test" }hjson-go-3.1.0/assets/sorted/mltabs_result.hjson000066400000000000000000000001021373061077100217620ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' }hjson-go-3.1.0/assets/sorted/mltabs_result.json000066400000000000000000000000601373061077100216150ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" }hjson-go-3.1.0/assets/sorted/oa_result.hjson000066400000000000000000000001051373061077100211020ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ]hjson-go-3.1.0/assets/sorted/oa_result.json000066400000000000000000000001251373061077100207340ustar00rootroot00000000000000[ "a", {}, {}, [], [], { "b": 1, "c": [], "d": {} }, [] ]hjson-go-3.1.0/assets/sorted/pass1_result.hjson000066400000000000000000000022641373061077100215420ustar00rootroot00000000000000[ JSON Test Pattern pass1 { "object with 1 member": [ array with 1 element ] } {} [] -42 true false null { " s p a c e d ": [ 1 2 3 4 5 6 7 ] "# -- --> */": " " -: 2.3456789012e+76 "/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?": A key can be any string 0123456789: digit ALPHA: ABCDEFGHIJKLMNOPQRSTUVWYZ E: 1.23456789e+34 address: 50 St. James Street alpha: abcdefghijklmnopqrstuvwyz array: [] backslash: \ comment: "// /* */": " ", "-": 2.3456789012e+76, "/\\\"쫾몾ꮘﳞ볚\b\f\n\r\t`1~!@#$%^&*()_+-=[]{}|;:',./<>?": "A key can be any string", "0123456789": "digit", "ALPHA": "ABCDEFGHIJKLMNOPQRSTUVWYZ", "E": 1.23456789e+34, "address": "50 St. James Street", "alpha": "abcdefghijklmnopqrstuvwyz", "array": [], "backslash": "\\", "comment": "// /*