Call when there should be no more tokens left on a line.
| 363 | |
| 364 | // Call when there should be no more tokens left on a line. |
| 365 | int TPpContext::extraTokenCheck(int contextAtom, TPpToken* ppToken, int token) |
| 366 | { |
| 367 | if (token != '\n' && token != EndOfInput) { |
| 368 | static const char* message = "unexpected tokens following directive"; |
| 369 | |
| 370 | const char* label; |
| 371 | if (contextAtom == PpAtomElse) |
| 372 | label = "#else"; |
| 373 | else if (contextAtom == PpAtomElif) |
| 374 | label = "#elif"; |
| 375 | else if (contextAtom == PpAtomEndif) |
| 376 | label = "#endif"; |
| 377 | else if (contextAtom == PpAtomIf) |
| 378 | label = "#if"; |
| 379 | else if (contextAtom == PpAtomLine) |
| 380 | label = "#line"; |
| 381 | else |
| 382 | label = ""; |
| 383 | |
| 384 | if (parseContext.relaxedErrors()) |
| 385 | parseContext.ppWarn(ppToken->loc, message, label, ""); |
| 386 | else |
| 387 | parseContext.ppError(ppToken->loc, message, label, ""); |
| 388 | |
| 389 | while (token != '\n' && token != EndOfInput) |
| 390 | token = scanToken(ppToken); |
| 391 | } |
| 392 | |
| 393 | return token; |
| 394 | } |
| 395 | |
| 396 | enum eval_prec { |
| 397 | MIN_PRECEDENCE, |
nothing calls this directly
no test coverage detected