[Libre-soc-bugs] [Bug 866] Pywriter Bug with Dropped Brackets when Converting Pseudo-Code

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Wed Jun 22 19:04:26 BST 2022


https://bugs.libre-soc.org/show_bug.cgi?id=866

Jacob Lifshay <programmerjake at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |programmerjake at gmail.com

--- Comment #3 from Jacob Lifshay <programmerjake at gmail.com> ---
note that python operator precedence causes `(P | G) + G ^ P` to be correctly
parsed as `((P | G) + G) ^ P`, so imho if that order of operations matches what
pywriter wanted to generate, missing parenthesis is not a problem for the
python interpreter (though imho it is a problem for readability -- but it's
generated code so doesn't necessarily need to be read very often)
https://docs.python.org/3/reference/expressions.html#operator-precedence
+ is higher precedence than ^

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list