comparison lwasm/macro.c @ 40:d96037ea0b80

Fixed line number counting being broken by macros
author lost@l-w.ca
date Sat, 02 Apr 2011 22:28:22 -0600
parents 23b01aa3ecf9
children bd8b3fbd1e28
comparison
equal deleted inserted replaced
39:23b01aa3ecf9 40:d96037ea0b80
265 } 265 }
266 266
267 { 267 {
268 char ctcbuf[100]; 268 char ctcbuf[100];
269 char *p; 269 char *p;
270 snprintf(ctcbuf, 100, "\001\001SETCONTEXT %d\n", oldcontext); 270 snprintf(ctcbuf, 100, "\001\001SETCONTEXT %d\n\001\001SETLINENO %d\n", oldcontext, cl -> lineno + 1);
271 for (p = ctcbuf; *p; p++) 271 for (p = ctcbuf; *p; p++)
272 macro_add_to_buff(&linebuff, &bloc, &blen, *p); 272 macro_add_to_buff(&linebuff, &bloc, &blen, *p);
273 } 273 }
274 macro_add_to_buff(&linebuff, &bloc, &blen, 0); 274 macro_add_to_buff(&linebuff, &bloc, &blen, 0);
275 275