cpp: token stringification and pasting
[m6w6/ext-psi] / src / types / cpp_macro_decl.c
index bfa230c3cf5963bb6a4edb0c7672cd41325a7543..d5e195c353fa0f35c442c064ceb79584ad4ef20c 100644 (file)
@@ -74,4 +74,16 @@ void psi_cpp_macro_decl_dump(int fd, struct psi_cpp_macro_decl *macro)
                }
                dprintf(fd, ")");
        }
+
+       if (macro->exp) {
+               dprintf(fd, " ");
+               psi_num_exp_dump(fd, macro->exp);
+       } 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);
+               }
+       }
 }