aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json.zig
AgeCommit message (Collapse)Author
2020-02-19std: add json.parse to automatically decode json into a structdaurnimator
2020-02-19std: add json.stringify to encode arbitrary values to JSONdaurnimator
2020-02-16std: Remove now-superflous hackLemonBoy
2020-02-14std: use testing.allocator in testsdaurnimator
2020-02-12Convert a lot of json tests to use testing.allocatorBenjamin Feng
2020-01-07Merge pull request #4091 from xackus/json_copy_stringsAndrew Kelley
json: implement copy_strings=false
2020-01-07json tests: don't use debug allocatorxackus
2020-01-07json: disallow overlong and out-of-range UTF-8hryx
Fixes #2379 = Overlong (non-shortest) sequences UTF-8's unique encoding scheme allows for some Unicode codepoints to be represented in multiple ways. For any of these characters, the spec forbids all but the shortest form. These disallowed longer sequences are called "overlong". As an interesting side effect of this rule, the bytes C0 and C1 never appear in valid UTF-8. = Codepoint range UTF-8 disallows representation of codepoints beyond U+10FFFF, which is the highest character which can be encoded in UTF-16. Because a 4-byte sequence is capable of resulting in such characters, they must be explicitly rejected. This rule also has an interesting side effect, which is that bytes F5 to FF never appear. = References Detecting an overlong version of a codepoint could get gnarly, but luckily The Unicode Consortium did the hard work by creating this handy table of valid byte sequences: https://unicode.org/versions/corrigendum1.html I thought this mapped nicely to the parser's state machine, so I rearranged the relevant states to make use of it.
2020-01-06json: implement copy_strings=falsexackus
2019-12-31std: fix typo in commentdaurnimator
2019-12-31std: json.unescapeString doesn't need to take an allocatordaurnimator
2019-12-31std: track decoded string length in std.json tokenizerdaurnimator
2019-12-30std: use enum literals in std.jsondaurnimator
2019-12-30std: use a union(enum) for std.json.Tokendaurnimator
2019-12-30std: fmt std/json.zigdaurnimator
2019-12-29update std/json.zig to latest language changesAndrew Kelley
fixes regression from 54231e832bae780c5012fc5cd30932447f1e1d47
2019-12-29Merge pull request #3648 from xackus/json-unescapeAndrew Kelley
breaking: JSON unescape
2019-12-16Tokenizer: Copy optional tokens prior to being set to null #3737 (#3910)Lachlan Easton
* Tokenizer: Copy optional tokens prior to being set to null #3737 * Add TODO comments, reminder to audit copying optional pattern.
2019-12-10Replace @typeOf with @TypeOf in all zig sourceRobin Voetter
This change was mostly made with `zig fmt` and this also modified some whitespace. Note that in some files, `zig fmt` produced incorrect code, so the change was made manually.
2019-12-10fix integers parsed as floatsxackus
2019-11-13std.io.getStdOut and related fns no longer can errorAndrew Kelley
Thanks to the Windows Process Environment Block, it is possible to obtain handles to the standard input, output, and error streams without possibility of failure.
2019-11-11Fix bugs in JSON parserxackus
Make comments into documentation where appropriate
2019-11-11json: surrogate pair supportxackus
test json.Parser with tests used for json.Streaming parser (some don't pass yet)
2019-11-11minor fixesxackus
2019-11-10Fix and documentxackus
2019-11-10Unescape JSON stringsxackus
2019-11-08update the codebase to use `@as`Andrew Kelley
2019-11-06std.json.Value: added dumpStream(), utilize WriteStream for dump()Sebastian Keller
2019-11-06Fixed a leak in the json parser.Sebastian Keller
parseString() created a copy of the string using the wrong allocator. Instead of using the ArenaAllocator, it was using the allocator passed into Parser.init(). This lead to a leak as the copied string was not freed when the ArenaAllocator was deinited.
2019-10-28Merge pull request #3541 from xackus/language_serverAndrew Kelley
* fix json parser crashing on empty input * make implicit cast of tagged unions to enums easier to find in docs
2019-10-27rename error and specify it in functionxackus
2019-10-27better test name for empty stringxackus
Co-Authored-By: Andrew Kelley <andrew@ziglang.org>
2019-10-27Added test for 'emitJson'Sebastian Keller
2019-10-27fix json parser crashing on empty inputxackus
remove unreachable code
2019-10-10miscellaneous improvements to generated docsAndrew Kelley
* introduce std.json.WriteStream API for writing json data to a stream * add WIP tools/merge_anal_dumps.zig for merging multiple semantic analysis dumps into one. See #3028 * add std.json.Array, improves generated docs * add test for `std.process.argsAlloc`, improves test coverage and generated docs
2019-09-25mv std/ lib/Andrew Kelley
that's all this commit does. further commits will fix cli flags and such. see #2221