aboutsummaryrefslogtreecommitdiff
path: root/lib/std/json
AgeCommit message (Collapse)Author
2021-01-07Reduce use of deprecated IO typesJay Petacat
Related: #4917
2020-12-31Year++Frank Denis
2020-12-08std.json: unreachable -> expect in testsxackus
2020-11-19Add builtin.Signedness, use it instead of is_signedTadeo Kondrak
2020-11-02std: Fix json utf{8,16} decoding on BE targetsLemonBoy
Byteswap some values when LE ordering is required.
2020-08-20add license header to all std lib filesAndrew Kelley
add SPDX license identifier copyright ownership is zig contributors
2020-07-11run zig fmt on std lib and self hostedVexu
2020-05-24run zig fmt on std libAndrew Kelley
2020-05-12Merge pull request #5118 from xackus/fix-json-writestreamVexu
fix json.WriteStream.emitJson
2020-05-12std.json properly handle comptime int/floatVexu
2020-04-24Add mips support to standard libraryTimon Kruiper
2020-04-23fix json.WriteStream.emitJsonxackus
2020-04-01std: introduce json.WriteStream.stringifydaurnimator
2020-04-01std: use json.StringifyOptions.Whitespace from json.WriteStreamdaurnimator
2020-04-01std: use json.stringify logic in some json.WriteStream code pathsdaurnimator
2020-03-30std lib API deprecations for the upcoming 0.6.0 releaseAndrew Kelley
See #3811
2020-03-29fix overflow in parseFloatxackus
2020-03-10update standard library to new I/O streams APIAndrew Kelley
2020-03-10(breaking) rework stream abstractionsAndrew Kelley
The main goal here is to make the function pointers comptime, so that we don't have to do the crazy stuff with async function frames. Since InStream, OutStream, and SeekableStream are already generic across error sets, it's not really worse to make them generic across the vtable as well. See #764 for the open issue acknowledging that using generics for these abstractions is a design flaw. See #130 for the efforts to make these abstractions non-generic. This commit also changes the OutStream API so that `write` returns number of bytes written, and `writeAll` is the one that loops until the whole buffer is written.
2020-02-14std: use testing.allocator in testsdaurnimator
2020-02-12Convert a lot of json tests to use testing.allocatorBenjamin Feng
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-06zig fmt and update `extern fn` to `callconv(.C)`Andrew Kelley
2019-12-29Merge pull request #3648 from xackus/json-unescapeAndrew Kelley
breaking: JSON unescape
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-08std.fmt.format: tuple parameter instead of var argsAndrew Kelley
2019-11-11Stricter tests for non-streaming parserxackus
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-06std.json.Value: added dumpStream(), utilize WriteStream for dump()Sebastian Keller
2019-10-27Added test for 'emitJson'Sebastian Keller
2019-10-27Unified public apiSebastian Keller
2019-10-24Shortened switch statementSebastian Keller
2019-10-24Added 'writeJson' to write_stream.zig:Sebastian Keller
Small addition to make writing a json value easier
2019-10-11merge dumps tool: merging ast nodesAndrew Kelley
-fgenerate-docs is replaced ith -femit-docs -fno-emit-bin is added to prevent outputting binary
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