ziglang/zig
150
3.0k
Fork
You've already forked zig
279

Parser: Add error when operator precedence is undefined #30160

Open
CMDRZero wants to merge 24 commits from CMDRZero/zig:ambiguous-precedence into master
pull from: CMDRZero/zig:ambiguous-precedence
merge into: ziglang:master
ziglang:master
ziglang:poll
ziglang:io-uring-update
ziglang:llvm22
ziglang:poll-ring
ziglang:debug-file-leaks-differently
ziglang:debug-file-leaks
ziglang:hate-letter-to-std.os
ziglang:i-am-a-foolish-fool
ziglang:ProcessPrng
ziglang:elfv2-dyn
ziglang:jobserver
ziglang:threadtheft
ziglang:io-threaded-no-queue
ziglang:0.15.x
ziglang:Io.net
ziglang:comptime-allocator
ziglang:restricted-function-pointers
ziglang:cli
ziglang:wasm-linker-writer
ziglang:wrangle-writer-buffering
ziglang:sha1-stream
ziglang:async-await-demo
ziglang:fixes
ziglang:0.14.x
ziglang:ast-node-methods
ziglang:spork8
ziglang:macos-debug-info
ziglang:make-vs-configure
ziglang:fuzz-macos
ziglang:main
ziglang:sans-aro
ziglang:ArrayList-reserve
ziglang:incr-bug
ziglang:llvm-ir-nosanitize-metadata
ziglang:ci-tarballs
ziglang:ci-scripts
ziglang:threadpool
ziglang:0.12.x
ziglang:new-pkg-hash
ziglang:json-diagnostics
ziglang:more-doctests
ziglang:rework-comptime-mutation
ziglang:0.11.x
ziglang:ci-perf-comment
ziglang:stage2-async
ziglang:0.10.x
ziglang:autofix
ziglang:0.9.x
ziglang:aro
ziglang:hcs
ziglang:0.8.x
ziglang:0.7.x
First-time contributor
Copy link

This is a continuation of the identically named PR in GitHub. I have since rewritten most of the code so that all comparisons are table driven and declared for imperatively, avoiding complex branching in a comparison function. This should also allow additions/modifications to be easier to apply.

See #25275 for details on the design.

I have since then also renamed sub classes to use names instead of numbers to improve readability.

I have also opted to name and, and & as logical_product and bitwise_product respectively to clarify why they have a higher precedence than their sum analog. I am not attached to these names.

