diff mc-macro.c @ 455:563a5d29ec5e

inline continue...
author kono
date Tue, 30 Nov 2004 16:46:55 +0900
parents 818505dd6e1f
children b8f95294eb77
line wrap: on
line diff
--- a/mc-macro.c	Tue Nov 30 02:30:20 2004 +0900
+++ b/mc-macro.c	Tue Nov 30 16:46:55 2004 +0900
@@ -211,6 +211,7 @@
 {
     int i;
     int c;
+    char num[10];
 
     if (next_eof) {
 	next_eof=0;
@@ -242,7 +243,31 @@
 	    }
 	}
 	*chptr = '\0';
-	if (lsrc && !asmf && !macro_if_skip && linebuf[0]) gen_comment(linebuf);
+	if (lsrc && !asmf && !macro_if_skip && linebuf[0]) {
+	    gen_comment(linebuf);
+	    if (inmode) {
+		int i=0;
+		int c;
+		char *p = cheap->ptr;
+		sprintf(num,"%d: ",lineno);
+		c = 0;
+		while((*cheap->ptr = num[c++])) 
+		    cheap = increment_cheap(cheap,&p);
+		while((c = *cheap->ptr = linebuf[i++])) {
+		    cheap = increment_cheap(cheap,&p);
+		    if (c=='\n') {
+			*cheap->ptr = 0;
+			cheap = increment_cheap(cheap,&p);
+			parse = list3(ST_COMMENT,parse,(int)p);
+			p = cheap->ptr;
+			sprintf(num,"%d: ",lineno);
+			c = 0;
+			while((*cheap->ptr = num[c++])) 
+			    cheap = increment_cheap(cheap,&p);
+		    }
+		}
+	    }
+	}
 	if (*(chptr = linebuf) == '#' && !in_comment && !in_quote) {
 	    if (macro_processing()) return;
 	}