projects
/
cparser
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
361cba9
)
Reduce code duplication.
author
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 4 Jun 2011 12:43:29 +0000
(14:43 +0200)
committer
Christoph Mallon
<christoph.mallon@gmx.de>
Sat, 4 Jun 2011 12:43:29 +0000
(14:43 +0200)
parser.c
patch
|
blob
|
history
diff --git
a/parser.c
b/parser.c
index
65bf933
..
c4883b5
100644
(file)
--- a/
parser.c
+++ b/
parser.c
@@
-2446,13
+2446,10
@@
static compound_t *parse_compound_type_specifier(bool is_struct)
}
}
} else if (token.type != '{') {
- if (is_struct) {
- parse_error_expected("while parsing struct type specifier",
- T_IDENTIFIER, '{', NULL);
- } else {
- parse_error_expected("while parsing union type specifier",
- T_IDENTIFIER, '{', NULL);
- }
+ char const *const msg =
+ is_struct ? "while parsing struct type specifier" :
+ "while parsing union type specifier";
+ parse_error_expected(msg, T_IDENTIFIER, '{', NULL);
return NULL;
}