comparison lwasm/pass1.c @ 410:acaafc70044b

Fixed "=" pseudo op to work correctly
author lost@l-w.ca
date Sun, 08 Aug 2010 23:47:16 -0600
parents fbb7bfed8076
children cac204676434
comparison
equal deleted inserted replaced
409:cba03436c720 410:acaafc70044b
183 as -> context = lwasm_next_context(as); 183 as -> context = lwasm_next_context(as);
184 goto nextline; 184 goto nextline;
185 } 185 }
186 186
187 // find the end of the first token 187 // find the end of the first token
188 for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':'; p1++) 188 for (tok = p1; *p1 && !isspace(*p1) && *p1 != ':' && *p1 != '='; p1++)
189 /* do nothing */ ; 189 /* do nothing */ ;
190 190
191 if (*p1 == ':' || stspace == 0) 191 if (*p1 == ':' || *p1 == '=' || stspace == 0)
192 { 192 {
193 // have a symbol here 193 // have a symbol here
194 sym = lw_strndup(tok, p1 - tok); 194 sym = lw_strndup(tok, p1 - tok);
195 if (*p1 == ':') 195 if (*p1 == ':')
196 p1++; 196 p1++;
197 for (; *p1 && isspace(*p1); p1++) 197 for (; *p1 && isspace(*p1); p1++)
198 /* do nothing */ ; 198 /* do nothing */ ;
199 199
200 for (tok = p1; *p1 && !isspace(*p1); p1++) 200 if (*p1 == '=')
201 /* do nothing */ ; 201 {
202 tok = p1++;
203 }
204 else
205 {
206 for (tok = p1; *p1 && !isspace(*p1); p1++)
207 /* do nothing */ ;
208 }
202 } 209 }
203 if (sym) 210 if (sym)
204 cl -> sym = lw_strdup(sym); 211 cl -> sym = lw_strdup(sym);
205 cl -> symset = 0; 212 cl -> symset = 0;
206 213