projects
/
m6w6
/
ext-psi
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
| inline |
side by side
(parent:
5ec2f9a
)
cpp: fix dumping strings and chars
author
Michael Wallner
<mike@php.net>
Fri, 7 Jul 2017 07:23:17 +0000
(09:23 +0200)
committer
Michael Wallner
<mike@php.net>
Fri, 7 Jul 2017 07:23:17 +0000
(09:23 +0200)
src/types/cpp_macro_decl.c
patch
|
blob
|
history
diff --git
a/src/types/cpp_macro_decl.c
b/src/types/cpp_macro_decl.c
index 42ed0f4208bbad931b8879dc6b575e370cc048e4..e540131243761d44281744acddfbb7190ca249a9 100644
(file)
--- a/
src/types/cpp_macro_decl.c
+++ b/
src/types/cpp_macro_decl.c
@@
-83,7
+83,16
@@
void psi_cpp_macro_decl_dump(int fd, struct psi_cpp_macro_decl *macro)
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);
+ }
}
}
}