Make encoding/json use []byte rather than string
This commit is contained in:
1 parent
cd2c4c02e1
commit
5af20aa467
5 files changed
+68
-19
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user