summaryrefslogtreecommitdiff
path: root/src/hir/hir.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-02 21:44:14 +0800
committerJohn Hodge <tpg@mutabah.net>2016-07-02 21:44:14 +0800
commita7233bc617922aefee408fa282ade1bffdde59fe (patch)
tree3575a4923945a15e0d42edeba385429f68f671b9 /src/hir/hir.hpp
parentfa7d318700dc91c35bcbab09e24164a7f41ed5ad (diff)
downloadmrust-a7233bc617922aefee408fa282ade1bffdde59fe.tar.gz
HIR Typecheck - Unified Struct/Enum data structures, CS coming along
Diffstat (limited to 'src/hir/hir.hpp')
-rw-r--r--src/hir/hir.hpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp
index e1163b49..22e32a11 100644
--- a/src/hir/hir.hpp
+++ b/src/hir/hir.hpp
@@ -95,14 +95,18 @@ struct TypeAlias
GenericParams m_params;
::HIR::TypeRef m_type;
};
+
+typedef ::std::vector< VisEnt<::HIR::TypeRef> > t_tuple_fields;
+typedef ::std::vector< ::std::pair< ::std::string, VisEnt<::HIR::TypeRef> > > t_struct_fields;
+
class Enum
{
public:
TAGGED_UNION(Variant, Unit,
(Unit, struct{}),
(Value, ::HIR::ExprPtr),
- (Tuple, ::std::vector<::HIR::TypeRef>),
- (Struct, ::std::vector< ::std::pair< ::std::string, ::HIR::TypeRef> >)
+ (Tuple, t_tuple_fields),
+ (Struct, t_struct_fields)
);
enum class Repr
{
@@ -127,8 +131,8 @@ public:
};
TAGGED_UNION(Data, Unit,
(Unit, struct {}),
- (Tuple, ::std::vector< VisEnt<::HIR::TypeRef> >),
- (Named, ::std::vector< ::std::pair< ::std::string, VisEnt<::HIR::TypeRef> > >)
+ (Tuple, t_tuple_fields),
+ (Named, t_struct_fields)
);
GenericParams m_params;