authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2026-10-20 14:44:06-07:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-22 12:21:43+02:00
log755333971b19907375410c131433668528bb1bc0
tree4a19721bfd8241a5d77cf407fe3ed50dc543b5af
parenta071b0e6d2b1f09d2292d719c33b0b1ee91f0918

0.16 -> 0.17


1 files changed, 7 insertions(+), 7 deletions(-)

lib/std/zig/Parse.zig+7-7
......@@ -1656,7 +1656,7 @@ const PrecClass = struct {
16561656 break :b order;
16571657 };
16581658
1659 /// Uses the table from Zig-0.16.0
1659 /// Uses the table from Zig-0.17.0
16601660 /// * / % *% *| ||
16611661 /// + - ++ +% -% +| -|
16621662 /// << >> <<|
......@@ -1664,7 +1664,7 @@ const PrecClass = struct {
16641664 /// == != < > <= >=
16651665 /// and
16661666 /// or
1667 const v0_16_precedence_ordering = b: {
1667 const v0_17_precedence_ordering = b: {
16681668 @setEvalBranchQuota(20_000);
16691669
16701670 var order: PrecedenceArray = @splat(@splat(null));
......@@ -1704,8 +1704,8 @@ const PrecClass = struct {
17041704 return PrecClass.precedence_ordering[@backingInt(lhs.group)][@backingInt(rhs.group)];
17051705 }
17061706
1707 pub fn v0_16_cmp(lhs: PrecClass, rhs: PrecClass) Rel {
1708 return PrecClass.v0_16_precedence_ordering[@backingInt(lhs.group)][@backingInt(rhs.group)].?;
1707 pub fn v0_17_cmp(lhs: PrecClass, rhs: PrecClass) Rel {
1708 return PrecClass.v0_17_precedence_ordering[@backingInt(lhs.group)][@backingInt(rhs.group)].?;
17091709 }
17101710
17111711 fn computeTransitiveOrdering(order: *PrecedenceArray) void {
......@@ -1782,7 +1782,7 @@ fn parseExprPrecedence(p: *Parse, min_exc_prec: PrecClass, prev_operator_token:
17821782 const rel = info.prec.cmp(min_exc_prec) orelse b: {
17831783 const prev_op_tok_tag = p.tokenTag(prev_operator_token);
17841784 const prev_op_info = operTable[@backingInt(prev_op_tok_tag)];
1785 const v0_16_rel = prev_op_info.prec.v0_16_cmp(info.prec);
1785 const v0_17_rel = prev_op_info.prec.v0_17_cmp(info.prec);
17861786 try p.warnMsg(.{
17871787 .tag = .ambiguous_operator_precedence,
17881788 .is_note = false,
......@@ -1796,7 +1796,7 @@ fn parseExprPrecedence(p: *Parse, min_exc_prec: PrecClass, prev_operator_token:
17961796 .is_note = true,
17971797 .token = prev_operator_token,
17981798 });
1799 if (v0_16_rel == .gt or v0_16_rel == .eq) {
1799 if (v0_17_rel == .gt or v0_17_rel == .eq) {
18001800 try p.warnMsg(.{
18011801 .tag = .hint_operator_precedence_left,
18021802 .is_note = true,
......@@ -1816,7 +1816,7 @@ fn parseExprPrecedence(p: *Parse, min_exc_prec: PrecClass, prev_operator_token:
18161816 });
18171817 }
18181818 // Use the old precedence rules to construct the tree to ease automatic fixups
1819 break :b info.prec.v0_16_cmp(min_exc_prec);
1819 break :b info.prec.v0_17_cmp(min_exc_prec);
18201820 };
18211821
18221822 if (rel == .lt) {