diff options
author | John Hodge <tpg@mutabah.net> | 2016-07-14 08:50:10 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-07-14 08:50:10 +0800 |
commit | e74ceca550c06f8a0c267459fbb2e365b3ddd708 (patch) | |
tree | a575c3a486860b8a657926e072bda72ee67015bc /src/parse | |
parent | 87f293aeef783ecafef49ed280709d125f9c1f4f (diff) | |
download | mrust-e74ceca550c06f8a0c267459fbb2e365b3ddd708.tar.gz |
Macro Rules - Running fully once more, may still be incorrect
Diffstat (limited to 'src/parse')
-rw-r--r-- | src/parse/lex.cpp | 4 | ||||
-rw-r--r-- | src/parse/token.cpp | 21 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp index 2b84d0e4..6097839d 100644 --- a/src/parse/lex.cpp +++ b/src/parse/lex.cpp @@ -20,8 +20,8 @@ #include <typeinfo> #include <algorithm> // std::count -const bool DEBUG_PRINT_TOKENS = false; -//const bool DEBUG_PRINT_TOKENS = true; +//const bool DEBUG_PRINT_TOKENS = false; +const bool DEBUG_PRINT_TOKENS = true; Lexer::Lexer(const ::std::string& filename): m_path(filename.c_str()), diff --git a/src/parse/token.cpp b/src/parse/token.cpp index 5b580fe3..6380992e 100644 --- a/src/parse/token.cpp +++ b/src/parse/token.cpp @@ -445,6 +445,27 @@ SERIALISE_TYPE(Token::, "Token", { if( tok.m_data.is_Integer() ) os << ":" << tok.intval(); break; + case TOK_INTERPOLATED_TYPE: + os << ":" << *reinterpret_cast<TypeRef*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_PATTERN: + os << ":" << *reinterpret_cast<AST::Pattern*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_PATH: + os << ":" << *reinterpret_cast<AST::Path*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_EXPR: + os << ":" << *reinterpret_cast<AST::ExprNode*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_STMT: + os << ":" << *reinterpret_cast<AST::ExprNode*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_BLOCK: + os << ":" << *reinterpret_cast<AST::ExprNode*>(tok.m_data.as_Fragment()); + break; + case TOK_INTERPOLATED_META: + os << ":" << *reinterpret_cast<AST::MetaItem*>(tok.m_data.as_Fragment()); + break; default: break; } |