summaryrefslogtreecommitdiffstats
path: root/source/compiler-core/slang-token.cpp
blob: 8b9ec35821dabe38688b6cdbdd25550c00ee1f53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// slang-token.cpp
#include "slang-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 "slang-token-defs.h"
    }
}

} // namespace Slang