/* common */
#include "addrsize.h"
+#include "scopedefs.h"
/* ca65 */
#include "condasm.h"
#include "enum.h"
#include "error.h"
#include "expr.h"
+#include "macro.h"
#include "nexttok.h"
#include "scanner.h"
#include "symbol.h"
/*****************************************************************************/
-/* Code */
+/* Code */
/*****************************************************************************/
int Anon = (CurTok.Tok != TOK_IDENT);
if (!Anon) {
/* Enter a new scope, then skip the name */
- SymEnterLevel (&CurTok.SVal, ST_ENUM, ADDR_SIZE_ABS, 0);
+ SymEnterLevel (&CurTok.SVal, SCOPE_ENUM, ADDR_SIZE_ABS, 0);
NextTok ();
}
/* Read until end of struct */
while (CurTok.Tok != TOK_ENDENUM && CurTok.Tok != TOK_EOF) {
+ Macro* M;
SymEntry* Sym;
ExprNode* EnumExpr;
continue;
}
+ /* We have an identifier. Is it a macro? */
+ if ((M = FindMacro (&CurTok.SVal)) != 0) {
+ MacExpandStart (M);
+ continue;
+ }
+
/* We have an identifier, generate a symbol */
Sym = SymFind (CurrentScope, &CurTok.SVal, SYM_ALLOC_NEW);
/* Free the base expression */
FreeExpr (BaseExpr);
}
-
-
-
-