| Summary: | Pywriter Bug with Dropped Brackets when Converting Pseudo-Code | ||
|---|---|---|---|
| Product: | Libre-SOC's first SoC | Reporter: | Andrey Miroshnikov <andy.miroshnikov> |
| Component: | Source Code | Assignee: | Luke Kenneth Casson Leighton <lkcl> |
| Status: | CONFIRMED --- | ||
| Severity: | enhancement | CC: | libre-soc-bugs, programmerjake |
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: | https://bugs.libre-soc.org/show_bug.cgi?id=865 | ||
| NLnet milestone: | NLNet.2019.10.031.Video | total budget (EUR) for completion of task and all subtasks: | 0 |
| budget (EUR) for this task, excluding subtasks' budget: | 0 | parent task for budget allocation: | |
| child tasks for budget allocation: | The table of payments (in EUR) for this task; TOML format: | ||
|
Description
Andrey Miroshnikov
2022-06-22 15:13:29 BST
Adding IRC log conversation: https://libre-soc.org/irclog/%23libre-soc.2022-06-22.log.html#t2022-06-22T14:45:32 binary operator precedence error. unfortunately the fix of adding explicit brackets interferes with the detection of patterns "[0]*4" which is Power ISA pseudocode for "0b0000" 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 ^ |