pax_global_header00006660000000000000000000000064145343500200014506gustar00rootroot0000000000000052 comment=bdaa45f5d9768665e3081b9fe64cd574f9e092d4 hjson-go-4.4.0/000077500000000000000000000000001453435002000132375ustar00rootroot00000000000000hjson-go-4.4.0/.github/000077500000000000000000000000001453435002000145775ustar00rootroot00000000000000hjson-go-4.4.0/.github/workflows/000077500000000000000000000000001453435002000166345ustar00rootroot00000000000000hjson-go-4.4.0/.github/workflows/build.yml000066400000000000000000000027761453435002000204720ustar00rootroot00000000000000name: Build hjson-cli Releases on: push: tags: - 'v[0-9]+.[0-9]+**' jobs: build_hjson-cli_releases: runs-on: ubuntu-latest strategy: fail-fast: false steps: - name: Checkout repo uses: actions/checkout@v3 with: fetch-depth: 0 - name: Build the hjson-cli binaries run: ./build_release.sh - name: Upload hjson-cli artifacts uses: actions/upload-artifact@v2 with: name: output path: binaries/* if-no-files-found: error release_artifacts: needs: [build_hjson-cli_releases] runs-on: ubuntu-latest steps: - name: Download actifacts uses: actions/download-artifact@v2 with: path: artifacts - name: Show the downloaded artifacts run: | pwd ls -laR * - name: Release binaries uses: ncipollo/release-action@v1 with: # ncipollo/release-action needs a tag! Either a usual "GIT TAG" or an dedicated TAG, see below! # set a TAG if you want to build a release, i.e. via "workflow_dispatch" on GitHub _AND_ do not push a regular GIT TAG # and the other way around, if you want to build releases based on pushed GIT TAGs, make sure you un-comment the "tag:" line below! tag: ${{ github.ref_name }} draft: true artifactErrorsFailBuild: true artifacts: "artifacts/output/*" token: ${{ secrets.GITHUB_TOKEN }} hjson-go-4.4.0/.github/workflows/test.yml000066400000000000000000000016021453435002000203350ustar00rootroot00000000000000name: test on: [push, pull_request] jobs: test: runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - uses: actions/checkout@v3 - run: go version - run: go test -v - run: cd hjson-cli && go build - if: runner.os == 'Linux' run: hjson-cli/hjson-cli assets/comments_test.hjson | diff assets/sorted/comments_result.hjson - - if: runner.os == 'Linux' run: hjson-cli/hjson-cli -j assets/comments_test.hjson | diff assets/sorted/comments_result.json - - if: runner.os == 'Linux' run: hjson-cli/hjson-cli -preserveKeyOrder assets/comments_test.hjson | diff assets/comments_result.hjson - - if: runner.os == 'Linux' run: hjson-cli/hjson-cli -j -preserveKeyOrder assets/comments_test.hjson | diff assets/comments_result.json - hjson-go-4.4.0/.gitignore000066400000000000000000000000001453435002000152150ustar00rootroot00000000000000hjson-go-4.4.0/LICENSE000066400000000000000000000020661453435002000142500ustar00rootroot00000000000000MIT 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-4.4.0/README.md000066400000000000000000000253771453435002000145340ustar00rootroot00000000000000# hjson-go [![Build Status](https://github.com/hjson/hjson-go/workflows/test/badge.svg)](https://github.com/hjson/hjson-go/actions) [![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)](https://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/v4) ![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). More documentation can be found at https://pkg.go.dev/github.com/hjson/hjson-go/v4 # Install Instructions for installing a pre-built **hjson-cli** tool can be found at https://hjson.github.io/users-bin.html If you instead want to build locally, make sure you have a working Go environment. See the [install instructions](https://golang.org/doc/install.html). - In order to use Hjson from your own Go source code, just add an import line like the one here below. Before building your project, run `go mod tidy` in order to download the Hjson source files. The suffix `/v4` is required in the import path, unless you specifically want to use an older major version. ```go import "github.com/hjson/hjson-go/v4" ``` - If you instead want to use the **hjson-cli** command line tool, run the command here below in your terminal. The executable will be installed into your `go/bin` folder, make sure that folder is included in your `PATH` environment variable. ```bash go install github.com/hjson/hjson-go/v4/hjson-cli@latest ``` # 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: -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. -preserveKeyOrder Preserve key order in objects/maps. -quoteAlways Always quote string values. -v Show version. ``` 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/v4" "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 with default options and check for errors. if err := hjson.Unmarshal(sampleText, &dat); err != nil { panic(err) } // short for: // options := hjson.DefaultDecoderOptions() // err := hjson.UnmarshalWithOptions(sampleText, &dat, options) 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) // short for: // options := hjson.DefaultOptions() // hjson, _ := hjson.MarshalWithOptions(sampleMap, options) fmt.Println(string(hjson)) } ``` ## Unmarshal to Go structs If you prefer, you can also unmarshal to Go structs (including structs implementing the json.Unmarshaler interface or the encoding.TextUnmarshaler interface). The Go JSON package is used for this, so the same rules apply. Specifically for the "json" key in struct field tags. For more details about this type of unmarshalling, see the [documentation for json.Unmarshal()](https://pkg.go.dev/encoding/json#Unmarshal). ```go package main import ( "github.com/hjson/hjson-go/v4" "fmt" ) type Sample struct { Rate int Array []string } type SampleAlias struct { Rett int `json:"rate"` Ashtray []string `json:"array"` } func main() { sampleText := []byte(` { # specify rate in requests/second rate: 1000 array: [ foo bar ] }`) // unmarshal var sample Sample hjson.Unmarshal(sampleText, &sample) fmt.Println(sample.Rate) fmt.Println(sample.Array) // unmarshal using json tags on struct fields var sampleAlias SampleAlias hjson.Unmarshal(sampleText, &sampleAlias) fmt.Println(sampleAlias.Rett) fmt.Println(sampleAlias.Ashtray) } ``` ## Comments on struct fields By using key `comment` in struct field tags you can specify comments to be written on one or more lines preceding the struct field in the Hjson output. Another way to output comments is to use *hjson.Node* structs, more on than later. ```go package main import ( "github.com/hjson/hjson-go/v4" "fmt" ) type foo struct { A string `json:"x" comment:"First comment"` B int32 `comment:"Second comment\nLook ma, new lines"` C string D int32 } func main() { a := foo{A: "hi!", B: 3, C: "some text", D: 5} buf, err := hjson.Marshal(a) if err != nil { fmt.Println(err) } fmt.Println(string(buf)) } ``` Output: ``` { # First comment x: hi! # Second comment # Look ma, new lines B: 3 C: some text D: 5 } ``` ## Read and write comments The only way to read comments from Hjson input is to use a destination variable of type *hjson.Node* or **hjson.Node*. The *hjson.Node* must be the root destination, it won't work if you create a field of type *hjson.Node* in some other struct and use that struct as destination. An *hjson.Node* struct is simply a wrapper for a value and comments stored in an *hjson.Comments* struct. It also has several convenience functions, for example *AtIndex()* or *SetKey()* that can be used when you know that the node contains a value of type `[]interface{}` or **hjson.OrderedMap*. All of the elements in `[]interface{}` or **hjson.OrderedMap* will be of type **hjson.Node* in trees created by *hjson.Unmarshal*, but the *hjson.Node* convenience functions unpack the actual values from them. When *hjson.Node* or **hjson.Node* is used as destination for Hjson unmarshal the output will be a tree of **hjson.Node* where all of the values contained in tree nodes will be of these types: * `nil` (no type) * `float64`   (if *UseJSONNumber* == `false`) * *json.Number*   (if *UseJSONNumber* == `true`) * `string` * `bool` * `[]interface{}` * **hjson.OrderedMap* These are just the types used by Hjson unmarshal and the convenience functions, you are free to assign any type of values to nodes in your own code. The comments will contain all whitespace chars too (including line feeds) so that an Hjson document can be read and written without altering the layout. This can be disabled by setting the decoding option *WhitespaceAsComments* to `false`. ```go package main import ( "fmt" "github.com/hjson/hjson-go/v4" ) func main() { // Now let's look at decoding Hjson data into hjson.Node. sampleText := []byte(` { # specify rate in requests/second rate: 1000 array: [ foo bar ] }`) var node hjson.Node if err := hjson.Unmarshal(sampleText, &node); err != nil { panic(err) } node.NK("array").Cm.Before = ` # please specify an array ` if _, _, err := node.NKC("subMap").SetKey("subVal", 1); err != nil { panic(err) } outBytes, err := hjson.Marshal(node) if err != nil { panic(err) } fmt.Println(string(outBytes)) } ``` Output: ``` { # specify rate in requests/second rate: 1000 # please specify an array array: [ foo bar ] subMap: { subVal: 1 } } ``` ## Type ambiguity Hjson allows quoteless strings. But if a value is a valid number, boolean or `null` then it will be unmarshalled into that type instead of a string when unmarshalling into `interface{}`. This can lead to unintended consequences if the creator of an Hjson file meant to write a string but didn't think of that the quoteless string they wrote also was a valid number. The ambiguity can be avoided by using typed destinations when unmarshalling. A string destination will receive a string even if the quoteless string also was a valid number, boolean or `null`. Example: ```go package main import ( "github.com/hjson/hjson-go/v4" "fmt" ) type foo struct { A string } func main() { var dest foo err := hjson.Unmarshal([]byte(`a: 3`), &dest) if err != nil { fmt.Println(err) } fmt.Println(dest) } ``` Output: ``` {3} ``` String pointer destinations are treated the same as string destinations, so you cannot set a string pointer to `nil` by writing `null` in an Hjson file. Writing `null` in an Hjson file would result in the string "null" being stored in the destination string pointer. ## ElemTyper interface If a destination type implements hjson.ElemTyper, Unmarshal() will call ElemType() on the destination when unmarshalling an array or an object, to see if any array element or leaf node should be of type string even if it can be treated as a number, boolean or null. This is most useful if the destination also implements the json.Unmarshaler interface, because then there is no other way for Unmarshal() to know the type of the elements on the destination. If a destination implements ElemTyper all of its elements must be of the same type. Example implementation for a generic ordered map: ```go func (o *OrderedMap[T]) ElemType() reflect.Type { return reflect.TypeOf((*T)(nil)).Elem() } ``` # API [![godoc](https://godoc.org/github.com/hjson/hjson-go/v4?status.svg)](https://godoc.org/github.com/hjson/hjson-go/v4) # History [see releases](https://github.com/hjson/hjson-go/releases) hjson-go-4.4.0/assets/000077500000000000000000000000001453435002000145415ustar00rootroot00000000000000hjson-go-4.4.0/assets/charset2_result.hjson000066400000000000000000000001401453435002000207100ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" "um\u000blaut": äöüßÄÖÜ hex: ģ䕧覫췯ꯍ } hjson-go-4.4.0/assets/charset2_result.json000066400000000000000000000001471453435002000205470ustar00rootroot00000000000000{ "uescape": "\u0000,\u0001,￿", "um\u000blaut": "äöüßÄÖÜ", "hex": "ģ䕧覫췯ꯍ" } hjson-go-4.4.0/assets/charset2_test.hjson000066400000000000000000000001651453435002000203600ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" "um\u000blaut": äöüßÄÖÜ hex: "\u0123\u4567\u89AB\uCDEF\uabcd\uef4A" } hjson-go-4.4.0/assets/charset_result.hjson000066400000000000000000000005101453435002000206270ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ } hjson-go-4.4.0/assets/charset_result.json000066400000000000000000000005341453435002000204650ustar00rootroot00000000000000{ "ql-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "js-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ml-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" } hjson-go-4.4.0/assets/charset_test.hjson000066400000000000000000000005401453435002000202730ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" ml-ascii: ''' ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ''' } hjson-go-4.4.0/assets/comments2/000077500000000000000000000000001453435002000164505ustar00rootroot00000000000000hjson-go-4.4.0/assets/comments2/charset2_result.hjson000066400000000000000000000001401453435002000226170ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" "um\u000blaut": äöüßÄÖÜ hex: ģ䕧覫췯ꯍ } hjson-go-4.4.0/assets/comments2/charset_result.hjson000066400000000000000000000005101453435002000225360ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ } hjson-go-4.4.0/assets/comments2/comments2_result.hjson000066400000000000000000000000561453435002000230210ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments2/comments3_result.hjson000066400000000000000000000001151453435002000230160ustar00rootroot00000000000000// before /* before2 */ a string value // still part of the string // after2 hjson-go-4.4.0/assets/comments2/comments4_result.hjson000066400000000000000000000016031453435002000230220ustar00rootroot00000000000000// before /* before2 */ [ #before1 /*key1keycm*/a string value // still part of the string /* key2keycm */ "a string value" // not part of the string // map1before /* map1key */ {}//map2after {} { // map3 inner comment } [] // map4before /*map4key*/{ /* map4inner */ } // map4after //map5before /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1 // map5aAfter val5b: 2 /* map5bb4comma */ #map5bAfter #map5extra } /* map5after */ // vec1bbefore /* vec1bkey */ []//vec1bafter [] [ // vec3 inner comment ] // vec4before /*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before /*vec5key*/ [ //vec5ab4 1 // vec5aAfter 2 /* vec5bb4comma */ #vec5bAfter #vec5extra ] /* map5after */ // before3 3 # after3 # before4 /*before4b*/4/*after4*/ #after4b ] // after2 /* after3 */ hjson-go-4.4.0/assets/comments2/comments5_result.hjson000066400000000000000000000017361453435002000230320ustar00rootroot00000000000000// before /* before2 */ { #before1 key1:/*key1keycm*/a string value // still part of the string key2: /* key2keycm */ "a string value" // not part of the string // map1before map1: /* map1key */ {}//map2after map2: {} map3: { // map3 inner comment } vec1: [] // map4before map4:/*map4key*/{ /* map4inner */ } // map4after //map5before map5: /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1 // map5aAfter val5b: 2 /* map5bb4comma */ #map5bAfter #map5extra } /* map5after */ // vec1bbefore vec1b: /* vec1bkey */ []//vec1bafter vec2: [] vec3: [ // vec3 inner comment ] // vec4before vec4:/*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before vec5: /*vec5key*/ [ //vec5ab4 1 // vec5aAfter 2 /* vec5bb4comma */ #vec5bAfter #vec5extra ] /* map5after */ // before3 key3: 3 # after3 # before4 /*before4b*/key4: 4/*after4*/ #after4b } // after2 /* after3 */ hjson-go-4.4.0/assets/comments2/comments6_result.hjson000066400000000000000000000000571453435002000230260ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments2/comments7_result.hjson000066400000000000000000000002441453435002000230250ustar00rootroot00000000000000{ # comment before b: /* key comment */ { sub1: 3 # comment after sub2: 4 # comment more after } # cm after obj // Comment B4 a: 2 /* Last comment */ } hjson-go-4.4.0/assets/comments2/comments_result.hjson000066400000000000000000000016741453435002000227460ustar00rootroot00000000000000// 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 // 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-4.4.0/assets/comments2/empty_result.hjson000066400000000000000000000000201453435002000222370ustar00rootroot00000000000000{ "": empty } hjson-go-4.4.0/assets/comments2/int64_result.hjson000066400000000000000000000000411453435002000220500ustar00rootroot00000000000000{ bigInt: 144115188075855870 } hjson-go-4.4.0/assets/comments2/kan_result.hjson000066400000000000000000000007331453435002000216650ustar00rootroot00000000000000{ # the comma forces a whitespace check 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-4.4.0/assets/comments2/keys_result.hjson000066400000000000000000000013141453435002000220630ustar00rootroot00000000000000{ # 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-4.4.0/assets/comments2/mltabs_result.hjson000066400000000000000000000001031453435002000223650ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' } hjson-go-4.4.0/assets/comments2/oa_result.hjson000066400000000000000000000001061453435002000215050ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-4.4.0/assets/comments2/pass1_result.hjson000066400000000000000000000022511453435002000221400ustar00rootroot00000000000000[ 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-4.4.0/assets/comments2/pass2_result.hjson000066400000000000000000000014531453435002000221440ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ Not too deep ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] hjson-go-4.4.0/assets/comments2/pass3_result.hjson000066400000000000000000000002031453435002000221350ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": must be an object or array. "In this test": It is an object. } } hjson-go-4.4.0/assets/comments2/pass4_result.hjson000066400000000000000000000000031453435002000221340ustar00rootroot0000000000000010 hjson-go-4.4.0/assets/comments2/pass5_result.hjson000066400000000000000000000001071453435002000221420ustar00rootroot00000000000000{ bigDouble: 9.223372036854776e+58 bigInt: 9.223372036854776e+58 } hjson-go-4.4.0/assets/comments2/pass6_result.hjson000066400000000000000000000001251453435002000221430ustar00rootroot00000000000000{ a: 1 b: 2 c: 3 d: /*cm1*/ 4 /*cm2 */ e: /* cm3*/ 5 /* cm 4 */ f: 6 } hjson-go-4.4.0/assets/comments2/passSingle_result.hjson000066400000000000000000000000301453435002000232120ustar00rootroot00000000000000allow quoteless strings hjson-go-4.4.0/assets/comments2/root_result.hjson000066400000000000000000000001251453435002000220720ustar00rootroot00000000000000// a object with the root braces omitted database: { host: 127.0.0.1 port: 555 } hjson-go-4.4.0/assets/comments2/stringify1_result.hjson000066400000000000000000000014701453435002000232120ustar00rootroot00000000000000// test if stringify produces correct output { quotes: { num1: "1,2" num2: "-1.1 ," num3: "1e10 ,2" num4: "-1e-10," kw1: "true," kw2: "false ," kw3: "null,123" close1: "1}" close1b: "1 }" close2: "1]" close2b: "1 ]" close3: "1," close3b: "1 ," comment1: "1#str" comment2: "1//str" comment3: "1/*str*/" punc1: "{" punc1b: "{foo" punc2: "}" punc2b: "}foo" punc3: "[" punc3b: "[foo" punc4: "]" punc4b: "]foo" punc5: "," punc5b: ",foo" punc6: ":" punc6b: ":foo" } noquotes: { num0: .1,2 num1: 1.1.1,2 num2: -.1, num3: 1e10e,2 num4: -1e--10, kw1: true1, kw2: false0, kw3: null0, close1: a} close2: a] comment1: a#str comment2: a//str comment3: a/*str*/ } } hjson-go-4.4.0/assets/comments2/strings2_result.hjson000066400000000000000000000013351453435002000226660ustar00rootroot00000000000000{ # Hjson 3 allows the use of single quotes key1: a key in single quotes "key 2": a key in single quotes "key \"": a key in single quotes text: [ single quoted string '''You need quotes for escapes''' " untrimmed " "untrimmed " containing " double quotes containing " double quotes containing " double quotes '''"containing more " double quotes"''' containing ' single quotes containing ' single quotes containing ' single quotes "'containing more ' single quotes'" "'containing more ' single quotes'" "\n" " \n" "\n \n \n \n" "\t\n" ] # escapes/no escape foo3a: asdf''' foo3b: "'''asdf" foo4a: "asdf'''\nasdf" foo4b: "asdf\n'''asdf" } hjson-go-4.4.0/assets/comments2/strings3_result.hjson000066400000000000000000000002741453435002000226700ustar00rootroot00000000000000{ // Empty string a: "" // Unicode code points that require escape inside quotes. b: "\u00ad\u0600\u0604\u070f\u17b4\u17b5\u200c\u200f\u2028\u202f\u2060\u206f\ufeff\ufff0\uffff" } hjson-go-4.4.0/assets/comments2/strings_result.hjson000066400000000000000000000023111453435002000225770ustar00rootroot00000000000000{ # simple text1: This is a valid string value. text2: a \ is just a \ text3: '''You need quotes for escapes''' text4a: " untrimmed " text4b: " untrimmed" text4c: "untrimmed " notml1: "\n" notml2: " \n" notml3: "\n \n \n \n" notml4: "\t\n" # multiline string multiline1: ''' first line indented line last line ''' multiline2: ''' first line indented line last line ''' multiline3: ''' first line indented line last line ''' # trailing lf multiline4: ←→±≠Я # escapes/no escape foo1a: asdf\"'a\s\w foo1b: asdf\"'a\s\w foo1c: asdf\"'a\s\w foo2a: '''"asdf"''' foo2b: '''"asdf"''' foo3a: asdf''' foo3b: "'''asdf" foo4a: "asdf'''\nasdf" foo4b: "asdf\n'''asdf" # in arrays arr: [ one two three four ] # not strings not: { number: 5 negative: -4.2 yes: true no: false null: null array: [ 1 2 3 4 5 6 7 8 9 0 -1 0.5 ] } # special quoted special: { true: "true" false: "false" null: "null" one: "1" two: "2" minus: "-3" zero: "0" } } hjson-go-4.4.0/assets/comments2/trail_result.hjson000066400000000000000000000002431453435002000222230ustar00rootroot00000000000000{ // the following line contains trailing whitespace: foo: 0 -- this string starts at 0 and ends at 1, preceding and trailing whitespace is ignored -- 1 } hjson-go-4.4.0/assets/comments2/windowseol_result.hjson000066400000000000000000000005571453435002000233120ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ newline: ''' 1 2 ''' } hjson-go-4.4.0/assets/comments2_result.hjson000066400000000000000000000000021453435002000211010ustar00rootroot000000000000003 hjson-go-4.4.0/assets/comments2_result.json000066400000000000000000000000021453435002000207310ustar00rootroot000000000000003 hjson-go-4.4.0/assets/comments2_test.hjson000066400000000000000000000000561453435002000205530ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments3/000077500000000000000000000000001453435002000164515ustar00rootroot00000000000000hjson-go-4.4.0/assets/comments3/charset2_result.hjson000066400000000000000000000001401453435002000226200ustar00rootroot00000000000000{ uescape: "\u0000,\u0001,\uffff" "um\u000blaut": äöüßÄÖÜ hex: ģ䕧覫췯ꯍ } hjson-go-4.4.0/assets/comments3/charset_result.hjson000066400000000000000000000005141453435002000225430ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ } hjson-go-4.4.0/assets/comments3/comments2_result.hjson000066400000000000000000000000561453435002000230220ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments3/comments3_result.hjson000066400000000000000000000001151453435002000230170ustar00rootroot00000000000000// before /* before2 */ a string value // still part of the string // after2 hjson-go-4.4.0/assets/comments3/comments4_result.hjson000066400000000000000000000016101453435002000230210ustar00rootroot00000000000000// before /* before2 */ [ #before1 /*key1keycm*/a string value // still part of the string /* key2keycm */ "a string value" // not part of the string // map1before /* map1key */ {}//map2after {} { // map3 inner comment } [] // map4before /*map4key*/{ /* map4inner */ } // map4after //map5before /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1 // map5aAfter val5b: 2 /* map5bb4comma */ #map5bAfter #map5extra } /* map5after */ // vec1bbefore /* vec1bkey */ []//vec1bafter [] [ // vec3 inner comment ] // vec4before /*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before /*vec5key*/ [ //vec5ab4 1 // vec5aAfter 2 /* vec5bb4comma */ #vec5bAfter #vec5extra ] /* map5after */ // before3 3 # after3 # before4 /*before4b*/4/*after4*/ #after4b ] // after2 /* after3 */ hjson-go-4.4.0/assets/comments3/comments5_result.hjson000066400000000000000000000017421453435002000230300ustar00rootroot00000000000000// before /* before2 */ { #before1 key1:/*key1keycm*/a string value // still part of the string key2: /* key2keycm */ "a string value" // not part of the string // map1before map1: /* map1key */ {}//map2after map2: {} map3: { // map3 inner comment } vec1: [] // map4before map4:/*map4key*/{ /* map4inner */ } // map4after //map5before map5: /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1 // map5aAfter val5b: 2 /* map5bb4comma */ #map5bAfter #map5extra } /* map5after */ // vec1bbefore vec1b: /* vec1bkey */ []//vec1bafter vec2: [] vec3: [ // vec3 inner comment ] // vec4before vec4:/*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before vec5: /*vec5key*/ [ //vec5ab4 1 // vec5aAfter 2 /* vec5bb4comma */ #vec5bAfter #vec5extra ] /* map5after */ // before3 key3: 3 # after3 # before4 /*before4b*/key4: 4/*after4*/ #after4b } // after2 /* after3 */ hjson-go-4.4.0/assets/comments3/comments6_result.hjson000066400000000000000000000000571453435002000230270ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments3/comments7_result.hjson000066400000000000000000000002401453435002000230220ustar00rootroot00000000000000{ # comment before b: /* key comment */ { sub1: 3 # comment after sub2: 4 # comment more after } # cm after obj // Comment B4 a: 2 /* Last comment */ } hjson-go-4.4.0/assets/comments3/comments_result.hjson000066400000000000000000000017021453435002000227370ustar00rootroot00000000000000// 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 // 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-4.4.0/assets/comments3/empty_result.hjson000066400000000000000000000000201453435002000222400ustar00rootroot00000000000000{ "": empty } hjson-go-4.4.0/assets/comments3/int64_result.hjson000066400000000000000000000000411453435002000220510ustar00rootroot00000000000000{ bigInt: 144115188075855870 } hjson-go-4.4.0/assets/comments3/kan_result.hjson000066400000000000000000000007411453435002000216650ustar00rootroot00000000000000{ # the comma forces a whitespace check 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-4.4.0/assets/comments3/keys_result.hjson000066400000000000000000000013321453435002000220640ustar00rootroot00000000000000{ # 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-4.4.0/assets/comments3/mltabs_result.hjson000066400000000000000000000001041453435002000223670ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' } hjson-go-4.4.0/assets/comments3/oa_result.hjson000066400000000000000000000001061453435002000215060ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-4.4.0/assets/comments3/pass1_result.hjson000066400000000000000000000025061453435002000221440ustar00rootroot00000000000000[ 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-4.4.0/assets/comments3/pass2_result.hjson000066400000000000000000000014531453435002000221450ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ Not too deep ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] hjson-go-4.4.0/assets/comments3/pass3_result.hjson000066400000000000000000000002171453435002000221430ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": must be an object or array. "In this test": It is an object. } } hjson-go-4.4.0/assets/comments3/pass4_result.hjson000066400000000000000000000000041453435002000221360ustar00rootroot00000000000000 10 hjson-go-4.4.0/assets/comments3/pass5_result.hjson000066400000000000000000000001071453435002000221430ustar00rootroot00000000000000{ bigDouble: 9.223372036854776e+58 bigInt: 9.223372036854776e+58 } hjson-go-4.4.0/assets/comments3/pass6_result.hjson000066400000000000000000000001261453435002000221450ustar00rootroot00000000000000{ a: 1 b: 2 c: 3 d: /*cm1*/ 4 /*cm2 */ e: /* cm3*/ 5 /* cm 4 */ f: 6 } hjson-go-4.4.0/assets/comments3/passSingle_result.hjson000066400000000000000000000000301453435002000232130ustar00rootroot00000000000000allow quoteless strings hjson-go-4.4.0/assets/comments3/root_result.hjson000066400000000000000000000001251453435002000220730ustar00rootroot00000000000000// a object with the root braces omitted database: { host: 127.0.0.1 port: 555 } hjson-go-4.4.0/assets/comments3/stringify1_result.hjson000066400000000000000000000014741453435002000232170ustar00rootroot00000000000000// test if stringify produces correct output { quotes: { num1: "1,2" num2: "-1.1 ," num3: "1e10 ,2" num4: "-1e-10," kw1: "true," kw2: "false ," kw3: "null,123" close1: "1}" close1b: "1 }" close2: "1]" close2b: "1 ]" close3: "1," close3b: "1 ," comment1: "1#str" comment2: "1//str" comment3: "1/*str*/" punc1: "{" punc1b: "{foo" punc2: "}" punc2b: "}foo" punc3: "[" punc3b: "[foo" punc4: "]" punc4b: "]foo" punc5: "," punc5b: ",foo" punc6: ":" punc6b: ":foo" } noquotes: { num0: .1,2 num1: 1.1.1,2 num2: -.1, num3: 1e10e,2 num4: -1e--10, kw1: true1, kw2: false0, kw3: null0, close1: a} close2: a] comment1: a#str comment2: a//str comment3: a/*str*/ } } hjson-go-4.4.0/assets/comments3/strings2_result.hjson000066400000000000000000000013401453435002000226630ustar00rootroot00000000000000{ # Hjson 3 allows the use of single quotes key1: a key in single quotes "key 2": a key in single quotes "key \"": a key in single quotes text: [ single quoted string '''You need quotes for escapes''' " untrimmed " "untrimmed " containing " double quotes containing " double quotes containing " double quotes '''"containing more " double quotes"''' containing ' single quotes containing ' single quotes containing ' single quotes "'containing more ' single quotes'" "'containing more ' single quotes'" "\n" " \n" "\n \n \n \n" "\t\n" ] # escapes/no escape foo3a: asdf''' foo3b: "'''asdf" foo4a: "asdf'''\nasdf" foo4b: "asdf\n'''asdf" } hjson-go-4.4.0/assets/comments3/strings3_result.hjson000066400000000000000000000002741453435002000226710ustar00rootroot00000000000000{ // Empty string a: "" // Unicode code points that require escape inside quotes. b: "\u00ad\u0600\u0604\u070f\u17b4\u17b5\u200c\u200f\u2028\u202f\u2060\u206f\ufeff\ufff0\uffff" } hjson-go-4.4.0/assets/comments3/strings_result.hjson000066400000000000000000000024121453435002000226020ustar00rootroot00000000000000{ # simple text1: This is a valid string value. text2: a \ is just a \ text3: '''You need quotes for escapes''' text4a: " untrimmed " text4b: " untrimmed" text4c: "untrimmed " notml1: "\n" notml2: " \n" notml3: "\n \n \n \n" notml4: "\t\n" # multiline string multiline1: ''' first line indented line last line ''' multiline2: ''' first line indented line last line ''' multiline3: ''' first line indented line last line ''' # trailing lf multiline4: ←→±≠Я # escapes/no escape foo1a: asdf\"'a\s\w foo1b: asdf\"'a\s\w foo1c: asdf\"'a\s\w foo2a: '''"asdf"''' foo2b: '''"asdf"''' foo3a: asdf''' foo3b: "'''asdf" foo4a: "asdf'''\nasdf" foo4b: "asdf\n'''asdf" # in arrays arr: [ one two three four ] # not strings not: { number: 5 negative: -4.2 yes: true no: false null: null array: [ 1 2 3 4 5 6 7 8 9 0 -1 0.5 ] } # special quoted special: { true: "true" false: "false" null: "null" one: "1" two: "2" minus: "-3" zero: "0" } } hjson-go-4.4.0/assets/comments3/trail_result.hjson000066400000000000000000000002471453435002000222300ustar00rootroot00000000000000{ // the following line contains trailing whitespace: foo: 0 -- this string starts at 0 and ends at 1, preceding and trailing whitespace is ignored -- 1 } hjson-go-4.4.0/assets/comments3/windowseol_result.hjson000066400000000000000000000005631453435002000233100ustar00rootroot00000000000000{ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ newline: ''' 1 2 ''' } hjson-go-4.4.0/assets/comments3_result.hjson000066400000000000000000000000531453435002000211100ustar00rootroot00000000000000a string value // still part of the string hjson-go-4.4.0/assets/comments3_result.json000066400000000000000000000000551453435002000207420ustar00rootroot00000000000000"a string value // still part of the string" hjson-go-4.4.0/assets/comments3_test.hjson000066400000000000000000000001151453435002000205500ustar00rootroot00000000000000// before /* before2 */ a string value // still part of the string // after2 hjson-go-4.4.0/assets/comments4_result.hjson000066400000000000000000000002551453435002000211150ustar00rootroot00000000000000[ a string value // still part of the string a string value {} {} {} [] {} { val5a: 1 val5b: 2 } [] [] [] [] [ 1 2 ] 3 4 ] hjson-go-4.4.0/assets/comments4_result.json000066400000000000000000000003051453435002000207410ustar00rootroot00000000000000[ "a string value // still part of the string", "a string value", {}, {}, {}, [], {}, { "val5a": 1, "val5b": 2 }, [], [], [], [], [ 1, 2 ], 3, 4 ] hjson-go-4.4.0/assets/comments4_test.hjson000066400000000000000000000016141453435002000205560ustar00rootroot00000000000000// before /* before2 */ [ #before1 /*key1keycm*/a string value // still part of the string /* key2keycm */ "a string value" // not part of the string // map1before /* map1key */ {}//map2after {} { // map3 inner comment } [] // map4before /*map4key*/{ /* map4inner */ } // map4after //map5before /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1, // map5aAfter val5b: 2 /* map5bb4comma */ , #map5bAfter #map5extra } /* map5after */ // vec1bbefore /* vec1bkey */ []//vec1bafter [] [ // vec3 inner comment ] // vec4before /*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before /*vec5key*/ [ //vec5ab4 1, // vec5aAfter 2 /* vec5bb4comma */ , #vec5bAfter #vec5extra ] /* map5after */ // before3 3 # after3 # before4 /*before4b*/4/*after4*/ #after4b ] // after2 /* after3 */ hjson-go-4.4.0/assets/comments5_result.hjson000066400000000000000000000004101453435002000211070ustar00rootroot00000000000000{ key1: a string value // still part of the string key2: a string value map1: {} map2: {} map3: {} vec1: [] map4: {} map5: { val5a: 1 val5b: 2 } vec1b: [] vec2: [] vec3: [] vec4: [] vec5: [ 1 2 ] key3: 3 key4: 4 } hjson-go-4.4.0/assets/comments5_result.json000066400000000000000000000004761453435002000207530ustar00rootroot00000000000000{ "key1": "a string value // still part of the string", "key2": "a string value", "map1": {}, "map2": {}, "map3": {}, "vec1": [], "map4": {}, "map5": { "val5a": 1, "val5b": 2 }, "vec1b": [], "vec2": [], "vec3": [], "vec4": [], "vec5": [ 1, 2 ], "key3": 3, "key4": 4 } hjson-go-4.4.0/assets/comments5_test.hjson000066400000000000000000000017501453435002000205600ustar00rootroot00000000000000// before /* before2 */ { #before1 key1:/*key1keycm*/a string value // still part of the string key2: /* key2keycm */ "a string value" // not part of the string // map1before map1: /* map1key */ {}//map2after map2: {} map3: { // map3 inner comment } vec1: [] // map4before map4:/*map4key*/{ /* map4inner */ } // map4after //map5before map5: /*map5key*/ { //map5ab4 val5a: /* map5akey */ 1, // map5aAfter val5b: 2 /* map5bb4comma */ , #map5bAfter #map5extra } /* map5after */ // vec1bbefore vec1b: /* vec1bkey */ []//vec1bafter vec2: [] vec3: [ // vec3 inner comment ] // vec4before vec4:/*vec4key*/[ /* vec4inner */ ] // vec4after //vec5before vec5: /*vec5key*/ [ //vec5ab4 1, // vec5aAfter 2 /* vec5bb4comma */ , #vec5bAfter #vec5extra ] /* map5after */ // before3 key3 : 3 # after3 # before4 /*before4b*/key4:4/*after4*/ #after4b } // after2 /* after3 */ hjson-go-4.4.0/assets/comments6_result.hjson000066400000000000000000000000021453435002000211050ustar00rootroot000000000000003 hjson-go-4.4.0/assets/comments6_result.json000066400000000000000000000000021453435002000207350ustar00rootroot000000000000003 hjson-go-4.4.0/assets/comments6_test.hjson000066400000000000000000000000631453435002000205550ustar00rootroot00000000000000// before /* before2 */ 3 // after1 // after2 hjson-go-4.4.0/assets/comments7_result.hjson000066400000000000000000000000561453435002000211170ustar00rootroot00000000000000{ b: { sub1: 3 sub2: 4 } a: 2 } hjson-go-4.4.0/assets/comments7_result.json000066400000000000000000000000701453435002000207430ustar00rootroot00000000000000{ "b": { "sub1": 3, "sub2": 4 }, "a": 2 } hjson-go-4.4.0/assets/comments7_test.hjson000066400000000000000000000002461453435002000205610ustar00rootroot00000000000000# comment before b: /* key comment */ { sub1: 3 # comment after sub2: 4 # comment more after } # cm after obj // Comment B4 a: 2 /* Last comment */ hjson-go-4.4.0/assets/comments_result.hjson000066400000000000000000000011161453435002000210260ustar00rootroot00000000000000{ 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-4.4.0/assets/comments_result.json000066400000000000000000000012471453435002000206630ustar00rootroot00000000000000{ "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-4.4.0/assets/comments_test.hjson000066400000000000000000000017041453435002000204720ustar00rootroot00000000000000// 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-4.4.0/assets/empty_result.hjson000066400000000000000000000000201453435002000203300ustar00rootroot00000000000000{ "": empty } hjson-go-4.4.0/assets/empty_result.json000066400000000000000000000000221453435002000201620ustar00rootroot00000000000000{ "": "empty" } hjson-go-4.4.0/assets/empty_test.hjson000066400000000000000000000000201453435002000177710ustar00rootroot00000000000000{ "": empty } hjson-go-4.4.0/assets/failCharset1_test.hjson000066400000000000000000000000511453435002000211450ustar00rootroot00000000000000{ # invalid \u char char: "\uxxxx" } hjson-go-4.4.0/assets/failJSON02_test.json000066400000000000000000000000221453435002000202340ustar00rootroot00000000000000["Unclosed array" hjson-go-4.4.0/assets/failJSON05_test.json000066400000000000000000000000311453435002000202370ustar00rootroot00000000000000["double extra comma",,] hjson-go-4.4.0/assets/failJSON06_test.json000066400000000000000000000000331453435002000202420ustar00rootroot00000000000000[ , "<-- missing value"] hjson-go-4.4.0/assets/failJSON07_test.json000066400000000000000000000000331453435002000202430ustar00rootroot00000000000000["Comma after the close"], hjson-go-4.4.0/assets/failJSON08_test.json000066400000000000000000000000211453435002000202410ustar00rootroot00000000000000["Extra close"]] hjson-go-4.4.0/assets/failJSON10_test.json000066400000000000000000000000731453435002000202410ustar00rootroot00000000000000{"Extra value after close": true} "misplaced quoted value" hjson-go-4.4.0/assets/failJSON11_test.json000066400000000000000000000000361453435002000202410ustar00rootroot00000000000000{"Illegal expression": 1 + 2} hjson-go-4.4.0/assets/failJSON12_test.json000066400000000000000000000000401453435002000202350ustar00rootroot00000000000000{"Illegal invocation": alert()} hjson-go-4.4.0/assets/failJSON13_test.json000066400000000000000000000000541453435002000202430ustar00rootroot00000000000000{"Numbers cannot have leading zeroes": 013} hjson-go-4.4.0/assets/failJSON14_test.json000066400000000000000000000000401453435002000202370ustar00rootroot00000000000000{"Numbers cannot be hex": 0x14} hjson-go-4.4.0/assets/failJSON15_test.json000066400000000000000000000000431453435002000202430ustar00rootroot00000000000000["Illegal backslash escape: \x15"] hjson-go-4.4.0/assets/failJSON16_test.json000066400000000000000000000000111453435002000202370ustar00rootroot00000000000000[\naked] hjson-go-4.4.0/assets/failJSON17_test.json000066400000000000000000000000431453435002000202450ustar00rootroot00000000000000["Illegal backslash escape: \017"] hjson-go-4.4.0/assets/failJSON19_test.json000066400000000000000000000000271453435002000202510ustar00rootroot00000000000000{"Missing colon" null} hjson-go-4.4.0/assets/failJSON20_test.json000066400000000000000000000000301453435002000202330ustar00rootroot00000000000000{"Double colon":: null} hjson-go-4.4.0/assets/failJSON21_test.json000066400000000000000000000000411453435002000202360ustar00rootroot00000000000000{"Comma instead of colon", null} hjson-go-4.4.0/assets/failJSON22_test.json000066400000000000000000000000421453435002000202400ustar00rootroot00000000000000["Colon instead of comma": false] hjson-go-4.4.0/assets/failJSON23_test.json000066400000000000000000000000251453435002000202420ustar00rootroot00000000000000["Bad value", truth] hjson-go-4.4.0/assets/failJSON24_test.json000066400000000000000000000000211453435002000202370ustar00rootroot00000000000000['single quote'] hjson-go-4.4.0/assets/failJSON26_test.json000066400000000000000000000000471453435002000202510ustar00rootroot00000000000000["tab\ character\ in\ string\ "] hjson-go-4.4.0/assets/failJSON28_test.json000066400000000000000000000000201453435002000202420ustar00rootroot00000000000000["line\ break"] hjson-go-4.4.0/assets/failJSON29_test.json000066400000000000000000000000051453435002000202460ustar00rootroot00000000000000[0e] hjson-go-4.4.0/assets/failJSON30_test.json000066400000000000000000000000061453435002000202370ustar00rootroot00000000000000[0e+] hjson-go-4.4.0/assets/failJSON31_test.json000066400000000000000000000000101453435002000202330ustar00rootroot00000000000000[0e+-1] hjson-go-4.4.0/assets/failJSON32_test.json000066400000000000000000000000511453435002000202410ustar00rootroot00000000000000{"Comma instead if closing brace": true, hjson-go-4.4.0/assets/failJSON33_test.json000066400000000000000000000000151453435002000202420ustar00rootroot00000000000000["mismatch"} hjson-go-4.4.0/assets/failJSON34_test.json000066400000000000000000000001011453435002000202370ustar00rootroot00000000000000A quoteless string is OK, but two must be contained in an array. hjson-go-4.4.0/assets/failKey1_test.hjson000066400000000000000000000000451453435002000203070ustar00rootroot00000000000000{ # invalid name wrong name: 0 } hjson-go-4.4.0/assets/failKey2_test.hjson000066400000000000000000000000401453435002000203030ustar00rootroot00000000000000{ # invalid name {name: 0 } hjson-go-4.4.0/assets/failKey3_test.hjson000066400000000000000000000000431453435002000203070ustar00rootroot00000000000000{ # invalid name key,name: 0 } hjson-go-4.4.0/assets/failKey4_test.hjson000066400000000000000000000000331453435002000203070ustar00rootroot00000000000000{ # invalid name : 0 } hjson-go-4.4.0/assets/failKey5_test.hjson000066400000000000000000000000441453435002000203120ustar00rootroot00000000000000{ # invalid name '''foo''': 0 } hjson-go-4.4.0/assets/failMLStr1_test.hjson000066400000000000000000000000511453435002000205550ustar00rootroot00000000000000{ # invalid multiline string ml: ''' hjson-go-4.4.0/assets/failObj1_test.hjson000066400000000000000000000000521453435002000202670ustar00rootroot00000000000000{ # invalid obj noDelimiter { } } hjson-go-4.4.0/assets/failObj2_test.hjson000066400000000000000000000000411453435002000202660ustar00rootroot00000000000000{ # invalid obj noEnd { } hjson-go-4.4.0/assets/failObj3_test.hjson000066400000000000000000000000461453435002000202740ustar00rootroot00000000000000{ # missing key [ test ] } hjson-go-4.4.0/assets/failStr1a_test.hjson000066400000000000000000000000511453435002000204650ustar00rootroot00000000000000{ # invalid quoteless string ql: ] } hjson-go-4.4.0/assets/failStr1b_test.hjson000066400000000000000000000000521453435002000204670ustar00rootroot00000000000000{ # invalid quoteless string ql: ]x } hjson-go-4.4.0/assets/failStr1c_test.hjson000066400000000000000000000000531453435002000204710ustar00rootroot00000000000000[ foo # invalid quoteless string ] ] hjson-go-4.4.0/assets/failStr1d_test.hjson000066400000000000000000000000541453435002000204730ustar00rootroot00000000000000[ foo # invalid quoteless string ]x ] hjson-go-4.4.0/assets/failStr2a_test.hjson000066400000000000000000000000511453435002000204660ustar00rootroot00000000000000{ # invalid quoteless string ql: } } hjson-go-4.4.0/assets/failStr2b_test.hjson000066400000000000000000000000521453435002000204700ustar00rootroot00000000000000{ # invalid quoteless string ql: }x } hjson-go-4.4.0/assets/failStr2c_test.hjson000066400000000000000000000000531453435002000204720ustar00rootroot00000000000000[ foo # invalid quoteless string } ] hjson-go-4.4.0/assets/failStr2d_test.hjson000066400000000000000000000000541453435002000204740ustar00rootroot00000000000000[ foo # invalid quoteless string }x ] hjson-go-4.4.0/assets/failStr3a_test.hjson000066400000000000000000000000511453435002000204670ustar00rootroot00000000000000{ # invalid quoteless string ql: { } hjson-go-4.4.0/assets/failStr3b_test.hjson000066400000000000000000000000521453435002000204710ustar00rootroot00000000000000{ # invalid quoteless string ql: {x } hjson-go-4.4.0/assets/failStr3c_test.hjson000066400000000000000000000000531453435002000204730ustar00rootroot00000000000000[ foo # invalid quoteless string { ] hjson-go-4.4.0/assets/failStr3d_test.hjson000066400000000000000000000000541453435002000204750ustar00rootroot00000000000000[ foo # invalid quoteless string {x ] hjson-go-4.4.0/assets/failStr4a_test.hjson000066400000000000000000000000511453435002000204700ustar00rootroot00000000000000{ # invalid quoteless string ql: [ } hjson-go-4.4.0/assets/failStr4b_test.hjson000066400000000000000000000000521453435002000204720ustar00rootroot00000000000000{ # invalid quoteless string ql: [x } hjson-go-4.4.0/assets/failStr4c_test.hjson000066400000000000000000000000531453435002000204740ustar00rootroot00000000000000[ foo # invalid quoteless string [ ] hjson-go-4.4.0/assets/failStr4d_test.hjson000066400000000000000000000000541453435002000204760ustar00rootroot00000000000000[ foo # invalid quoteless string [x ] hjson-go-4.4.0/assets/failStr5a_test.hjson000066400000000000000000000000511453435002000204710ustar00rootroot00000000000000{ # invalid quoteless string ql: : } hjson-go-4.4.0/assets/failStr5b_test.hjson000066400000000000000000000000521453435002000204730ustar00rootroot00000000000000{ # invalid quoteless string ql: :x } hjson-go-4.4.0/assets/failStr5c_test.hjson000066400000000000000000000000531453435002000204750ustar00rootroot00000000000000[ foo # invalid quoteless string : ] hjson-go-4.4.0/assets/failStr5d_test.hjson000066400000000000000000000000541453435002000204770ustar00rootroot00000000000000[ foo # invalid quoteless string :x ] hjson-go-4.4.0/assets/failStr6a_test.hjson000066400000000000000000000000511453435002000204720ustar00rootroot00000000000000{ # invalid quoteless string ql: , } hjson-go-4.4.0/assets/failStr6b_test.hjson000066400000000000000000000000521453435002000204740ustar00rootroot00000000000000{ # invalid quoteless string ql: ,x } hjson-go-4.4.0/assets/failStr6c_test.hjson000066400000000000000000000002301453435002000204730ustar00rootroot00000000000000[ # invalid quoteless string # note that if there were a preceding value the comma would # be allowed/ignored as a separator/trailing comma , ] hjson-go-4.4.0/assets/failStr6d_test.hjson000066400000000000000000000002311453435002000204750ustar00rootroot00000000000000[ # 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-4.4.0/assets/failStr7a_test.hjson000066400000000000000000000000721453435002000204760ustar00rootroot00000000000000{ # invalid string containing a newline foo : " " } hjson-go-4.4.0/assets/failStr8a_test.hjson000066400000000000000000000000551453435002000205000ustar00rootroot00000000000000{ # invalid ml-string foo : ""'text''' } hjson-go-4.4.0/assets/int64_result.hjson000066400000000000000000000000411453435002000201410ustar00rootroot00000000000000{ bigInt: 144115188075855873 } hjson-go-4.4.0/assets/int64_result.json000066400000000000000000000000431453435002000177730ustar00rootroot00000000000000{ "bigInt": 144115188075855873 } hjson-go-4.4.0/assets/int64_test.hjson000066400000000000000000000000411453435002000176020ustar00rootroot00000000000000{ bigInt: 144115188075855873 } hjson-go-4.4.0/assets/kan_result.hjson000066400000000000000000000006631453435002000177600ustar00rootroot00000000000000{ 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-4.4.0/assets/kan_result.json000066400000000000000000000010051453435002000175770ustar00rootroot00000000000000{ "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-4.4.0/assets/kan_test.hjson000066400000000000000000000010071453435002000174120ustar00rootroot00000000000000{ # 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-4.4.0/assets/keys_result.hjson000066400000000000000000000010601453435002000201520ustar00rootroot00000000000000{ 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-4.4.0/assets/keys_result.json000066400000000000000000000012541453435002000200070ustar00rootroot00000000000000{ "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-4.4.0/assets/keys_test.hjson000066400000000000000000000013501453435002000176150ustar00rootroot00000000000000{ # 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-4.4.0/assets/mltabs_result.hjson000066400000000000000000000001031453435002000204560ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' } hjson-go-4.4.0/assets/mltabs_result.json000066400000000000000000000000611453435002000203110ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" } hjson-go-4.4.0/assets/mltabs_test.json000066400000000000000000000000611453435002000177520ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" } hjson-go-4.4.0/assets/oa_result.hjson000066400000000000000000000001061453435002000175760ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-4.4.0/assets/oa_result.json000066400000000000000000000001261453435002000174300ustar00rootroot00000000000000[ "a", {}, {}, [], [], { "b": 1, "c": [], "d": {} }, [] ] hjson-go-4.4.0/assets/oa_test.hjson000066400000000000000000000001061453435002000172370ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-4.4.0/assets/pass1_result.hjson000066400000000000000000000022511453435002000202310ustar00rootroot00000000000000[ 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-4.4.0/assets/pass1_result.json000066400000000000000000000024761453435002000200720ustar00rootroot00000000000000[ "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-4.4.0/assets/pass1_test.json000066400000000000000000000026431453435002000175270ustar00rootroot00000000000000[ "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-4.4.0/assets/pass2_result.hjson000066400000000000000000000014531453435002000202350ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ Not too deep ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] hjson-go-4.4.0/assets/pass2_result.json000066400000000000000000000014551453435002000200670ustar00rootroot00000000000000[ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ [ "Not too deep" ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] hjson-go-4.4.0/assets/pass2_test.json000066400000000000000000000000651453435002000175240ustar00rootroot00000000000000[[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]] hjson-go-4.4.0/assets/pass3_result.hjson000066400000000000000000000002031453435002000202260ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": must be an object or array. "In this test": It is an object. } } hjson-go-4.4.0/assets/pass3_result.json000066400000000000000000000002101453435002000200540ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } hjson-go-4.4.0/assets/pass3_test.json000066400000000000000000000002241453435002000175220ustar00rootroot00000000000000{ "JSON Test Pattern pass3": { "The outermost value": "must be an object or array.", "In this test": "It is an object." } } hjson-go-4.4.0/assets/pass4_result.hjson000066400000000000000000000000031453435002000202250ustar00rootroot0000000000000010 hjson-go-4.4.0/assets/pass4_result.json000066400000000000000000000000031453435002000200550ustar00rootroot0000000000000010 hjson-go-4.4.0/assets/pass4_test.json000066400000000000000000000000041453435002000175170ustar00rootroot00000000000000 10 hjson-go-4.4.0/assets/pass5_result.hjson000066400000000000000000000001051453435002000202310ustar00rootroot00000000000000{ bigDouble: 9.22337203685478e+58 bigInt: 9.22337203685478e+58 } hjson-go-4.4.0/assets/pass5_result.json000066400000000000000000000001121453435002000200570ustar00rootroot00000000000000{ "bigDouble": 9.22337203685478e+58, "bigInt": 9.22337203685478e+58 } hjson-go-4.4.0/assets/pass5_test.hjson000066400000000000000000000002251453435002000176750ustar00rootroot00000000000000{ bigDouble: 92233720368547758073829419051489548484843823585675828488686.0 bigInt: 92233720368547758073829419051489548484843823585675828488686 } hjson-go-4.4.0/assets/pass6_test.hjson000066400000000000000000000001101453435002000176670ustar00rootroot00000000000000a: 1, b: 2,c:3,'d' /*cm1*/ : 4, /*cm2 */ e: /* cm3*/ 5 /* cm 4 */ f : 6 hjson-go-4.4.0/assets/passSingle_result.hjson000066400000000000000000000000301453435002000213030ustar00rootroot00000000000000allow quoteless strings hjson-go-4.4.0/assets/passSingle_result.json000066400000000000000000000000321453435002000211350ustar00rootroot00000000000000"allow quoteless strings" hjson-go-4.4.0/assets/passSingle_test.hjson000066400000000000000000000000301453435002000207440ustar00rootroot00000000000000allow quoteless strings hjson-go-4.4.0/assets/root_result.hjson000066400000000000000000000000721453435002000201640ustar00rootroot00000000000000{ database: { host: 127.0.0.1 port: 555 } } hjson-go-4.4.0/assets/root_result.json000066400000000000000000000001011453435002000200050ustar00rootroot00000000000000{ "database": { "host": "127.0.0.1", "port": 555 } } hjson-go-4.4.0/assets/root_test.hjson000066400000000000000000000001251453435002000176240ustar00rootroot00000000000000// a object with the root braces omitted database: { host: 127.0.0.1 port: 555 } hjson-go-4.4.0/assets/sorted/000077500000000000000000000000001453435002000160415ustar00rootroot00000000000000hjson-go-4.4.0/assets/sorted/charset2_result.hjson000066400000000000000000000001401453435002000222100ustar00rootroot00000000000000{ hex: ģ䕧覫췯ꯍ uescape: "\u0000,\u0001,\uffff" "um\u000blaut": äöüßÄÖÜ } hjson-go-4.4.0/assets/sorted/charset2_result.json000066400000000000000000000001471453435002000220470ustar00rootroot00000000000000{ "hex": "ģ䕧覫췯ꯍ", "uescape": "\u0000,\u0001,￿", "um\u000blaut": "äöüßÄÖÜ" } hjson-go-4.4.0/assets/sorted/charset_result.hjson000066400000000000000000000005101453435002000221270ustar00rootroot00000000000000{ js-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ml-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ql-ascii: ! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ } hjson-go-4.4.0/assets/sorted/charset_result.json000066400000000000000000000005341453435002000217650ustar00rootroot00000000000000{ "js-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ml-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~", "ql-ascii": "! \"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~" } hjson-go-4.4.0/assets/sorted/comments2_result.hjson000066400000000000000000000000021453435002000224010ustar00rootroot000000000000003 hjson-go-4.4.0/assets/sorted/comments2_result.json000066400000000000000000000000021453435002000222310ustar00rootroot000000000000003 hjson-go-4.4.0/assets/sorted/comments3_result.hjson000066400000000000000000000000531453435002000224100ustar00rootroot00000000000000a string value // still part of the string hjson-go-4.4.0/assets/sorted/comments3_result.json000066400000000000000000000000551453435002000222420ustar00rootroot00000000000000"a string value // still part of the string" hjson-go-4.4.0/assets/sorted/comments4_result.hjson000066400000000000000000000002551453435002000224150ustar00rootroot00000000000000[ a string value // still part of the string a string value {} {} {} [] {} { val5a: 1 val5b: 2 } [] [] [] [] [ 1 2 ] 3 4 ] hjson-go-4.4.0/assets/sorted/comments4_result.json000066400000000000000000000003051453435002000222410ustar00rootroot00000000000000[ "a string value // still part of the string", "a string value", {}, {}, {}, [], {}, { "val5a": 1, "val5b": 2 }, [], [], [], [], [ 1, 2 ], 3, 4 ] hjson-go-4.4.0/assets/sorted/comments5_result.hjson000066400000000000000000000004101453435002000224070ustar00rootroot00000000000000{ key1: a string value // still part of the string key2: a string value key3: 3 key4: 4 map1: {} map2: {} map3: {} map4: {} map5: { val5a: 1 val5b: 2 } vec1: [] vec1b: [] vec2: [] vec3: [] vec4: [] vec5: [ 1 2 ] } hjson-go-4.4.0/assets/sorted/comments5_result.json000066400000000000000000000004761453435002000222530ustar00rootroot00000000000000{ "key1": "a string value // still part of the string", "key2": "a string value", "key3": 3, "key4": 4, "map1": {}, "map2": {}, "map3": {}, "map4": {}, "map5": { "val5a": 1, "val5b": 2 }, "vec1": [], "vec1b": [], "vec2": [], "vec3": [], "vec4": [], "vec5": [ 1, 2 ] } hjson-go-4.4.0/assets/sorted/comments6_result.hjson000066400000000000000000000000021453435002000224050ustar00rootroot000000000000003 hjson-go-4.4.0/assets/sorted/comments6_result.json000066400000000000000000000000021453435002000222350ustar00rootroot000000000000003 hjson-go-4.4.0/assets/sorted/comments7_result.hjson000066400000000000000000000000561453435002000224170ustar00rootroot00000000000000{ a: 2 b: { sub1: 3 sub2: 4 } } hjson-go-4.4.0/assets/sorted/comments7_result.json000066400000000000000000000000701453435002000222430ustar00rootroot00000000000000{ "a": 2, "b": { "sub1": 3, "sub2": 4 } } hjson-go-4.4.0/assets/sorted/comments_result.hjson000066400000000000000000000011161453435002000223260ustar00rootroot00000000000000{ 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-4.4.0/assets/sorted/comments_result.json000066400000000000000000000012471453435002000221630ustar00rootroot00000000000000{ "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-4.4.0/assets/sorted/empty_result.hjson000066400000000000000000000000201453435002000216300ustar00rootroot00000000000000{ "": empty } hjson-go-4.4.0/assets/sorted/empty_result.json000066400000000000000000000000221453435002000214620ustar00rootroot00000000000000{ "": "empty" } hjson-go-4.4.0/assets/sorted/int64_result.hjson000066400000000000000000000000411453435002000214410ustar00rootroot00000000000000{ bigInt: 144115188075855870 } hjson-go-4.4.0/assets/sorted/int64_result.json000066400000000000000000000000431453435002000212730ustar00rootroot00000000000000{ "bigInt": 144115188075855870 } hjson-go-4.4.0/assets/sorted/kan_result.hjson000066400000000000000000000006631453435002000212600ustar00rootroot00000000000000{ 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-4.4.0/assets/sorted/kan_result.json000066400000000000000000000010061453435002000211000ustar00rootroot00000000000000{ "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-4.4.0/assets/sorted/keys_result.hjson000066400000000000000000000010601453435002000214520ustar00rootroot00000000000000{ "\"": 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-4.4.0/assets/sorted/keys_result.json000066400000000000000000000012541453435002000213070ustar00rootroot00000000000000{ "\"": "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-4.4.0/assets/sorted/mltabs_result.hjson000066400000000000000000000001031453435002000217560ustar00rootroot00000000000000{ foo: ''' bar joe oki doki two tabs ''' } hjson-go-4.4.0/assets/sorted/mltabs_result.json000066400000000000000000000000611453435002000216110ustar00rootroot00000000000000{ "foo": "bar\tjoe\noki\tdoki\n\t\ttwo tabs" } hjson-go-4.4.0/assets/sorted/oa_result.hjson000066400000000000000000000001061453435002000210760ustar00rootroot00000000000000[ a {} {} [] [] { b: 1 c: [] d: {} } [] ] hjson-go-4.4.0/assets/sorted/oa_result.json000066400000000000000000000001261453435002000207300ustar00rootroot00000000000000[ "a", {}, {}, [], [], { "b": 1, "c": [], "d": {} }, [] ] hjson-go-4.4.0/assets/sorted/pass1_result.hjson000066400000000000000000000022511453435002000215310ustar00rootroot00000000000000[ 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": "// /*