diff options
Diffstat (limited to 'core/encoding/json/parser.odin')
| -rw-r--r-- | core/encoding/json/parser.odin | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/core/encoding/json/parser.odin b/core/encoding/json/parser.odin index 04e2bab09..448a0e41f 100644 --- a/core/encoding/json/parser.odin +++ b/core/encoding/json/parser.odin @@ -11,11 +11,12 @@ Parser :: struct { spec: Specification, allocator: mem.Allocator, unmarshal_data: any, + parse_integers: bool, } -make_parser :: proc(data: []byte, spec := Specification.JSON, allocator := context.allocator) -> Parser { +make_parser :: proc(data: []byte, spec := Specification.JSON, parse_integers := false, allocator := context.allocator) -> Parser { p: Parser; - p.tok = make_tokenizer(data, spec); + p.tok = make_tokenizer(data, spec, parse_integers); p.spec = spec; p.allocator = allocator; assert(p.allocator.procedure != nil); @@ -23,9 +24,9 @@ make_parser :: proc(data: []byte, spec := Specification.JSON, allocator := conte return p; } -parse :: proc(data: []byte, spec := Specification.JSON, allocator := context.allocator) -> (Value, Error) { +parse :: proc(data: []byte, spec := Specification.JSON, parse_integers := false, allocator := context.allocator) -> (Value, Error) { context.allocator = allocator; - p := make_parser(data, spec, allocator); + p := make_parser(data, spec, parse_integers, allocator); if p.spec == Specification.JSON5 { return parse_value(&p); |