comparison lwasm/pass1.c @ 53:cb4efc47ce9d

Allow macros to shadow/override builtin operations when the "shadow" pragma is active, which is NOT the default
author lost@l-w.ca
date Tue, 05 Apr 2011 21:48:51 -0600
parents bd8b3fbd1e28
children 1830faeef332
comparison
equal deleted inserted replaced
52:51c840679a0e 53:cb4efc47ce9d
258 // operate within a condition (not a conditional) 258 // operate within a condition (not a conditional)
259 // do nothing 259 // do nothing
260 if (as -> skipcond && !(instab[opnum].flags & lwasm_insn_cond)) 260 if (as -> skipcond && !(instab[opnum].flags & lwasm_insn_cond))
261 goto linedone; 261 goto linedone;
262 262
263 if (as -> pragmas & PRAGMA_SHADOW)
264 {
265 // check for macros even if they shadow real operations
266 // NOTE: "ENDM" cannot be shadowed
267 if (expand_macro(as, cl, &p1, sym) == 0)
268 {
269 // a macro was expanded here
270 goto linedone;
271 }
272 }
263 if (instab[opnum].opcode == NULL) 273 if (instab[opnum].opcode == NULL)
264 { 274 {
265 cl -> insn = -1; 275 cl -> insn = -1;
266 if (*tok != ';' && *tok != '*') 276 if (*tok != ';' && *tok != '*')
267 { 277 {