3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/preprocessor/PpTokens.cpp
// Add a complete token (including backing string) to the end of a list
// for later playback.
Add a complete token (including backing string) to the end of a list
for later playback.
Add a complete token ( including backing string ) to the end of a list for later playback .
void TPpContext::TokenStream::putToken(int token, TPpToken* ppToken)
{
    const char* s;
    char* str = NULL;
    assert((token & ~0xff) == 0);
    putSubtoken(static_cast<char>(token));
    switch (token) {
    case PpAtomIdentifier:
    case PpAtomConstString:
        s = ppToken->name;
        while (*s)
            putSubtoken(*s++);
        putSubtoken(0);
        break;
    case PpAtomConstInt:
    case PpAtomConstUint:
    case PpAtomConstInt64:
    case PpAtomConstUint64:
#ifdef AMD_EXTENSIONS
    case PpAtomConstInt16:
    case PpAtomConstUint16:
#endif
    case PpAtomConstFloat:
    case PpAtomConstDouble:
#ifdef AMD_EXTENSIONS
    case PpAtomConstFloat16:
#endif
        str = ppToken->name;
        while (*str) {
            putSubtoken(*str);
            str++;
        }
        putSubtoken(0);
        break;
    default:
        break;
    }
}
void TPpContext :: TokenStream :: putToken ( int token , TPpToken * ppToken ) { const char * s ; char * str = NULL ; assert ( ( token & ~ 0xff ) == 0 ) ; putSubtoken ( static_cast < char > ( token ) ) ; switch ( token ) { case PpAtomIdentifier : case PpAtomConstString : s = ppToken -> name ; while ( * s ) putSubtoken ( * s ++ ) ; putSubtoken ( 0 ) ; break ; case PpAtomConstInt : case PpAtomConstUint : case PpAtomConstInt64 : case PpAtomConstUint64 : #ifdef AMD_EXTENSIONS case PpAtomConstInt16 : case PpAtomConstUint16 : #endif case PpAtomConstFloat : case PpAtomConstDouble : #ifdef AMD_EXTENSIONS case PpAtomConstFloat16 : #endif str = ppToken -> name ; while ( * str ) { putSubtoken ( * str ) ; str ++ ; } putSubtoken ( 0 ) ; break ; default : break ; } }
Add a complete token (including backing string) to the end of a list
for later playback.
Add a complete token ( including backing string ) to the end of a list for later playback .