From 15fc094c7abb5313192339b148bde3d1e5362fc5 Mon Sep 17 00:00:00 2001 From: uz Date: Wed, 8 Jun 2011 21:09:40 +0000 Subject: [PATCH] Add recursive scanning for .define style macros: Replacement using .define is done not only when the macro is parsed, but also when it is expanded. git-svn-id: svn://svn.cc65.org/cc65/trunk@5045 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/scanner.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c index 61bf3c9f8..a9fd7c2d9 100644 --- a/src/ca65/scanner.c +++ b/src/ca65/scanner.c @@ -796,7 +796,12 @@ void NextRawTok (void) Restart: /* Check if we have tokens from another input source */ if (InputFromStack ()) { - return; + if (CurTok.Tok == TOK_IDENT && IsDefine (&CurTok.SVal)) { + /* This is a define style macro - expand it */ + MacExpandStart (); + goto Restart; + } + return; } Again: -- 2.39.5