I have a macro which detects a prefix at the beginning of a symbol. These prefixes indicate a 16 bit value, arranged as structures of arrays, to direct how the macro generates code. I simply want to detect one prefix OR the other prefix. When I try to put the two below invocations of a c-style macro in an || expression, ca65 errors out. Even if I use parentheses around each macro invocation and around the entire expression itself. I was able to work around this using .set as in the below code snippet, but is ca65's expression parsing really this broken?
Code:
entity_prefix .set starts_with .string(arg), "entity_"
lut_prefix .set starts_with .string(arg), "lut_"
.if entity_prefix || lut_prefix ;I can't just put the two macros on either side of the || or I get errors, even with parentheses applied liberally. I had to use this workaround.
lut_prefix .set starts_with .string(arg), "lut_"
.if entity_prefix || lut_prefix ;I can't just put the two macros on either side of the || or I get errors, even with parentheses applied liberally. I had to use this workaround.