This is a continuation of the identically named PR in GitHub. I have since rewritten most of the code so that all comparisons are table driven and declared for imperatively, avoiding complex branching in a comparison function. This should also allow additions/modifications to be easier to apply. See [#25275](https://github.com/ziglang/zig/pull/25275) for details on the design. I have since then also renamed sub classes to use names instead of numbers to improve readability. I have also opted to name `and`, and `&` as `logical_product` and `bitwise_product` respectively to clarify why they have a higher precedence than their sum analog. I am not attached to these names.
Remove commented out code.
Some checks failed
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
35ce48123f
Parse: remove erroneous debug stmt
Some checks failed
ci / x86_64-freebsd-release (pull_request) Failing after 24m11s
ci / x86_64-linux-debug (pull_request) Failing after 34m27s
ci / aarch64-macos-release (pull_request) Failing after 36m50s
ci / x86_64-windows-release (pull_request) Failing after 38m17s
ci / x86_64-freebsd-debug (pull_request) Failing after 38m53s
ci / x86_64-windows-debug (pull_request) Failing after 54m43s
ci / x86_64-linux-release (pull_request) Failing after 1h2m37s
ci / s390x-linux-release (pull_request) Failing after 1h2m33s
ci / aarch64-linux-release (pull_request) Failing after 1h10m41s
ci / loongarch64-linux-release (pull_request) Failing after 1h24m3s
ci / aarch64-linux-debug (pull_request) Failing after 1h28m57s
ci / aarch64-macos-debug (pull_request) Failing after 1h45m15s
ci / x86_64-linux-debug-llvm (pull_request) Failing after 1h52m42s
ci / loongarch64-linux-debug (pull_request) Failing after 2h5m35s
ci / s390x-linux-debug (pull_request) Failing after 2h30m24s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ceafa80f0d
Parse: Comply with zig fmt
All checks were successful
ci / x86_64-freebsd-release (pull_request) Successful in 33m12s
ci / x86_64-freebsd-debug (pull_request) Successful in 41m44s
ci / x86_64-windows-release (pull_request) Successful in 43m22s
ci / x86_64-linux-debug (pull_request) Successful in 51m31s
ci / aarch64-macos-release (pull_request) Successful in 51m9s
ci / x86_64-windows-debug (pull_request) Successful in 54m5s
ci / aarch64-linux-release (pull_request) Successful in 1h19m27s
ci / s390x-linux-release (pull_request) Successful in 1h22m56s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 1h26m29s
ci / aarch64-macos-debug (pull_request) Successful in 1h30m22s
ci / aarch64-linux-debug (pull_request) Successful in 1h50m54s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / loongarch64-linux-release (pull_request) Successful in 2h16m4s
ci / loongarch64-linux-debug (pull_request) Successful in 2h42m23s
ci / x86_64-linux-release (pull_request) Successful in 2h42m52s
ci / s390x-linux-debug (pull_request) Successful in 2h48m49s
b399f1c407
Author
First-time contributor
Copy link

@andrewrk, As per your comment on #25275, This is the migrated version of that work. Linking for continuity.

@andrewrk, As per your comment on [#25275](https://github.com/ziglang/zig/pull/25275), This is the migrated version of that work. Linking for continuity.
Ast: Update Error Message for .ambiguous_operator_precedence
All checks were successful
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / x86_64-freebsd-release (pull_request) Successful in 42m40s
ci / x86_64-windows-release (pull_request) Successful in 49m31s
ci / x86_64-windows-debug (pull_request) Successful in 50m33s
ci / x86_64-freebsd-debug (pull_request) Successful in 51m14s
ci / x86_64-linux-debug (pull_request) Successful in 57m52s
ci / aarch64-macos-release (pull_request) Successful in 58m53s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 1h24m2s
ci / aarch64-linux-release (pull_request) Successful in 1h24m52s
ci / s390x-linux-release (pull_request) Successful in 1h25m16s
ci / aarch64-macos-debug (pull_request) Successful in 1h41m35s
ci / aarch64-linux-debug (pull_request) Successful in 1h50m54s
ci / loongarch64-linux-release (pull_request) Successful in 2h15m32s
ci / s390x-linux-debug (pull_request) Successful in 2h17m25s
ci / loongarch64-linux-debug (pull_request) Successful in 3h6m39s
ci / x86_64-linux-release (pull_request) Successful in 2h42m26s
4769631a13
Author
First-time contributor
Copy link

I will fix the merge conflict soon, but I was fixing to draft up what the new Operator Precedence section on the Language Reference could look like. I'm more than open to suggestions, especially on some of the grouping names. These use the internal names I used, however they can be dropped since the original reference didn't even label what a grouping of symbols was called. Here I only labeled which groups were non-chainable. I also double boxed the coercion symbols even tho there's only one sub group in it to keep with the style I had established. Likewise, hopefully its clear from this that ^ has no defined precedence relative to any bitwise nor arithmetic operator, but does to all else.

The idea is that only operators with a clearly ordering have unambiguous precedence, but mixing say + and << would so have undefined precedence. Even tho the code doesn't handle suffix/prefix nor assignment operators, they were listed in the Language Reference so I have included them here.

 ┌───Suffix─&─Prefix───┐ 
 │┌───────────────────┐│ 
 ││x() x[] x.y x.* x.?││ 
 ││a!b ││ 
 ││x{} ││ 
 ││!x -x -%x ~x &x ?x ││ 
 │└───────────────────┘│ 
 └─┬────────────────┬──┘ 
 │ │ 
 ┌─────────┘ ▼ 
 │ ┌──Bitwise──┐ 
 ▼ │┌─────────┐│ 
┌───────────Arithmetic───────────┐ ││<< <<| >>││ 
│┌────────────┐ ┌Non-Chaining┐│ │└────┬────┘│ 
││* *% *| / ||│◄──►│ ** % ││ │ │ │ 
│└───────┬────┘ └────┬───────┘│ │ ┌▼┐ │ 
│ │ │ │ │ │&│ │ 
│ ┌─▼──────────────▼─┐ │ │ └┬┘ ┌─┐│ 
│ │+ - +% -% +| -| ++│ │ │ │ │^││ 
│ └──────────────────┘ │ │ ┌▼┐ └─┘│ 
└─────────────────────────────┬──┘ │ │|│ │ 
 │ │ └─┘ │ 
 │ └───┬───────┘ 
 │ │ 
 ┌─▼─Coercion─▼─┐ 
 │┌────────────┐│ 
 ││orelse catch││ 
 │└────────────┘│ 
 └──────┬───────┘ 
 ▼ 
 ┌────Comparison────┐ 
 │┌──Non-Chaining──┐│ 
 ││== != < <= >= >││ 
 │└────────────────┘│ 
 └────────┬─────────┘ 
 ▼ 
 ┌Logical┐ 
 │ ┌───┐ │ 
 │ │and│ │ 
 │ └─┬─┘ │ 
 │ │ │ 
 │ ┌─▼─┐ │ 
 │ │or │ │ 
 │ └───┘ │ 
 └───┬───┘ 
 ▼ 
 ┌───────────────────────────Assignment───────────────────────────┐
 │┌─────────────────────────Non-Chaining─────────────────────────┐│
 ││= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |=││
 │└──────────────────────────────────────────────────────────────┘│
 └────────────────────────────────────────────────────────────────┘
I will fix the merge conflict soon, but I was fixing to draft up what the new Operator Precedence section on the Language Reference could look like. I'm more than open to suggestions, especially on some of the grouping names. These use the internal names I used, however they can be dropped since the original reference didn't even label what a grouping of symbols was called. Here I only labeled which groups were non-chainable. I also double boxed the `coercion` symbols even tho there's only one sub group in it to keep with the style I had established. Likewise, hopefully its clear from this that `^` has no defined precedence relative to any bitwise nor arithmetic operator, but does to all else. The idea is that only operators with a clearly ordering have unambiguous precedence, but mixing say `+` and `<<` would so have undefined precedence. Even tho the code doesn't handle suffix/prefix nor assignment operators, they were listed in the Language Reference so I have included them here. ``` ┌───Suffix─&─Prefix───┐ │┌───────────────────┐│ ││x() x[] x.y x.* x.?││ ││a!b ││ ││x{} ││ ││!x -x -%x ~x &x ?x ││ │└───────────────────┘│ └─┬────────────────┬──┘ │ │ ┌─────────┘ ▼ │ ┌──Bitwise──┐ ▼ │┌─────────┐│ ┌───────────Arithmetic───────────┐ ││<< <<| >>││ │┌────────────┐ ┌Non-Chaining┐│ │└────┬────┘│ ││* *% *| / ||│◄──►│ ** % ││ │ │ │ │└───────┬────┘ └────┬───────┘│ │ ┌▼┐ │ │ │ │ │ │ │&│ │ │ ┌─▼──────────────▼─┐ │ │ └┬┘ ┌─┐│ │ │+ - +% -% +| -| ++│ │ │ │ │^││ │ └──────────────────┘ │ │ ┌▼┐ └─┘│ └─────────────────────────────┬──┘ │ │|│ │ │ │ └─┘ │ │ └───┬───────┘ │ │ ┌─▼─Coercion─▼─┐ │┌────────────┐│ ││orelse catch││ │└────────────┘│ └──────┬───────┘ ▼ ┌────Comparison────┐ │┌──Non-Chaining──┐│ ││== != < <= >= >││ │└────────────────┘│ └────────┬─────────┘ ▼ ┌Logical┐ │ ┌───┐ │ │ │and│ │ │ └─┬─┘ │ │ │ │ │ ┌─▼─┐ │ │ │or │ │ │ └───┘ │ └───┬───┘ ▼ ┌───────────────────────────Assignment───────────────────────────┐ │┌─────────────────────────Non-Chaining─────────────────────────┐│ ││= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |=││ │└──────────────────────────────────────────────────────────────┘│ └────────────────────────────────────────────────────────────────┘ ```
Merge Upstream Changes & Fix Precedence Errors in lib\compiler_rt\floor_ceil.zig
Some checks failed
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / riscv64-linux-debug (pull_request) Has been cancelled
ci / riscv64-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
9b9ba4f31c
Remove untracked objects
Some checks failed
ci / x86_64-freebsd-release (pull_request) Successful in 39m49s
ci / x86_64-freebsd-debug (pull_request) Successful in 55m30s
ci / x86_64-openbsd-release (pull_request) Successful in 1h7m51s
ci / aarch64-linux-release (pull_request) Successful in 1h29m25s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h23m22s
ci / aarch64-macos-release (pull_request) Successful in 1h4m51s
ci / aarch64-linux-debug (pull_request) Successful in 2h22m18s
ci / x86_64-windows-debug (pull_request) Successful in 58m41s
ci / x86_64-windows-release (pull_request) Successful in 54m43s
ci / x86_64-linux-debug (pull_request) Successful in 1h22m12s
ci / x86_64-linux-release (pull_request) Successful in 2h48m50s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h2m0s
ci / aarch64-macos-debug (pull_request) Successful in 2h5m30s
ci / s390x-linux-release (pull_request) Successful in 1h38m28s
ci / s390x-linux-debug (pull_request) Successful in 3h33m0s
ci / powerpc64le-linux-release (pull_request) Successful in 1h42m34s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h25m17s
ci / riscv64-linux-debug (pull_request) Has been skipped
ci / riscv64-linux-release (pull_request) Has been skipped
ci / loongarch64-linux-release (pull_request) Failing after 51s
ci / loongarch64-linux-debug (pull_request) Failing after 1m51s
98db4570b3

Needs a rebase for the conflict and CI failure.

Needs a rebase for the conflict and CI failure.
Merge branch 'master' of https://codeberg.org/ziglang/zig into ambiguous-precedence
Some checks failed
ci / aarch64-linux-debug (pull_request) Has been cancelled
ci / aarch64-linux-release (pull_request) Has been cancelled
ci / aarch64-macos-debug (pull_request) Has been cancelled
ci / aarch64-macos-release (pull_request) Has been cancelled
ci / loongarch64-linux-debug (pull_request) Has been cancelled
ci / loongarch64-linux-release (pull_request) Has been cancelled
ci / powerpc64le-linux-debug (pull_request) Has been cancelled
ci / powerpc64le-linux-release (pull_request) Has been cancelled
ci / s390x-linux-debug (pull_request) Has been cancelled
ci / s390x-linux-release (pull_request) Has been cancelled
ci / x86_64-freebsd-debug (pull_request) Has been cancelled
ci / x86_64-freebsd-release (pull_request) Has been cancelled
ci / x86_64-linux-debug (pull_request) Has been cancelled
ci / x86_64-linux-debug-llvm (pull_request) Has been cancelled
ci / x86_64-linux-release (pull_request) Has been cancelled
ci / x86_64-openbsd-debug (pull_request) Has been cancelled
ci / x86_64-openbsd-release (pull_request) Has been cancelled
ci / x86_64-windows-debug (pull_request) Has been cancelled
ci / x86_64-windows-release (pull_request) Has been cancelled
532c404033
Author
First-time contributor
Copy link

A minor potential issue has come to my attention. As it stands, the partially ordered precedence system implemented here functions as a subset of the status quo (same semantics or it throws an error) with one small exception — bitwise operators. As it stands, using ^ is unambiguous as it cannot be freely mixed with other bitwise operators, however in status quo zig, the following code:
x | y & z is parsed as (x | y) & z
Which is different then in the new system which lofts & above |. I believe that this should be the ordering, however I am willing to weaken them all to being either equal or mutually ambiguous if the risk of a silent change in semantics is too great a cost. That being said, no tests have ever failed from this and I believe this is owed to the above construct being contrived and unlikely to occur in practice.
I have also split out catch and orelse from the bitwise operators, however I could not come up with an instance where this causes code to change semantics, so I currently consider this a non-issue.

A minor potential issue has come to my attention. As it stands, the partially ordered precedence system implemented here functions as a subset of the status quo (same semantics or it throws an error) with one small exception — bitwise operators. As it stands, using `^` is unambiguous as it cannot be freely mixed with other bitwise operators, however in status quo zig, the following code: `x | y & z` is parsed as `(x | y) & z` Which is different then in the new system which lofts `&` above `|`. I believe that this should be the ordering, however I am willing to weaken them all to being either equal or mutually ambiguous if the risk of a silent change in semantics is too great a cost. That being said, no tests have ever failed from this and I believe this is owed to the above construct being contrived and unlikely to occur in practice. I have also split out `catch` and `orelse` from the bitwise operators, however I could not come up with an instance where this causes code to change semantics, so I currently consider this a non-issue.
Merge branch 'master' into ambiguous-precedence
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 28m55s
ci / x86_64-freebsd-release (pull_request) Successful in 34m0s
ci / x86_64-freebsd-debug (pull_request) Successful in 41m54s
ci / x86_64-windows-release (pull_request) Successful in 44m4s
ci / x86_64-windows-debug (pull_request) Successful in 45m5s
ci / aarch64-macos-debug (pull_request) Successful in 58m24s
ci / aarch64-linux-release (pull_request) Successful in 1h28m5s
ci / aarch64-linux-debug (pull_request) Successful in 2h14m54s
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m58s
ci / x86_64-openbsd-debug (pull_request) Successful in 1h17m26s
ci / x86_64-linux-debug (pull_request) Successful in 1h21m26s
ci / x86_64-linux-release (pull_request) Successful in 2h6m48s
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h1m51s
ci / powerpc64le-linux-release (pull_request) Successful in 1h41m39s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h28m54s
ci / s390x-linux-release (pull_request) Successful in 2h32m32s
ci / s390x-linux-debug (pull_request) Successful in 3h42m53s
ci / loongarch64-linux-release (pull_request) Successful in 2h20m37s
ci / loongarch64-linux-debug (pull_request) Successful in 2h56m20s
82f8cbf954
All checks were successful
ci / aarch64-macos-release (pull_request) Successful in 28m55s
Required
Details
ci / x86_64-freebsd-release (pull_request) Successful in 34m0s
Required
Details
ci / x86_64-freebsd-debug (pull_request) Successful in 41m54s
Required
Details
ci / x86_64-windows-release (pull_request) Successful in 44m4s
Required
Details
ci / x86_64-windows-debug (pull_request) Successful in 45m5s
Required
Details
ci / aarch64-macos-debug (pull_request) Successful in 58m24s
Required
Details
ci / aarch64-linux-release (pull_request) Successful in 1h28m5s
Required
Details
ci / aarch64-linux-debug (pull_request) Successful in 2h14m54s
Required
Details
ci / x86_64-openbsd-release (pull_request) Successful in 1h2m58s
Required
Details
ci / x86_64-openbsd-debug (pull_request) Successful in 1h17m26s
Required
Details
ci / x86_64-linux-debug (pull_request) Successful in 1h21m26s
Required
Details
ci / x86_64-linux-release (pull_request) Successful in 2h6m48s
Required
Details
ci / x86_64-linux-debug-llvm (pull_request) Successful in 3h1m51s
Required
Details
ci / powerpc64le-linux-release (pull_request) Successful in 1h41m39s
ci / powerpc64le-linux-debug (pull_request) Successful in 4h28m54s
ci / s390x-linux-release (pull_request) Successful in 2h32m32s
ci / s390x-linux-debug (pull_request) Successful in 3h42m53s
ci / loongarch64-linux-release (pull_request) Successful in 2h20m37s
ci / loongarch64-linux-debug (pull_request) Successful in 2h56m20s
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u ambiguous-precedence:CMDRZero-ambiguous-precedence
git switch CMDRZero-ambiguous-precedence
Sign in to join this conversation.
No reviewers
Labels
Clear labels
abi/f32
abi/ilp32
abi/n32
abi/sf
abi/x32
accepted

This proposal is planned.
arch/1750a
arch/21k
arch/6502
arch/a29k
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/avr32
arch/bfin
arch/bpf
arch/clipper
arch/colossus
arch/cr16
arch/cris
arch/csky
arch/dlx
arch/dsp16xx
arch/elxsi
arch/epiphany
arch/fr30
arch/frv
arch/h8300
arch/h8500
arch/hexagon
arch/hppa
arch/hppa64
arch/i370
arch/i860
arch/i960
arch/ia64
arch/ip2k
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/maxq
arch/mcore
arch/metag
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/mn10200
arch/mn10300
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/nios2
arch/ns32k
arch/nvptx
arch/or1k
arch/pdp10
arch/pdp11
arch/pj
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390
arch/s390x
arch/sh
arch/sh64
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/st200
arch/starcore
arch/tilegx
arch/tilepro
arch/tricore
arch/ts
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/we32k
arch/x86
arch/x86_16
arch/x86_64
arch/xcore
arch/xgate
arch/xstormy16
arch/xtensa
autodoc

The web application for interactive documentation and generation of its assets.
backend/c

The C backend outputs C source code.
backend/llvm

The LLVM backend outputs an LLVM bitcode module.
backend/self-hosted

The self-hosted backends produce machine code directly.
binutils

Zig's included binary utilities: zig ar, zig dlltool, zig lib, zig ranlib, zig objcopy, and zig rc.
breaking

Implementing this issue could cause existing code to no longer compile or have different behavior.
build system

The Zig build system - zig build, std.Build, the build runner, and package management.
debug info

An issue related to debug information (e.g. DWARF) produced by the Zig compiler.
docs

An issue with documentation, e.g. the language reference or standard library doc comments.
error message

This issue points out an error message that is unhelpful and should be improved.
frontend

Tokenization, parsing, AstGen, ZonGen, Sema, Legalize, and Liveness.
fuzzing

An issue related to Zig's integrated fuzz testing.
incremental

Reuse of internal compiler state for faster compilation.
lib/c

This issue relates to Zig's libc implementation and/or vendored libcs.
lib/compiler-rt

This issue relates to Zig's compiler-rt library.
lib/cxx

This issue relates to Zig's vendored libc++ and/or libc++abi.
lib/std

This issue relates to Zig's standard library.
lib/tsan

This issue relates to Zig's vendored libtsan.
lib/ubsan-rt

This issue relates to Zig's ubsan-rt library.
lib/unwind

This issue relates to Zig's vendored libunwind.
linking

Zig's integrated object file and incremental linker.
miscompilation

The compiler reports success but produces semantically incorrect code.
os/aix
os/android
os/bridgeos
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/kfreebsd
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/solaris
os/tvos
os/uefi
os/visionos
os/wali
os/wasi
os/watchos
os/windows
os/zos
proposal

This issue suggests modifications. If it also has the "accepted" label then it is planned.
release notes

This issue or pull request should be mentioned in the release notes.
testing

This issue is related to testing the compiler, standard library, or other parts of Zig.
tier system

This issue tracks the support tier for a target.
zig cc

Zig as a drop-in C-family compiler.
zig fmt

The Zig source code formatter.
bounty

https://ziglang.org/news/announcing-donor-bounties
bug

Observed behavior contradicts documented or intended behavior.
contributor-friendly

This issue is limited in scope and/or knowledge of project internals.
downstream

An issue with a third-party project that uses this project.
enhancement

Solving this issue will likely involve adding new logic or components to the codebase.
infra

An issue related to project infrastructure, e.g. continuous integration.
optimization

A task to improve performance and/or resource usage.
question

No questions on the issue tracker; use a community space instead.
regression

A bug that did not occur in a previous version.
upstream

An issue with a third-party project that this project uses.
No labels
abi/f32
abi/ilp32
abi/n32
abi/sf
abi/x32
accepted
arch/1750a
arch/21k
arch/6502
arch/a29k
arch/aarch64
arch/alpha
arch/amdgcn
arch/arc
arch/arc32
arch/arc64
arch/arm
arch/avr
arch/avr32
arch/bfin
arch/bpf
arch/clipper
arch/colossus
arch/cr16
arch/cris
arch/csky
arch/dlx
arch/dsp16xx
arch/elxsi
arch/epiphany
arch/fr30
arch/frv
arch/h8300
arch/h8500
arch/hexagon
arch/hppa
arch/hppa64
arch/i370
arch/i860
arch/i960
arch/ia64
arch/ip2k
arch/kalimba
arch/kvx
arch/lanai
arch/lm32
arch/loongarch32
arch/loongarch64
arch/m32r
arch/m68k
arch/m88k
arch/maxq
arch/mcore
arch/metag
arch/microblaze
arch/mips
arch/mips64
arch/mmix
arch/mn10200
arch/mn10300
arch/moxie
arch/mrisc32
arch/msp430
arch/nds32
arch/nios2
arch/ns32k
arch/nvptx
arch/or1k
arch/pdp10
arch/pdp11
arch/pj
arch/powerpc
arch/powerpc64
arch/propeller
arch/riscv32
arch/riscv64
arch/rl78
arch/rx
arch/s390
arch/s390x
arch/sh
arch/sh64
arch/sparc
arch/sparc64
arch/spirv
arch/spu
arch/st200
arch/starcore
arch/tilegx
arch/tilepro
arch/tricore
arch/ts
arch/v850
arch/vax
arch/vc4
arch/ve
arch/wasm
arch/we32k
arch/x86
arch/x86_16
arch/x86_64
arch/xcore
arch/xgate
arch/xstormy16
arch/xtensa
autodoc
backend/c
backend/llvm
backend/self-hosted
binutils
breaking
build system
debug info
docs
error message
frontend
fuzzing
incremental
lib/c
lib/compiler-rt
lib/cxx
lib/std
lib/tsan
lib/ubsan-rt
lib/unwind
linking
miscompilation
os/aix
os/android
os/bridgeos
os/contiki
os/dragonfly
os/driverkit
os/emscripten
os/freebsd
os/fuchsia
os/haiku
os/hermit
os/hurd
os/illumos
os/ios
os/kfreebsd
os/linux
os/maccatalyst
os/macos
os/managarm
os/netbsd
os/ohos
os/openbsd
os/plan9
os/redox
os/rtems
os/serenity
os/solaris
os/tvos
os/uefi
os/visionos
os/wali
os/wasi
os/watchos
os/windows
os/zos
proposal
release notes
testing
tier system
zig cc
zig fmt
bounty
bug
contributor-friendly
downstream
enhancement
infra
optimization
question
regression
upstream
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
ziglang/zig!30160
Reference in a new issue
ziglang/zig
No description provided.
Delete branch "CMDRZero/zig:ambiguous-precedence"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?