mirror of
https://github.com/irmen/prog8.git
synced 2024-07-08 10:29:09 +00:00
fixed source code output issue
This commit is contained in:
parent
bd9ebf4603
commit
e947067dcf
@ -288,7 +288,9 @@ class AstToSourceCode(val output: (text: String) -> Unit, val program: Program):
|
||||
|
||||
override fun visit(assignment: Assignment) {
|
||||
val binExpr = assignment.value as? BinaryExpression
|
||||
if(binExpr!=null && binExpr.left isSameAs assignment.target) {
|
||||
if(binExpr!=null && binExpr.left isSameAs assignment.target
|
||||
&& binExpr.operator !in setOf("and", "or", "xor")
|
||||
&& binExpr.operator !in comparisonOperators) {
|
||||
// we only support the inplace assignments of the form A = A <operator> <value>
|
||||
assignment.target.accept(this)
|
||||
output(" ${binExpr.operator}= ")
|
||||
|
@ -7,15 +7,14 @@ main {
|
||||
|
||||
sub start() {
|
||||
|
||||
ubyte ub
|
||||
uword uw = $ee44
|
||||
ubyte vlsb = $11
|
||||
ubyte vmsb = $ff
|
||||
ubyte a = 1
|
||||
ubyte b = 2
|
||||
ubyte c = 20
|
||||
ubyte d = 4
|
||||
|
||||
uw = mkword(vmsb, vlsb) ; todo flip the order of the operands , MSB first
|
||||
c64scr.print_uwhex(uw, 1)
|
||||
uw = mkword($ee, $22) ; todo flip the order of the operands , MSB first
|
||||
c64scr.print_uwhex(uw, 1)
|
||||
a = c % 6
|
||||
|
||||
c64scr.print_ub(a)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user