0
Fork 0
mirror of https://codeberg.org/ziglang/zig synced 2026-11-18 07:05:05 +00:00
zig/lib/std
Andrew Kelley 56677f2f2d astgen: support blocks
We are now passing this test:

```zig
export fn _start() noreturn {}
```

```
test.zig:1:30: error: expected noreturn, found void
```

I ran into an issue where we get an integer overflow trying to compute
node index offsets from the containing Decl. The problem is that the
parser adds the Decl node after adding the child nodes. For some things,
it is easy to reserve the node index and then set it later, however, for
this case, it is not a trivial code change, because depending on tokens
after parsing the decl determines whether we want to add a new node or
not.

Possible strategies here:

1. Rework the parser code to make sure that Decl nodes are before
   children nodes in the AST node array.

2. Use signed integers for Decl node offsets.

3. Just flip the order of subtraction and addition. Expect Decl Node
   index to be greater than children Node indexes.

I opted for (3) because it seems like the simplest thing to do. We'll
want to unify the logic for computing the offsets though because if the
logic gets repeated, it will probably get repeated wrong.
History 2021-03-19 23:15:18 -07:00
..
atomic std: Swap arguments in Thread.spawn 2021-02-28 14:03:19 +01:00
build Merge pull request #7763 from kivikakk/zig-elf-parse 2021-03-04 11:56:31 -08:00
c translate-c: fix __builtin_object_size 2021-03-17 09:06:47 +02:00
compress Convert inline fn to callconv(.Inline) everywhere 2021-02-10 20:06:12 -07:00
crypto std/crypto/chacha20: add round-reduced versions & cleanup internals 2021-03-17 11:25:51 -07:00
event std: Swap arguments in Thread.spawn 2021-02-28 14:03:19 +01:00
fmt Reject bare +/- input when parsing floats 2021-03-05 13:11:20 +01:00
fs std: Fix std.fs.path.joinZ 2021-03-18 14:33:38 +02:00
hash Convert inline fn to callconv(.Inline) everywhere 2021-02-10 20:06:12 -07:00
heap std.GeneralPurposeAllocator: logging improvements 2021-01-30 20:15:26 -07:00
io make std.c.getErrno() return same type as _errno() aka c_int 2021-03-12 15:04:36 +01:00
json HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
math replace ArrayList.shrinkAndFree by ArrayList.shrinkRetainingCapacity 2021-02-21 11:56:14 +02:00
mem std: Clear old memory on free 2021-02-25 22:20:30 +02:00
meta Add some enum utilities 2021-03-18 14:05:01 -07:00
net std: Swap arguments in Thread.spawn 2021-02-28 14:03:19 +01:00
os std: Replace testing fns for floating-point values 2021-03-14 17:23:47 -04:00
rand std: disable a couple tests on windows 2021-01-02 12:21:19 -07:00
special std/special: init-exe,lib make import(std) its own decl (#8160) 2021-03-05 19:13:05 -08:00
target target: map zig ppc32 → llvm ppc 2021-02-04 14:22:38 -08:00
testing Year++ 2020-12-31 15:45:24 -08:00
Thread std: Swap arguments in Thread.spawn 2021-02-28 14:03:19 +01:00
time Year++ 2020-12-31 15:45:24 -08:00
unicode Reduce use of deprecated IO types 2021-01-07 23:48:58 -08:00
valgrind Year++ 2020-12-31 15:45:24 -08:00
zig astgen: support blocks 2021-03-19 23:15:18 -07:00
array_hash_map.zig zig fmt the std lib 2021-02-24 21:29:23 -07:00
array_list.zig Remove deprecated stream aliases 2021-01-08 16:54:56 -05:00
ascii.zig std.ascii: add lessThanIgnoreCase and orderIgnoreCase 2021-02-27 01:21:01 -07:00
atomic.zig Year++ 2020-12-31 15:45:24 -08:00
base64.zig zig fmt the std lib 2021-02-24 21:29:23 -07:00
bit_set.zig Add some enum utilities 2021-03-18 14:05:01 -07:00
buf_map.zig Year++ 2020-12-31 15:45:24 -08:00
buf_set.zig HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
build.zig HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
builtin.zig stage1: switch from inline fn to callconv(.Inline) 2021-02-10 20:06:13 -07:00
c.zig std: support optional getaddrinfo arguments 2021-03-16 01:10:32 +01:00
child_process.zig Reduce use of deprecated IO types 2021-01-07 23:48:58 -08:00
coff.zig zig fmt the std lib 2021-02-24 21:29:23 -07:00
compress.zig std: Update test "" to test where it makes sense 2021-01-22 15:46:58 +01:00
comptime_string_map.zig Year++ 2020-12-31 15:45:24 -08:00
crypto.zig std/crypto/chacha20: add round-reduced versions & cleanup internals 2021-03-17 11:25:51 -07:00
cstr.zig Year++ 2020-12-31 15:45:24 -08:00
debug.zig zld: use zld when linking aarch64 by default and cross-comp 2021-03-18 00:37:13 +01:00
dwarf.zig zig fmt the std lib 2021-02-24 21:29:23 -07:00
dwarf_bits.zig Year++ 2020-12-31 15:45:24 -08:00
dynamic_library.zig Year++ 2020-12-31 15:45:24 -08:00
elf.zig elf: make EM non-exhaustive 2021-03-11 10:09:51 +11:00
enums.zig Add some enum utilities 2021-03-18 14:05:01 -07:00
event.zig Year++ 2020-12-31 15:45:24 -08:00
fifo.zig std.fifo.LinearFifo - Expose reader and writer type. 2021-02-22 00:22:46 +02:00
fmt.zig Implement fmtDuration using Formatter (#8137) 2021-03-07 15:00:15 +02:00
fs.zig initial support for haiku sync update 2021-02-25 16:41:42 -07:00
hash.zig Year++ 2020-12-31 15:45:24 -08:00
hash_map.zig stage2 cbe: non pointer optionals 2021-03-08 00:33:56 +02:00
heap.zig Year++ 2020-12-31 15:45:24 -08:00
io.zig std: remove io.AutoIndentingStream 2021-02-16 23:20:46 +01:00
json.zig HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
leb128.zig Year++ 2020-12-31 15:45:24 -08:00
linked_list.zig Fix off-by-one error in SinglyLinkedList.len() and add associated tests 2021-01-04 14:03:21 -08:00
log.zig zig fmt the std lib 2021-02-24 21:29:23 -07:00
macho.zig zld: fix GOT loads and indirection on x86_64 2021-03-17 19:59:57 +01:00
math.zig zig fmt the std lib 2021-03-01 20:04:28 -07:00
mem.zig std: Prevent null pointer deref in mem.len{,Z} 2021-03-07 14:58:45 +02:00
meta.zig translate-c: improve std.meta.cast 2021-03-17 00:05:42 +02:00
multi_array_list.zig std: Handle empty MultiArrayList in items() 2021-03-12 00:17:35 +01:00
net.zig replace ArrayList.shrinkAndFree by ArrayList.shrinkRetainingCapacity 2021-02-21 11:56:14 +02:00
once.zig std: Swap arguments in Thread.spawn 2021-02-28 14:03:19 +01:00
os.zig std: make all errors in os.zig public 2021-03-16 14:48:31 -07:00
packed_int_array.zig Add workaround in PackedIntArray .initAllTo for #7635 2021-01-02 01:10:47 +11:00
pdb.zig Don't read more bytes than exist in MsfStream (#7839) 2021-02-01 15:27:39 -05:00
priority_queue.zig HashMap.put returns !void, not a !bool 2021-02-27 13:11:47 +02:00
process.zig initial support for haiku continue clean up 2021-02-25 16:41:42 -07:00
Progress.zig std: Use more common escape sequences in Progress 2021-03-12 19:31:59 -05:00
rand.zig std: Update test "" to test where it makes sense 2021-01-22 15:46:58 +01:00
SemanticVersion.zig Move fmt.testFmt to testing.expectFmt 2021-01-12 18:13:29 -08:00
sort.zig Fix example code in comments for asc and desc 2021-01-06 15:53:53 -08:00
start.zig Convert inline fn to callconv(.Inline) everywhere 2021-02-10 20:06:12 -07:00
start_windows_tls.zig Year++ 2020-12-31 15:45:24 -08:00
std.zig Add some enum utilities 2021-03-18 14:05:01 -07:00
target.zig haiku: minor fixups 2021-02-25 16:54:32 -07:00
testing.zig std: Replace testing fns for floating-point values 2021-03-14 17:23:47 -04:00
Thread.zig make std.c.getErrno() return same type as _errno() aka c_int 2021-03-12 15:04:36 +01:00
time.zig Year++ 2020-12-31 15:45:24 -08:00
unicode.zig Year++ 2020-12-31 15:45:24 -08:00
valgrind.zig std: Update test "" to test where it makes sense 2021-01-22 15:46:58 +01:00
wasm.zig Ensure function indices are correct and fix a memory leak 2021-02-05 18:06:25 +01:00
zig.zig stage2: *WIP*: rework ZIR memory layout; overhaul source locations 2021-03-16 00:03:22 -07:00