MCPcopy Create free account
hub / github.com/carbonengine/trinity / DiscoverPermutations

Method DiscoverPermutations

shadercompiler/ParserState.cpp:632–682  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

630}
631
632bool ParserState::DiscoverPermutations( Permutations& permutations )
633{
634 m_inDiscoverMode = true;
635 ScannerToken token;
636
637 bool done = false;
638 while( !done )
639 {
640 PreprocessorToken ppToken;
641 PreprocessorScanResult scanCode = GetPreprocessorToken( ppToken );
642 switch( scanCode )
643 {
644 case PPSR_ERROR:
645 break;
646 case PPSR_EOF: {
647 if( m_fileStack.size() > 1 )
648 {
649 m_fileStack.pop_back();
650 }
651 else
652 {
653 done = true;
654 break;
655 }
656 }
657 break;
658 case PPSR_OK:
659 ConvertToScannerToken( *this, ppToken, token );
660 break;
661 }
662 }
663
664 for( auto it = m_pragmas.begin(); it != m_pragmas.end(); ++it )
665 {
666 auto pragma = ToString( it->pragma );
667 if( !IsPermutationPragma( pragma ) )
668 {
669 break;
670 }
671 Permutation p;
672 if( !GetPermutationInfo( pragma, p ) )
673 {
674 ShowMessage( it->location, EC_SYNTAX_ERROR, "pragma permutation" );
675 return false;
676 }
677 p.location = it->location;
678 permutations.push_back( p );
679 }
680 m_inDiscoverMode = false;
681 return true;
682}
683
684bool ParserState::Parse()
685{

Callers 1

DiscoverPermutationsFunction · 0.80

Calls 6

IsPermutationPragmaFunction · 0.85
GetPermutationInfoFunction · 0.85
sizeMethod · 0.80
ToStringFunction · 0.70
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected