nurpax / c64jasm

C64 6502 assembler in TypeScript
51 stars 14 forks source link

Else statement syntax unclear #86

Open micheldebree opened 1 year ago

micheldebree commented 1 year ago

If I don't use the right syntax, I get a cryptic error. There is no example on the site of the right syntax.

Works:

!if (debugging) {
  lda #0
} else {
  lda #2
}

Fails:

!if (debugging) {
  lda #0
} 
else {
  lda #2 ; line 76
}

Error test.asm|76 col 7| error: Syntax error: Expected ":" but "#" found.

I would expect either for both statements to work, or have a clear message about what exactly I am doing wrong.