X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=30f529d018b95084e621a18c99cf272df071e5b7;hp=5b3d0737b02ea308f19938d86ec1ec3bfd3fcc53;hb=1feb728a9eb579b6441daf0124d81483f600365c;hpb=40f1a3ec69fd0f0dade867d8ffcb840add5b21f1 diff --git a/token.c b/token.c index 5b3d073..30f529d 100644 --- a/token.c +++ b/token.c @@ -314,6 +314,11 @@ int ExpandMacro(char * src, char * dest, int destsiz) if (dst >= edst) goto overflow; + // Skip comments in case a loose @ or \ is in there + // In that case the tokeniser was trying to expand it. + if (*s == '*' || *s == ';' || ((*s == '/') && (*(s + 1) == '/'))) + goto skipcomments; + *dst++ = *s++; } // Do macro expansion @@ -604,6 +609,8 @@ strcopy: } } +skipcomments: + *dst = EOS; DEBUG { printf("ExM: dst=\"%s\"\n", dest); } return OK; @@ -1278,14 +1285,7 @@ if (debug) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); // auto-optimise? I think it's ok for now... if (*ln == '.') { - if (obj_format == ALCYON) - { - if ((*(ln + 1) == 'b') || (*(ln + 1) == 'B') || (*(ln + 1) == 'w') || (*(ln + 1) == 'W') || (*(ln + 1) == 'l') || (*(ln + 1) == 'L')) - { - ln += 2; - } - } - else + if (obj_format == BSD) { if ((*(ln + 1) & 0xDF) == 'B') { @@ -1306,6 +1306,20 @@ if (debug) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); *tk++ = CONST; *tk++ = v; + + if (obj_format == ALCYON) + { + if ((*(ln + 1) == 'w') || (*(ln + 1) == 'W')) + { + *tk++ = DOTW; + ln += 2; + } + else if ((*(ln + 1) == 'l') || (*(ln + 1) == 'L')) + { + *tk++ = DOTL; + ln += 2; + } + } } else *tk++ = '$';