Check for macros within .STRUCT/.ENUM.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5076 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz
2011-07-08 09:55:17 +00:00
parent 241afdc738
commit bf6b0b9eb7
3 changed files with 23 additions and 4 deletions

View File

@@ -41,6 +41,7 @@
#include "enum.h"
#include "error.h"
#include "expr.h"
#include "macro.h"
#include "nexttok.h"
#include "scanner.h"
#include "symbol.h"
@@ -75,6 +76,7 @@ void DoEnum (void)
/* Read until end of struct */
while (CurTok.Tok != TOK_ENDENUM && CurTok.Tok != TOK_EOF) {
Macro* M;
SymEntry* Sym;
ExprNode* EnumExpr;
@@ -93,6 +95,12 @@ void DoEnum (void)
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);