| 875 | } |
| 876 | |
| 877 | static bool Expect(PreprocessorDirectiveContext* context, CoreLib::Text::TokenType tokenType, DiagnosticInfo const& diagnostic, Token* outToken = NULL) |
| 878 | { |
| 879 | if (PeekTokenType(context) != tokenType) |
| 880 | { |
| 881 | // Only report the first parse error within a directive |
| 882 | if (!context->parseError) |
| 883 | { |
| 884 | GetSink(context)->diagnose(PeekLoc(context), diagnostic, tokenType, GetDirectiveName(context)); |
| 885 | context->parseError = true; |
| 886 | } |
| 887 | return false; |
| 888 | } |
| 889 | Token const& token = AdvanceToken(context); |
| 890 | if (outToken) |
| 891 | *outToken = token; |
| 892 | return true; |
| 893 | } |
| 894 | |
| 895 | |
| 896 |
no test coverage detected