1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-05 09:29:37 +00:00

Restricted commit b9a3c78888 to classic-style Assembly macros.

.include will work at expansion-time for .define macros.
This commit is contained in:
Greg King 2021-05-17 19:48:47 -04:00
parent 4a57656f69
commit d14148ab4f

View File

@ -438,9 +438,7 @@ void MacDef (unsigned Style)
/* Parse the parameter list */
if (HaveParams) {
while (CurTok.Tok == TOK_IDENT) {
/* Create a struct holding the identifier */
IdDesc* I = NewIdDesc (&CurTok.SVal);
@ -449,6 +447,7 @@ void MacDef (unsigned Style)
M->Params = I;
} else {
IdDesc* List = M->Params;
while (1) {
if (SB_Compare (&List->Id, &CurTok.SVal) == 0) {
Error ("Duplicate symbol '%m%p'", &CurTok.SVal);
@ -490,9 +489,8 @@ void MacDef (unsigned Style)
** the .LOCAL command is detected and removed, at this time.
*/
while (1) {
/* Check for include */
if (CurTok.Tok == TOK_INCLUDE) {
if (CurTok.Tok == TOK_INCLUDE && Style == MAC_STYLE_CLASSIC) {
/* Include another file */
NextTok ();
/* Name must follow */
@ -529,9 +527,7 @@ void MacDef (unsigned Style)
/* Check for a .LOCAL declaration */
if (CurTok.Tok == TOK_LOCAL && Style == MAC_STYLE_CLASSIC) {
while (1) {
IdDesc* I;
/* Skip .local or comma */
@ -570,6 +566,7 @@ void MacDef (unsigned Style)
if (CurTok.Tok == TOK_IDENT) {
unsigned Count = 0;
IdDesc* I = M->Params;
while (I) {
if (SB_Compare (&I->Id, &CurTok.SVal) == 0) {
/* Local param name, replace it */