Handle a `#ifndef` directive
| 1250 | |
| 1251 | // Handle a `#ifndef` directive |
| 1252 | static void HandleIfNDefDirective(PreprocessorDirectiveContext* context) |
| 1253 | { |
| 1254 | // Expect a raw identifier, so we can check if it is defined |
| 1255 | Token nameToken; |
| 1256 | if(!ExpectRaw(context, TokenType::Identifier, Diagnostics::expectedTokenInPreprocessorDirective, &nameToken)) |
| 1257 | return; |
| 1258 | String name = nameToken.Content; |
| 1259 | |
| 1260 | // Check if the name is defined. |
| 1261 | BeginConditional(context, LookupMacro(context, name) == NULL); |
| 1262 | } |
| 1263 | |
| 1264 | // Handle a `#else` directive |
| 1265 | static void HandleElseDirective(PreprocessorDirectiveContext* context) |
nothing calls this directly
no test coverage detected