diff options
author | Ben Smith <binjimin@gmail.com> | 2018-05-21 16:28:27 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-21 16:28:27 -0700 |
commit | b7a237ade0842ea0064e5d184acf1345958198d6 (patch) | |
tree | 30db4c8fcf5c1a851a2e75817439ce59539a9c88 /src/token.cc | |
parent | 02a70956b27b030b933effdcd2829d7e2aad528e (diff) | |
download | wabt-b7a237ade0842ea0064e5d184acf1345958198d6.tar.gz wabt-b7a237ade0842ea0064e5d184acf1345958198d6.tar.bz2 wabt-b7a237ade0842ea0064e5d184acf1345958198d6.zip |
Fix token enum/string mismatch; move to token.def (#845)
This fixes issue #844.
Diffstat (limited to 'src/token.cc')
-rw-r--r-- | src/token.cc | 105 |
1 files changed, 7 insertions, 98 deletions
diff --git a/src/token.cc b/src/token.cc index 54ad7c65..72a81f62 100644 --- a/src/token.cc +++ b/src/token.cc @@ -20,104 +20,13 @@ namespace wabt { const char* GetTokenTypeName(TokenType token_type) { static const char* s_names[] = { - // Bare. - "Invalid", - "anyfunc", - "assert_exhaustion", - "assert_invalid", - "assert_malformed", - "assert_return", - "assert_return_arithmetic_nan", - "assert_return_canonical_nan", - "assert_trap", - "assert_unlinkable", - "bin", - "data", - "elem", - "EOF", - "except", - "export", - "func", - "get", - "global", - "import", - "invoke", - "local", - "(", - "memory", - "module", - "mut", - "offset", - "param", - "quote", - "register", - "result", - ")", - "shared", - "start", - "table", - "then", - "type", - - // Literal. - "FLOAT", - "NAT", - "INT", - - // Opcode. - "ATOMIC_LOAD", - "ATOMIC_RMW", - "ATOMIC_RMW_CMPXCHG", - "ATOMIC_STORE", - "ATOMIC_WAIT", - "ATOMIC_WAKE", - "BINARY", - "block", - "br", - "br_if", - "br_table", - "call", - "call_indirect", - "catch", - "COMPARE", - "CONST", - "CONVERT", - "current_memory", - "drop", - "else", - "end", - "get_global", - "get_local", - "grow_memory", - "if", - "if_except", - "LOAD", - "loop", - "nop", - "rethrow", - "return", - "select", - "set_global", - "set_local", - "STORE", - "tee_local", - "TERNARY", - "throw", - "try", - "UNARY", - "SIMDLANEOP", - "SIMDSHUFFLEOP", - "unreachable", - - // String. - "align=", - "offset=", - "Reserved", - "TEXT", - "VAR", - - // Type. - "VALUETYPE", +#define WABT_TOKEN(name, string) string, +#define WABT_TOKEN_FIRST(name, string) +#define WABT_TOKEN_LAST(name, string) +#include "token.def" +#undef WABT_TOKEN +#undef WABT_TOKEN_FIRST +#undef WABT_TOKEN_LAST }; static_assert( |