Commit Graph

101 Commits

Author SHA1 Message Date
Andrew Kelley 507a8096d2 std: fix compile errors caught by stage2 AstGen
* `comptime const` is redundant
 * don't use `extern enum`; specify a tag type.
   `extern enum` is only when you need tags to alias. But aliasing tags
   is a smell. I will be making a proposal shortly to remove `extern enum`
   from the language.
 * there is no such thing as `packed enum`.
 * instead of `catch |_|`, omit the capture entirely.
 * unused function definition with missing parameter name
 * using `try` outside of a function or test
2021-04-22 18:07:46 -07:00
Lewis Gaul 74fd7107e8 Switch std.json to use an ordered hashmap 2021-04-04 10:16:59 +02:00
daurnimator d4af35b3fe HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
Benjamin Graf c70832bc41 replace ArrayList.shrinkAndFree by ArrayList.shrinkRetainingCapacity 2021-02-21 11:56:14 +02:00
Jonathan Marler 06b29c8546 std.json large number support 2021-02-01 12:40:49 -08:00
daurnimator e0a04e7f67 allow more complex comptime fields in std.json 2021-02-01 01:01:50 +11:00
daurnimator f88bb56ee5 std.json union handling should bubble up AllocationRequired 2021-02-01 01:00:15 +11:00
daurnimator 33c0a01b08 std.json support for comptime fields
Closes #6231
2021-01-31 23:41:32 +11:00
Tadeo Kondrak 0b5f3c2ef9 Replace @TagType uses, mostly with std.meta.Tag 2021-01-30 22:26:44 +02:00
Tadeo Kondrak b7767eb834 std.meta: rename TagPayloadType to TagPayload 2021-01-30 13:19:52 +02:00
Tadeo Kondrak 68ec54f386 std.meta: rename TagType to Tag 2021-01-30 13:19:52 +02:00
Jay Petacat 1595ce273e Remove deprecated stream aliases 2021-01-08 16:54:56 -05:00
Jay Petacat a9b505fa77 Reduce use of deprecated IO types
Related: #4917
2021-01-07 23:48:58 -08:00
Alex Cameron 89286376c6 std: Rename ArrayList shrink => shrinkAndFree 2021-01-06 00:55:51 +11:00
LemonBoy dd973fb365 std: Use {s} instead of {} when printing strings 2021-01-02 17:12:57 -07:00
Frank Denis 6c2e0c2046 Year++ 2020-12-31 15:45:24 -08:00
Veikka Tuominen e79acc24d3 std: clenup, fixes, fmt 2020-12-24 00:23:29 +02:00
Vexu afc21a2f1c make std.json.unescapeString pub 2020-12-10 21:19:41 +02:00
Veikka Tuominen 6d5b76a75d Merge pull request #7005 from jshholland/deprecate-span
Remove ArrayList.span
2020-11-18 13:14:48 +02:00
daurnimator 73f3f01670 Fix json parser close tracking (#6865)
* std: fix json parsing with unmatched closing tokens

* std: fix swapped json parsing errors
2020-11-09 18:29:02 -05:00
xackus 15dbab9a0c std: json: fix misleading endianness conversion 2020-11-09 18:27:07 -05:00
Josh Holland c25b157dda remove deprecated uses of ArrayList.span 2020-11-07 11:15:44 +00:00
LemonBoy 02efc2236a std: Fix json utf{8,16} decoding on BE targets
Byteswap some values when LE ordering is required.
2020-11-02 11:46:50 +01:00
John Burton 33c4ad7f3a Add missing std in dump function json.zig
Add missing std to use of std.io.getStdErr in the function dump
so that it compiles.
2020-10-20 13:39:38 +03:00
Tadeo Kondrak 771f35c593 Use less inefficient method of replacing TypeInfo.UnionField.enum_field 2020-09-07 06:23:27 -06:00
Tadeo Kondrak ac19ccf595 Update standard library for removal of TypeInfo.UnionField.enum_field 2020-09-07 06:23:26 -06:00
Andrew Kelley 4a69b11e74 add license header to all std lib files
add SPDX license identifier
copyright ownership is zig contributors
2020-08-20 16:07:04 -04:00
Andrew Kelley d159ba9295 zig fmt 2020-08-04 23:04:20 -07:00
daurnimator 978a38ee40 std: fix json parsing into unions 2020-07-24 20:35:47 +00:00
Vexu e85fe13e44 run zig fmt on std lib and self hosted 2020-07-11 20:41:19 +03:00
Andrew Kelley 289eab9177 Merge pull request #5786 from ziglang/std-hash-map
reimplement std.HashMap
2020-07-05 21:12:20 +00:00
Andrew Kelley 632acffcbd update std lib to new hash map API 2020-07-05 21:11:42 +00:00
joachimschmidt557 0ae1157e45 std.mem.dupe is deprecated, move all references in std
Replaced all occurences of std.mem.dupe in stdlib with
Allocator.dupe/std.mem.dupeZ -> Allocator.dupeZ
2020-07-04 21:40:06 +03:00
prime31 65ef74e2cd try allocation of pointer type when parsing (#5665)
* `try` allocation of pointer type when parsing

* fixes pointer destroy compile error
2020-06-22 17:30:02 +03:00
Andrew Kelley da549a72e1 zig fmt 2020-06-20 18:39:15 -04:00
daurnimator af592f0ddd std: remove std.debug.getStderrStream
Rather than migrate to new 'writer' interface, just remove it
2020-06-15 23:51:25 +10:00
Dmitry Atamanov 0328537ca6 Support stringify for vectors (#5441)
* use array's pointer
2020-05-28 23:10:16 -04:00
Andrew Kelley 1cde0edff4 json: properly stringify error sets
I did this wrong originally in
feade9ef00
2020-05-18 19:23:40 -04:00
Andrew Kelley feade9ef00 std.json: support stringify for anyerror 2020-05-17 17:07:27 -04:00
Jason Merrill 706311cad9 Fix comment typo RFC8529 -> RFC8259
Ref: https://tools.ietf.org/html/rfc8259
2020-05-12 19:11:05 -07:00
Vexu 80d0c2f166 Merge pull request #5118 from xackus/fix-json-writestream
fix json.WriteStream.emitJson
2020-05-12 17:44:06 +03:00
Vexu b1ebaba408 std.json properly handle comptime int/float 2020-05-12 15:15:21 +03:00
Josh Junon b6dc7fc9ff publicize member functions affected by #4909 2020-05-08 14:26:28 +03:00
Auguste Rame 0df82889cf Fix issue with std.json incorrectly replacing forward slashes with a backslash (#5167)
* fix breaking typo in json.zig

* add tests
2020-04-27 12:22:43 -04:00
Timon Kruiper c829f2f7b7 Add mips support to standard library 2020-04-24 15:28:55 -04:00
Vexu b6fe839248 update std lib to decls being disallowed between fields 2020-04-18 23:56:05 +03:00
xackus dbc00e2424 ArrayList: remove old (before span) API 2020-04-11 20:40:34 -04:00
Vexu 95fefcd4c9 fix broken tests 2020-04-07 16:56:48 +03:00
xackus 7a28c644aa new ArrayList API: fix everything else 2020-04-02 16:12:08 +02:00
daurnimator a32d88f12c std: add support to std.json.stringify for null literals 2020-04-01 00:12:59 +11:00