mirror of
https://github.com/irmen/prog8.git
synced 2025-02-18 20:30:43 +00:00
fix warning about testing multiple values
This commit is contained in:
parent
a65404e63a
commit
9f8c70b326
@ -99,6 +99,7 @@ internal class VariousCleanups(val program: Program, val errors: IErrorReporter)
|
|||||||
val rightBinExpr = expr.right as? BinaryExpression
|
val rightBinExpr = expr.right as? BinaryExpression
|
||||||
if(leftBinExpr!=null && leftBinExpr.operator=="==" && rightBinExpr!=null && rightBinExpr.operator=="==") {
|
if(leftBinExpr!=null && leftBinExpr.operator=="==" && rightBinExpr!=null && rightBinExpr.operator=="==") {
|
||||||
if(leftBinExpr.right is NumericLiteralValue && rightBinExpr.right is NumericLiteralValue) {
|
if(leftBinExpr.right is NumericLiteralValue && rightBinExpr.right is NumericLiteralValue) {
|
||||||
|
if(leftBinExpr.left isSameAs rightBinExpr.left)
|
||||||
errors.warn("consider using 'in' or 'when' to test for multiple values", expr.position)
|
errors.warn("consider using 'in' or 'when' to test for multiple values", expr.position)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,8 @@ TODO
|
|||||||
|
|
||||||
For next compiler release (7.6)
|
For next compiler release (7.6)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
...
|
- make (an option) to let 64tass produce a listing file as well as output.
|
||||||
|
|
||||||
|
|
||||||
Blocked by an official Commander-x16 v39 release
|
Blocked by an official Commander-x16 v39 release
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
@ -16,7 +17,6 @@ Future
|
|||||||
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``v_``
|
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``v_``
|
||||||
then we can get rid of the instruction lists in the machinedefinitions as well?
|
then we can get rid of the instruction lists in the machinedefinitions as well?
|
||||||
- fix the asm-labels problem (github issue #62)
|
- fix the asm-labels problem (github issue #62)
|
||||||
- make (an option) to let 64tass produce a listing file as well as output.
|
|
||||||
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation
|
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation
|
||||||
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar
|
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar
|
||||||
- get rid of all TODO's in the code
|
- get rid of all TODO's in the code
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
main {
|
main {
|
||||||
sub start() {
|
sub start() {
|
||||||
|
ubyte xx
|
||||||
|
ubyte yy
|
||||||
|
|
||||||
|
if xx==0 or xx==4 {
|
||||||
|
xx++
|
||||||
|
}
|
||||||
txt.nl()
|
txt.nl()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user