summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-02-27 18:01:14 +0800
committerJohn Hodge <tpg@mutabah.net>2016-02-27 18:01:14 +0800
commit2fa788e26a8d2447be9b575111a9f7be26eaff93 (patch)
treefadde986d721b178917ab1bd9a5219075670668e /src/parse
parentdf62d33afdb267465caabf91abf340ce4884c443 (diff)
downloadmrust-2fa788e26a8d2447be9b575111a9f7be26eaff93.tar.gz
Parse - Macros in type position
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/lex.cpp1
-rw-r--r--src/parse/lex.hpp4
-rw-r--r--src/parse/parseerror.hpp1
-rw-r--r--src/parse/tokentree.hpp2
-rw-r--r--src/parse/types.cpp2
5 files changed, 8 insertions, 2 deletions
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp
index 32ed8829..829a62de 100644
--- a/src/parse/lex.cpp
+++ b/src/parse/lex.cpp
@@ -13,6 +13,7 @@
#include "lex.hpp"
#include "tokentree.hpp"
#include "parseerror.hpp"
+#include "../common.hpp"
#include <cassert>
#include <iostream>
#include <cstdlib> // strtol
diff --git a/src/parse/lex.hpp b/src/parse/lex.hpp
index 937be516..0dc94d12 100644
--- a/src/parse/lex.hpp
+++ b/src/parse/lex.hpp
@@ -8,7 +8,9 @@
#ifndef LEX_HPP_INCLUDED
#define LEX_HPP_INCLUDED
-#include "../types.hpp"
+#include <debug.hpp>
+#include <serialise.hpp>
+#include "../coretypes.hpp"
#include <string>
#include <fstream>
diff --git a/src/parse/parseerror.hpp b/src/parse/parseerror.hpp
index 751af585..1074bf46 100644
--- a/src/parse/parseerror.hpp
+++ b/src/parse/parseerror.hpp
@@ -3,6 +3,7 @@
#include <stdexcept>
#include "lex.hpp"
+#include <compile_error.hpp>
namespace ParseError {
diff --git a/src/parse/tokentree.hpp b/src/parse/tokentree.hpp
index aa72a522..6b54e66e 100644
--- a/src/parse/tokentree.hpp
+++ b/src/parse/tokentree.hpp
@@ -2,7 +2,7 @@
#define TOKENTREE_HPP_INCLUDED
#include "lex.hpp"
-
+#include "../include/serialise.hpp"
class TokenTree:
public Serialisable
diff --git a/src/parse/types.cpp b/src/parse/types.cpp
index 33307dea..7b69dbd6 100644
--- a/src/parse/types.cpp
+++ b/src/parse/types.cpp
@@ -33,6 +33,8 @@ TypeRef Parse_Type_Int(TokenStream& lex)
switch( GET_TOK(tok, lex) )
{
+ case TOK_MACRO:
+ return TypeRef(TypeRef::TagMacro(), Parse_MacroInvocation(AST::MetaItems(), mv$(tok.str()), lex));
// '!' - Only ever used as part of function prototypes, but is kinda a type... not allowed here though
case TOK_EXCLAM:
throw ParseError::Generic(lex, "! is not a real type");