The preprocessor does not ignore comments
Opened this issue · 1 comments
The preprocessor evaluates macros inside comments. Example:
.MACRO ilikepie(name)
name likes pie
.ENDMACRO
; ilikepie(David)
will become
; David likes pie
This causes errors when a macro's name is referred to without parentheses
Rules should be added to the preprocessor for the "asm" directory to match on the ; character, which the preprocessor should then consume all characters until the end of a line on. I'm unsure of whether or not this will cause issues and it might not be a complete solution (for cases where the ; follows an instruction), so it might require some additional state checking infrastructure in the preprocessor to handle it.
One possible alternative might be providing a hook for each language that is called every time a character is encountered by the preprocessor (at the moment languages can only define matchers). Thus it could maintain state as to whether or not the current text is a comment and continually consume characters if that's the case until the end of the line (since there's no way a matcher can represent this case).