Make encoding/json use []byte rather than string

This commit is contained in:
gingerBill
2019-01-07 23:08:38 +00:00
parent cd2c4c02e1
commit 5af20aa467
5 changed files with 68 additions and 19 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ Parser :: struct {
allocator: mem.Allocator,
}
make_parser :: proc(data: string, spec := Specification.JSON, allocator := context.allocator) -> Parser {
make_parser :: proc(data: []byte, spec := Specification.JSON, allocator := context.allocator) -> Parser {
p: Parser;
p.tok = make_tokenizer(data, spec);
p.spec = spec;
@@ -21,7 +21,7 @@ make_parser :: proc(data: string, spec := Specification.JSON, allocator := conte
return p;
}
parse :: proc(data: string, spec := Specification.JSON, allocator := context.allocator) -> (Value, Error) {
parse :: proc(data: []byte, spec := Specification.JSON, allocator := context.allocator) -> (Value, Error) {
context.allocator = allocator;
p := make_parser(data, spec, allocator);