#define ULAS_PATHMAX 4096
#define ULAS_LINEMAX 4096
#define ULAS_OUTBUFMAX 64
-#define ULAS_MACROPARAMMAX 9
+#define ULAS_MACROPARAMMAX 15
#define MAX(x, y) (((x) > (y)) ? (x) : (y))
#define MIN(x, y) (((x) < (y)) ? (x) : (y))
}
case ULAS_PPMACRO: {
// TODO: i am sure we can optimize the resize of line buffers here...
+ // TODO: allow recursive macro calls
// get 9 comma separated values.
// $1-$9 will reference the respective arg
// loop until 9 args are found or the line ends
int paramc = 0;
while (paramc < ULAS_MACROPARAMMAX &&
+ // TODO: allow escaping , with \,
ulas_tokuntil(&pp->macroparam[paramc], ',', &praw_line, *n) >
0) {
// trim new lines from the end of macro params
ulas_strensr(&pp->line, strlen(def->value) + 2);
const char *macro_argname[ULAS_MACROPARAMMAX] = {
- "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9"};
+ "$1", "$2", "$3", "$4", "$5", "$6", "$7", "$8", "$9", "$10", "$11", "$12", "$13", "$14", "$15"};
const char *val = def->value;
unsigned long vallen = strlen(def->value);
.rep repc, 6, 2, ld a, repc
.rep repc, 6, 1, ld a, repc
+
+#macro testmacro
+.db $10
+.db $11
+.db $12
+#endmacro
+
+testmacro 1, 2, 3, 4, 5, 6, 7, 8, 9, 61, 62, 63