comparison lwasm/macro.c @ 219:afd50d6b4113

Add --preprocess option Add --preprocess option which expands macros, resolves conditions, and resolves include files if possible. If an include file is not available, it the include directive is retained.
author William Astle <lost@l-w.ca>
date Sun, 10 Jun 2012 18:24:31 -0600
parents e2728091b75a
children 03f7192fcd20
comparison
equal deleted inserted replaced
218:b0c9df865b25 219:afd50d6b4113
37 macrotab_t *m; 37 macrotab_t *m;
38 char *t; 38 char *t;
39 char tc; 39 char tc;
40 40
41 l -> len = 0; 41 l -> len = 0;
42 42 l -> hideline = 1;
43 if (as -> skipcond) 43 if (as -> skipcond)
44 { 44 {
45 as -> skipmacro = 1; 45 as -> skipmacro = 1;
46 return; 46 return;
47 } 47 }
88 as -> inmacro = 1; 88 as -> inmacro = 1;
89 } 89 }
90 90
91 PARSEFUNC(pseudo_parse_endm) 91 PARSEFUNC(pseudo_parse_endm)
92 { 92 {
93 l -> hideline = 1;
93 l -> len = 0; 94 l -> len = 0;
94 95
95 if (as -> skipcond) 96 if (as -> skipcond)
96 { 97 {
97 as -> skipmacro = 0; 98 as -> skipmacro = 0;
330 } 331 }
331 lw_free(args); 332 lw_free(args);
332 } 333 }
333 334
334 // indicate a macro was expanded 335 // indicate a macro was expanded
336 l -> hideline = 1;
335 return 0; 337 return 0;
336 } 338 }