mirror of
https://github.com/irmen/prog8.git
synced 2024-08-18 23:29:32 +00:00
fix warning about testing multiple values
This commit is contained in:
parent
a65404e63a
commit
9f8c70b326
@ -99,7 +99,8 @@ internal class VariousCleanups(val program: Program, val errors: IErrorReporter)
|
||||
val rightBinExpr = expr.right as? BinaryExpression
|
||||
if(leftBinExpr!=null && leftBinExpr.operator=="==" && rightBinExpr!=null && rightBinExpr.operator=="==") {
|
||||
if(leftBinExpr.right is NumericLiteralValue && rightBinExpr.right is NumericLiteralValue) {
|
||||
errors.warn("consider using 'in' or 'when' to test for multiple values", expr.position)
|
||||
if(leftBinExpr.left isSameAs rightBinExpr.left)
|
||||
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)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
...
|
||||
- make (an option) to let 64tass produce a listing file as well as output.
|
||||
|
||||
|
||||
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_``
|
||||
then we can get rid of the instruction lists in the machinedefinitions as well?
|
||||
- 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() sometimes introduces needless assignment to r9 tempvar
|
||||
- get rid of all TODO's in the code
|
||||
|
@ -3,6 +3,12 @@
|
||||
|
||||
main {
|
||||
sub start() {
|
||||
ubyte xx
|
||||
ubyte yy
|
||||
|
||||
if xx==0 or xx==4 {
|
||||
xx++
|
||||
}
|
||||
txt.nl()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user