Commit Graph

15 Commits

Author SHA1 Message Date
Andrew Kelley aeaef8c0ff update std lib and compiler sources to new for loop syntax 2023-02-18 19:17:21 -07:00
r00ster91 7826e28bd3 Re-apply: "std.ComptimeStringMap: use tuple types"
096d3efae5 was not the cause of the
CI failure.
2022-12-08 22:21:46 +02:00
Andrew Kelley 225ed65ed2 Revert "std.ComptimeStringMap: use tuple types"
This reverts commit 096d3efae5.

This commit is not passing a very important CI test that was recently
added.
2022-12-08 02:23:17 -08:00
r00ster91 096d3efae5 std.ComptimeStringMap: use tuple types
This is now possible due to #13627.
2022-12-07 14:56:55 +02:00
Andrew Kelley d29871977f remove redundant license headers from zig standard library
We already have a LICENSE file that covers the Zig Standard Library. We
no longer need to remind everyone that the license is MIT in every single
file.

Previously this was introduced to clarify the situation for a fork of
Zig that made Zig's LICENSE file harder to find, and replaced it with
their own license that required annual payments to their company.
However that fork now appears to be dead. So there is no need to
reinforce the copyright notice in every single file.
2021-08-24 12:25:09 -07:00
Ryan Liptak 7e07df06a4 ComptimeStringMap: expose kvs array in returned struct
Allows for iterating over the kvs when constructing with a list literal instead of having to create a separate array to pass into ComptimeStringMap in order to maintain access to the values.

For example when making a set, before in order to loop over the kvs you'd have to do something like:

    const MyKV = struct { @"0": []const u8 };
    const kvs: []const MyKV = &[_]MyKV{ .{ @"0" = "foo"}, .{ @"0" = "bar" } };
    const map = ComptimeStringMap(void, kvs);
    for (kvs) |kv| {}

whereas now it's possible to do:

    const map = ComptimeStringMap(void, .{ .{"foo"}, .{"bar"} });
    for (map.kvs) |kv| {}
2021-08-13 16:22:56 -07:00
Jacob G-W 9fffffb07b fix code broken from previous commit 2021-06-21 17:03:03 -07:00
Björn Linse ac42503266 std: don't reference non-existant ComptimeStringHashMap type 2021-06-15 07:57:07 +03:00
Veikka Tuominen fd77f2cfed std: update usage of std.testing 2021-05-08 15:15:30 +03:00
Frank Denis 6c2e0c2046 Year++ 2020-12-31 15:45:24 -08: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
Vexu e85fe13e44 run zig fmt on std lib and self hosted 2020-07-11 20:41:19 +03:00
Andrew Kelley d4d954abd2 std.sort: give comparator functions a context parameter 2020-06-08 15:16:40 -04:00
Ryan Liptak dfafafac7b std.ComptimeStringMap: Add support for void value type (i.e. a set) 2020-05-26 23:10:12 -07:00
Ryan Liptak 0865e5d360 Add std.ComptimeStringMap 2020-05-26 21:34:55 -07:00