ulas_strensr(dst, write + 2);
// escape char tokens
dst->buf[write++] = line[i++];
- if (line[i] && !isspace(line[i])) {
+ if (line[i] == '$') {
dst->buf[write++] = line[i++];
+ } else {
+ while (line[i] && isdigit(line[i])) {
+ dst->buf[write++] = line[i++];
+ }
}
goto tokdone;
case '=':
// loop until 9 args are found or the line ends
int paramc = 0;
while (paramc < ULAS_MACROPARAMMAX &&
- // TODO: allow escaping , with \,
+ // 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", "$10", "$11", "$12", "$13", "$14", "$15"};
+ "$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, 1, ld a, repc
#macro testmacro
+.db $9
.db $10
.db $11
.db $12
.str $13
#endmacro
-testmacro 1, 2, 3, 4, 5, 6, 7, 8, 9, 61, 62, 63, "test"
+testmacro 1, 2, 3, 4, 5, 6, 7, 8, 60, 61, 62, 63, "test"