summaryrefslogtreecommitdiffstats
path: root/src/declarative/qml/script/tokens.cpp
blob: 51b46f0fa1e78901ba5c3e608f1fc30e9ecf4ab3 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/****************************************************************************
**
** This file is part of the $PACKAGE_NAME$.
**
** Copyright (C) $THISYEAR$ $COMPANY_NAME$.
**
** $QT_EXTENDED_DUAL_LICENSE$
**
****************************************************************************/

#include "tokens.h"


/*!
  \relates <tokens.h>
  Returns a string representation of token \a tok.
*/
const char *tokenToString(Token tok)
{
    switch(tok) {
#define CASE(X) case X: return #X;
        CASE(NOTOKEN)
        CASE(INCOMPLETE)
        CASE(WHITESPACE)
        CASE(LANGLE)
        CASE(RANGLE)
        CASE(PLUS)
        CASE(MINUS)
        CASE(STAR)
        CASE(EQUALS)
        CASE(DOT)
        CASE(CHARACTER)
        CASE(DIGIT)
        CASE(OTHER)
        CASE(AND)
    case TOKEN_TRUE:
        return "TRUE";
    case TOKEN_FALSE:
        return "FALSE";
#undef CASE
    }
    return 0;
}