summaryrefslogtreecommitdiffstats
path: root/source/slang/token.cpp
blob: 69baf5e70242347a9fb2bb8a4c537c2210a05220 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// token.cpp
#include "token.h"

#include <assert.h>

namespace Slang {

char const* TokenTypeToString(TokenType type)
{
    switch( type )
    {
    default:
        SLANG_ASSERT(!"unexpected");
        return "<uknown>";

#define TOKEN(NAME, DESC) case TokenType::NAME: return DESC;
#include "token-defs.h"
    }
}

} // namespace Slang