authorgravatar for gbell12907@gmail.comCMDRZero <gbell12907@gmail.com> 2026-07-24 16:14:42-05:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2026-10-22 12:21:43+02:00
log197f7ee6d248a004763d5bb640a14dc4117d5a70
treee8c42e11c10b61fce2d3dde1ae4d2429c2c8c7ae
parentcc41245dc7c23e019a1bd307e074af4f2121e327

Update langref to include simplified operator tables.


1 files changed, 28 insertions(+), 0 deletions(-)

doc/langref.html.in+28
......@@ -1907,6 +1907,34 @@ and
19071907or
19081908= *= *%= *|= /= %= += +%= +|= -= -%= -|= <<= <<|= >>= &= ^= |={#endsyntax#}</pre>
19091909 {#header_close#}
1910 <p>
1911 However, understanding the full ambiguity rules are not necessary for reading or writing code. Instead, having an understanding of the unambiguous cases for the operators, you're using is more practical. To that end, some simplified versions, of the precedence table are provided below, tailored to understanding particular groups of operator groups. The operators that have ambiguous precedence with the given operators in question have been omitted, as have operators with higher precedence. The operators colored <span style="color: orange">orange</span> have ambiguous precedence with other operators on the same line.
1912
1913 For arithmetic and error set operators, the simplfied precedence table would look like this.
1914 </p>
1915
1916 <pre><code>* / *% *| || <span style="color: orange">%</span>
1917+ - ++ +% -% +| -|
1918== != &lt; > &lt;= >=
1919<span style="color: orange">and or</span>
1920= *= *%= *|= /= %= += +%= +|= -= -%= -|= &lt;&lt;= &lt;&lt;|= >>= &= ^= |=</code></pre>
1921
1922 <p>
1923 For bitwise operators, it would look like this:
1924 </p>
1925
1926 <pre><code><span style="color: orange">&lt;&lt; &lt;&lt;| >> & ^ |</span>
1927== != &lt; > &lt;= >=
1928<span style="color: orange">and or</span>
1929= *= *%= *|= /= %= += +%= +|= -= -%= -|= &lt;&lt;= &lt;&lt;|= >>= &= ^= |=</code></pre>
1930
1931 <p>
1932 For null and error recovery, it would look like this:
1933 </p>
1934
1935 <pre><code><span style="color: orange">catch orelse</span>
1936= *= *%= *|= /= %= += +%= +|= -= -%= -|= &lt;&lt;= &lt;&lt;|= >>= &= ^= |=</code></pre>
1937
19101938 {#header_close#}
19111939 {#header_close#}
19121940