MCPcopy Create free account
hub / github.com/csyonghe/Spire / ExpectRaw

Function ExpectRaw

Source/SpireCore/Preprocessor.cpp:859–875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859static bool ExpectRaw(PreprocessorDirectiveContext* context, CoreLib::Text::TokenType tokenType, DiagnosticInfo const& diagnostic, Token* outToken = NULL)
860{
861 if (PeekRawTokenType(context) != tokenType)
862 {
863 // Only report the first parse error within a directive
864 if (!context->parseError)
865 {
866 GetSink(context)->diagnose(PeekLoc(context), diagnostic, tokenType, GetDirectiveName(context));
867 }
868 context->parseError = true;
869 return false;
870 }
871 Token const& token = AdvanceRawToken(context);
872 if (outToken)
873 *outToken = token;
874 return true;
875}
876
877static bool Expect(PreprocessorDirectiveContext* context, CoreLib::Text::TokenType tokenType, DiagnosticInfo const& diagnostic, Token* outToken = NULL)
878{

Callers 4

HandleIfDefDirectiveFunction · 0.85
HandleIfNDefDirectiveFunction · 0.85
HandleDefineDirectiveFunction · 0.85

Calls 5

PeekRawTokenTypeFunction · 0.85
GetSinkFunction · 0.85
PeekLocFunction · 0.85
AdvanceRawTokenFunction · 0.85
diagnoseMethod · 0.80

Tested by

no test coverage detected