Compositing NODE_DSTR and NODE_STR

This commit is contained in:
dearblue
2019-02-27 20:22:24 +09:00
parent 8ead6da913
commit 4d2bb3cb47
+15
View File
@@ -893,6 +893,21 @@ concat_string(parser_state *p, node *a, node *b)
}
}
}
else if (string_node_p(b)) {
/* a == NODE_DSTR && b == NODE_STR */
node *c;
for (c = a; c->cdr != NULL; c = c->cdr) ;
if (string_node_p(c->car)) {
/* a->[..., NODE_STR] && b == NODE_STR */
composite_string_node(p, c->car->cdr, b->cdr);
cons_free(b);
return a;
}
push(a, b);
return a;
}
return new_dstr(p, list2(a, b));
}