sasq64 / bass

Advanced 6502 assembler
23 stars 4 forks source link

Comment lines without newline before EOT can result in "syntax error" #28

Closed antis81 closed 1 year ago

antis81 commented 3 years ago

Usually an EOL (newline) is optional at the end of each text file.

In my project however I am using quite some (lua & asm) includes. Having one of them ending with a comment line without newline before end-of-file produces a "syntax error" at exactly that line:

; included.asm

!macro inc_macro(value) {
    ; macro code
}

; comment without newline  <- "sporadic" syntax error
; main.asm

!include "included.asm"
!include "another_include.asm"
!script "script_include.lua"

; more code…

It may be important to the issue that the file is included. This is reproducible with my project - unfortunately not with any test-code I tried (even the above example should be parsed fine).

:bulb: Workaround: Add a newline at the end of each file.

sasq64 commented 1 year ago

Seems to be fixed