--input.position.colno;
}
-#define MATCH_NEWLINE(code) \
- case '\r': \
- next_char(); \
- if (input.c == '\n') { \
- case '\n': \
- next_char(); \
- } \
- info.whitespace = 0; \
- ++input.position.lineno; \
- input.position.colno = 1; \
- code
+#define NEWLINE \
+ '\r': \
+ next_char(); \
+ if (input.c == '\n') { \
+ case '\n': \
+ next_char(); \
+ } \
+ info.whitespace = 0; \
+ ++input.position.lineno; \
+ input.position.colno = 1; \
+ goto newline; \
+ newline // Let it look like an ordinary case label.
#define eat(c_type) (assert(input.c == c_type), next_char())
eat('\\');
switch (input.c) {
- MATCH_NEWLINE(
+ case NEWLINE:
return;
- )
default:
break;
break;
}
- MATCH_NEWLINE(
+ case NEWLINE:
errorf(&pp_token.base.source_position, "newline while parsing %s", context);
break;
- )
case EOF: {
source_position_t source_position;
}
break;
- MATCH_NEWLINE(
+ case NEWLINE:
break;
- )
case EOF: {
source_position_t source_position;
next_char();
continue;
- MATCH_NEWLINE(
+ case NEWLINE:
info.at_line_begin = true;
return;
- )
case '/':
next_char();
next_char();
goto restart;
- MATCH_NEWLINE(
+ case NEWLINE:
info.at_line_begin = true;
info.had_whitespace = true;
goto restart;
- )
SYMBOL_CHARS
parse_symbol();
next_char();
while (true) {
switch (input.c) {
+ case NEWLINE:
case EOF:
- /* fallthrough */
- MATCH_NEWLINE(
errorf(&pp_token.base.source_position, "header name without closing '%c'", (char)delimiter);
goto finish_error;
- )
default:
if (input.c == delimiter) {
/* skip till newline */
while (true) {
switch (input.c) {
- MATCH_NEWLINE(
- return;
- )
+ case NEWLINE:
case EOF:
return;
}