MCPcopy Create free account
hub / github.com/dfranx/ShaderDebugger / ParseDirective

Method ParseDirective

libs/wgtcc/cpp.cc:375–427  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

373
374
375 void Preprocessor::ParseDirective(TokenSequence& os,
376 TokenSequence& is,
377 int directive) {
378 if (directive == Token::PP_EMPTY)
379 return;
380 auto ls = is.GetLine();
381 switch (directive) {
382 case Token::PP_IF:
383 ParseIf(ls); break;
384 case Token::PP_IFDEF:
385 ParseIfdef(ls); break;
386 case Token::PP_IFNDEF:
387 ParseIfndef(ls); break;
388 case Token::PP_ELIF:
389 ParseElif(ls); break;
390 case Token::PP_ELSE:
391 ParseElse(ls); break;
392 case Token::PP_ENDIF:
393 ParseEndif(ls); break;
394 case Token::PP_INCLUDE:
395 if (NeedExpand())
396 ParseInclude(is, ls);
397 break;
398 case Token::PP_DEFINE:
399 if (NeedExpand())
400 ParseDef(ls);
401 break;
402 case Token::PP_UNDEF:
403 if (NeedExpand())
404 ParseUndef(ls);
405 break;
406 case Token::PP_VERSION:
407 if (NeedExpand())
408 ParseVersion(ls);
409 break;
410 case Token::PP_LINE:
411 if (NeedExpand())
412 ParseLine(ls);
413 break;
414 case Token::PP_ERROR:
415 if (NeedExpand())
416 ParseError(ls);
417 break;
418 case Token::PP_PRAGMA:
419 if (NeedExpand())
420 ParsePragma(ls);
421 break;
422 case Token::PP_NONE:
423 break;
424 default:
425 assert(false);
426 }
427 }
428
429
430 void Preprocessor::ParsePragma(TokenSequence ls) {

Callers

nothing calls this directly

Calls 1

GetLineMethod · 0.80

Tested by

no test coverage detected