summaryrefslogtreecommitdiff
path: root/src/hir/from_ast_expr.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-07-02 14:39:54 +0800
committerJohn Hodge <tpg@mutabah.net>2016-07-02 14:40:18 +0800
commit82806102bd9075e25f326484249f3c63a58160f5 (patch)
treef6fd67d849e24fddfc479230340c8929b0b73f26 /src/hir/from_ast_expr.cpp
parente2b52c8f7c72b1587eca350d6957c3d9fca0900d (diff)
downloadmrust-82806102bd9075e25f326484249f3c63a58160f5.tar.gz
HIR - CS Typecheck work, Store 'is_struct' flag in StructLiteral node
Diffstat (limited to 'src/hir/from_ast_expr.cpp')
-rw-r--r--src/hir/from_ast_expr.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/hir/from_ast_expr.cpp b/src/hir/from_ast_expr.cpp
index 13b0f47c..f0190c1b 100644
--- a/src/hir/from_ast_expr.cpp
+++ b/src/hir/from_ast_expr.cpp
@@ -117,15 +117,15 @@ struct LowerHIR_ExprNode_Visitor:
if( v.m_left ) {
if( v.m_right ) {
- m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_Range), nullptr, mv$(values)) );
+ m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_Range), true, nullptr, mv$(values)) );
}
else {
- m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeFrom), nullptr, mv$(values)) );
+ m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeFrom), true, nullptr, mv$(values)) );
}
}
else {
if( v.m_right ) {
- m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeTo), nullptr, mv$(values)) );
+ m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeTo), true, nullptr, mv$(values)) );
}
else {
m_rv.reset( new ::HIR::ExprNode_UnitVariant(v.span(), mv$(path_RangeFull), true) );
@@ -142,13 +142,13 @@ struct LowerHIR_ExprNode_Visitor:
::HIR::ExprNode_StructLiteral::t_values values;
values.push_back( ::std::make_pair( ::std::string("start"), LowerHIR_ExprNode_Inner( *v.m_left ) ) );
values.push_back( ::std::make_pair( ::std::string("end") , LowerHIR_ExprNode_Inner( *v.m_right ) ) );
- m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeInclusive_NonEmpty), nullptr, mv$(values)) );
+ m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeInclusive_NonEmpty), true, nullptr, mv$(values)) );
}
else
{
::HIR::ExprNode_StructLiteral::t_values values;
values.push_back( ::std::make_pair( ::std::string("end") , LowerHIR_ExprNode_Inner( *v.m_right ) ) );
- m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeToInclusive), nullptr, mv$(values)) );
+ m_rv.reset( new ::HIR::ExprNode_StructLiteral(v.span(), mv$(path_RangeToInclusive), true, nullptr, mv$(values)) );
}
break; }
case ::AST::ExprNode_BinOp::PLACE_IN:
@@ -513,6 +513,7 @@ struct LowerHIR_ExprNode_Visitor:
values.push_back( ::std::make_pair(val.first, LowerHIR_ExprNode_Inner(*val.second)) );
m_rv.reset( new ::HIR::ExprNode_StructLiteral( v.span(),
LowerHIR_GenericPath(v.get_pos(), v.m_path),
+ v.m_path.binding().is_Struct(),
LowerHIR_ExprNode_Inner_Opt(v.m_base_value.get()),
mv$(values)
) );