comparison lwasm/pass1.c @ 85:8fa52c3f2970

Make *pragma work correctly
author lost@l-w.ca
date Wed, 25 May 2011 21:59:58 -0600
parents 1830faeef332
children 5bf9edabd661
comparison
equal deleted inserted replaced
84:16a72d9b6eb6 85:8fa52c3f2970
193 stspace = 1; 193 stspace = 1;
194 } 194 }
195 else 195 else
196 stspace = 0; 196 stspace = 0;
197 197
198 if (*p1 == '*' || *p1 == ';' || *p1 == '#') 198 // if (*p1 == '*' || *p1 == ';' || *p1 == '#')
199 goto nextline; 199 // goto nextline;
200 if (!*p1) 200 if (!*p1)
201 { 201 {
202 // nothing but whitespace - context break 202 // nothing but whitespace - context break
203 as -> context = lwasm_next_context(as); 203 as -> context = lwasm_next_context(as);
204 goto nextline; 204 goto nextline;
208 for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':' && *p1 != '='; p1++) 208 for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':' && *p1 != '='; p1++)
209 /* do nothing */ ; 209 /* do nothing */ ;
210 210
211 if (*p1 == ':' || *p1 == '=' || stspace == 0) 211 if (*p1 == ':' || *p1 == '=' || stspace == 0)
212 { 212 {
213 if (*tok == '*' || *tok == ';' || *tok == '#')
214 goto nextline;
213 // have a symbol here 215 // have a symbol here
214 sym = lw_strndup(tok, p1 - tok); 216 sym = lw_strndup(tok, p1 - tok);
215 if (*p1 == ':') 217 if (*p1 == ':')
216 p1++; 218 p1++;
217 for (; *p1 && isspace(*p1); p1++) 219 for (; *p1 && isspace(*p1); p1++)
252 for (opnum = 0; instab[opnum].opcode; opnum++) 254 for (opnum = 0; instab[opnum].opcode; opnum++)
253 { 255 {
254 if (!strcasecmp(instab[opnum].opcode, sym)) 256 if (!strcasecmp(instab[opnum].opcode, sym))
255 break; 257 break;
256 } 258 }
259
260 if (instab[opnum].opcode == NULL && (*tok == '*' || *tok == ';' || *tok == '#'))
261 goto nextline;
257 262
258 // p1 points to the start of the operand 263 // p1 points to the start of the operand
259 264
260 // if we're inside a macro definition and not at ENDM, 265 // if we're inside a macro definition and not at ENDM,
261 // add the line to the macro definition and continue 266 // add the line to the macro definition and continue