// define
assert_preproc("123", 0, " #define test 123\ntest");
+ assert_preproc("this is a", 0, " #define test\nthis is a test");
assert_preproc("", -1, " #define 1test 123\n");
assert_preproc("", -1, " #define\n");
assert_preproc("this is a 123 for defs", 0,
// macro
assert_preproc(
- " line p1 1 label01,2\n line p2 2\n line p3 3 p1, p2, p3\n", 0,
- "#macro test\n line $1 1 label$$$$,$$\n line $2 2\n line $3 3 "
+ " line p1 1 label01,2 3\n line p2 2\n line p3 3 p1, p2, p3\n", 0,
+ "#macro test\n line $1 1 label$$$$,$$ $$\n line $2 2\n line $3 3 "
"$0\n#endmacro\ntest p1, p2, p3");
assert_preproc("test macro with no args\n", 0,
"#macro test\ntest macro with no args\n#endmacro\ntest");
*n -= strlen(pp->tok.buf);
*n += val_len;
ulas_strensr(&pp->line, (*n) + 1 + wsi);
+
+ // only remove the first white space char if the lenght of value
+ // is greater than 1, otherwise just leave it be...
if (val_len > 1) {
strncat(pp->line.buf, def->value + 1, val_len - 1);
} else {