if (macro->exp) {
dprintf(fd, " ");
psi_num_exp_dump(fd, macro->exp);
- } else if (macro->tokens) {
+ if (!macro->tokens) abort();
+ } else
+ if (macro->tokens) {
size_t i = 0;
struct psi_token *tok;
while (psi_plist_get(macro->tokens, i++, &tok)) {
- dprintf(fd, " %s", tok->text);
+ switch (tok->type) {
+ case PSI_T_QUOTED_STRING:
+ dprintf(fd, " \"%s\"", tok->text);
+ break;
+ case PSI_T_QUOTED_CHAR:
+ dprintf(fd, " '%s'", tok->text);
+ break;
+ default:
+ dprintf(fd, " %s", tok->text);
+ }
}
}
}
if (!cmp_token_list(d1->sig, d2->sig)) {
return false;
}
+ } else if (d2->sig) {
+ return false;
}
if (d1->tokens) {
if (!cmp_token_list(d1->tokens, d2->tokens)) {
return false;
}
+ } else if (d2->tokens) {
+ return false;
}
/* FIXME compare num_exps */