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

Function HandleEndIfDirective

Source/SpireCore/Preprocessor.cpp:1343–1358  ·  view source on GitHub ↗

Handle a `#endif` directive

Source from the content-addressed store, hash-verified

1341
1342// Handle a `#endif` directive
1343static void HandleEndIfDirective(PreprocessorDirectiveContext* context)
1344{
1345 PreprocessorInputStream* inputStream = context->preprocessor->inputStream;
1346 assert(inputStream);
1347
1348 // if we aren't inside a conditional, then error
1349 PreprocessorConditional* conditional = inputStream->conditional;
1350 if (!conditional)
1351 {
1352 GetSink(context)->diagnose(GetDirectiveLoc(context), Diagnostics::directiveWithoutIf, GetDirectiveName(context));
1353 return;
1354 }
1355
1356 inputStream->conditional = conditional->parent;
1357 DestroyConditional(conditional);
1358}
1359
1360// Handle a `#include` directive
1361static void HandleIncludeDirective(PreprocessorDirectiveContext* context)

Callers

nothing calls this directly

Calls 3

GetSinkFunction · 0.85
DestroyConditionalFunction · 0.85
diagnoseMethod · 0.80

Tested by

no test coverage detected