changeset 57:e2728091b75a

Added a \* macro parameter expansion to include all macro parameters
author lost@l-w.ca
date Wed, 06 Apr 2011 00:12:33 -0600
parents 337301ddf74a
children 62372522ce9c
files lwasm/macro.c
diffstat 1 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lwasm/macro.c	Wed Apr 06 00:12:01 2011 -0600
+++ b/lwasm/macro.c	Wed Apr 06 00:12:33 2011 -0600
@@ -227,7 +227,24 @@
 	{
 		for (p2 = m -> lines[lc]; *p2; p2++)
 		{
-			if (*p2 == '\\' && isdigit(p2[1]))
+			if (*p2 == '\\' && p2[1] == '*')
+			{
+				int n;
+				/* all arguments */
+				for (n = 0; n < nargs; n++)
+				{
+					for (p3 = args[n]; *p3; p3++)
+					{
+						macro_add_to_buff(&linebuff, &bloc, &blen, *p3);
+					}
+					if (n != (nargs -1))
+					{
+						macro_add_to_buff(&linebuff, &bloc, &blen, ',');
+					}
+				}
+				p2++;
+			}
+			else if (*p2 == '\\' && isdigit(p2[1]))
 			{
 				int n;