Handle a `#endif` directive
| 1341 | |
| 1342 | // Handle a `#endif` directive |
| 1343 | static 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 |
| 1361 | static void HandleIncludeDirective(PreprocessorDirectiveContext* context) |
nothing calls this directly
no test coverage detected