summaryrefslogtreecommitdiff
path: root/src/hir/expr.hpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-06-08 14:31:34 +0800
committerJohn Hodge <tpg@mutabah.net>2016-06-08 14:31:34 +0800
commit9db1983ed557ccc99d33b07cc1be75ee3f5b303d (patch)
tree632d3436bad2299227cedac755208565a08b4367 /src/hir/expr.hpp
parent5961266133f5e0cbcd57403021086c788d732ec1 (diff)
downloadmrust-9db1983ed557ccc99d33b07cc1be75ee3f5b303d.tar.gz
HIR - Move tuple struct/enum construtors to their on HIR node
- This makes typeck of those invocations easier
Diffstat (limited to 'src/hir/expr.hpp')
-rw-r--r--src/hir/expr.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/hir/expr.hpp b/src/hir/expr.hpp
index bd952348..88e34671 100644
--- a/src/hir/expr.hpp
+++ b/src/hir/expr.hpp
@@ -293,6 +293,25 @@ struct ExprNode_Deref:
NODE_METHODS();
};
+struct ExprNode_TupleVariant:
+ public ExprNode
+{
+ // Path to variant/struct
+ ::HIR::GenericPath m_path;
+ bool m_is_struct;
+ ::std::vector<ExprNodeP> m_args;
+
+ // - Cache for typeck
+ ::std::vector< ::HIR::TypeRef> m_arg_types;
+
+ ExprNode_TupleVariant(Span sp, ::HIR::GenericPath path, bool is_struct, ::std::vector< ::HIR::ExprNodeP> args):
+ ExprNode(mv$(sp)),
+ m_path( mv$(path) ),
+ m_args( mv$(args) )
+ {}
+
+ NODE_METHODS();
+};
struct ExprNode_CallPath:
public ExprNode
{
@@ -564,6 +583,7 @@ public:
NV(ExprNode_Index)
NV(ExprNode_Deref)
+ NV(ExprNode_TupleVariant);
NV(ExprNode_CallPath);
NV(ExprNode_CallValue);
NV(ExprNode_CallMethod);
@@ -604,6 +624,7 @@ public:
NV(ExprNode_Index)
NV(ExprNode_Deref)
+ NV(ExprNode_TupleVariant);
NV(ExprNode_CallPath);
NV(ExprNode_CallValue);
NV(ExprNode_CallMethod);