diff lwasm/pseudo.c @ 41:c6b8b455d67f

Fix line number sequence after including a file
author lost@l-w.ca
date Sat, 02 Apr 2011 22:33:39 -0600
parents 7e92484cfbc3
children bad2ee25acdd
line wrap: on
line diff
--- a/lwasm/pseudo.c	Sat Apr 02 22:28:22 2011 -0600
+++ b/lwasm/pseudo.c	Sat Apr 02 22:33:39 2011 -0600
@@ -1044,7 +1044,8 @@
 	char *p3;
 	int delim = 0;
 	int len;
-	
+	char buf[110];
+		
 	if (!**p)
 	{
 		lwasm_register_error(as, l, "Missing filename");
@@ -1068,6 +1069,10 @@
 	(*p) = p2;
 	if (delim && **p)
 		(*p)++;
+
+	/* add a book-keeping entry for line numbers */
+	snprintf(buf, 100, "\001\001SETLINENO %d\n", l -> lineno + 1);
+	input_openstring(as, "INTERNAL", buf);
 	
 	len = strlen(fn) + 8;
 	p3 = lw_alloc(len + 1);