From cf5d3d1349df9c5fe4b526476c4262abed8e5eef Mon Sep 17 00:00:00 2001 From: John Hodge Date: Mon, 12 Sep 2016 11:24:52 +0800 Subject: HIR From AST - Correct paths for range ops --- src/hir/from_ast_expr.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/hir/from_ast_expr.cpp') diff --git a/src/hir/from_ast_expr.cpp b/src/hir/from_ast_expr.cpp index 5e3908aa..35d27b24 100644 --- a/src/hir/from_ast_expr.cpp +++ b/src/hir/from_ast_expr.cpp @@ -1,4 +1,9 @@ /* + * MRustC - Rust Compiler + * - By John Hodge (Mutabah/thePowersGang) + * + * hir/from_ast_expr.cpp + * - Constructs a HIR expression tree from an AST expression tree */ #include #include @@ -104,10 +109,10 @@ struct LowerHIR_ExprNode_Visitor: { case ::AST::ExprNode_BinOp::RANGE: { // NOTE: Not language items - auto path_Range = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "Range"}) ); - auto path_RangeFrom = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "RangeFrom"}) ); - auto path_RangeTo = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "RangeTo"}) ); - auto path_RangeFull = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "RangeFull"}) ); + auto path_Range = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "Range"}) ); + auto path_RangeFrom = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "RangeFrom"}) ); + auto path_RangeTo = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "RangeTo"}) ); + auto path_RangeFull = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "RangeFull"}) ); ::HIR::ExprNode_StructLiteral::t_values values; if( v.m_left ) @@ -134,8 +139,8 @@ struct LowerHIR_ExprNode_Visitor: break; } case ::AST::ExprNode_BinOp::RANGE_INC: { // NOTE: Not language items - auto path_RangeInclusive_NonEmpty = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "RangeInclusive", "NonEmpty"}) ); - auto path_RangeToInclusive = ::HIR::GenericPath( ::HIR::SimplePath("", {"ops", "RangeToInclusive"}) ); + auto path_RangeInclusive_NonEmpty = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "RangeInclusive", "NonEmpty"}) ); + auto path_RangeToInclusive = ::HIR::GenericPath( ::HIR::SimplePath(g_core_crate, {"ops", "RangeToInclusive"}) ); if( v.m_left ) { -- cgit v1.2.3