summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hir/expr.hpp2
-rw-r--r--src/hir/from_ast.cpp2
-rw-r--r--src/hir/hir.hpp4
-rw-r--r--src/main.cpp2
-rw-r--r--src/parse/lex.cpp9
5 files changed, 14 insertions, 5 deletions
diff --git a/src/hir/expr.hpp b/src/hir/expr.hpp
index 8dbd6cf9..c47131b4 100644
--- a/src/hir/expr.hpp
+++ b/src/hir/expr.hpp
@@ -73,7 +73,7 @@ struct ExprNode_Let:
ExprNode_Let(::HIR::Pattern pat, ::HIR::TypeRef ty, ::HIR::ExprNodeP val):
m_pattern( mv$(pat) ),
m_type( mv$(ty) ),
- m_value( mv$(m_value) )
+ m_value( mv$(val) )
{}
NODE_METHODS();
diff --git a/src/hir/from_ast.cpp b/src/hir/from_ast.cpp
index b857ad67..2c97b550 100644
--- a/src/hir/from_ast.cpp
+++ b/src/hir/from_ast.cpp
@@ -597,7 +597,7 @@ void _add_mod_val_item(::HIR::Module& mod, ::std::string name, bool is_pub, ::H
auto& submod = *module.anon_mods()[i];
::std::string name = FMT("#" << i);
auto item_path = path + name;
- _add_mod_ns_item( mod, name, false, LowerHIR_Module(submod, mv$(item_path)) );
+ _add_mod_ns_item( mod, mv$(name), false, ::HIR::TypeItem::make_Module( LowerHIR_Module(submod, mv$(item_path)) ) );
}
return mod;
diff --git a/src/hir/hir.hpp b/src/hir/hir.hpp
index 0756b8b0..34a86dbc 100644
--- a/src/hir/hir.hpp
+++ b/src/hir/hir.hpp
@@ -135,6 +135,10 @@ public:
::std::unordered_map< ::std::string, ::std::unique_ptr<VisEnt<ValueItem>> > m_value_items;
// Contains types, traits, and modules
::std::unordered_map< ::std::string, ::std::unique_ptr<VisEnt<TypeItem>> > m_mod_items;
+
+ Module() {}
+ Module(const Module&) = delete;
+ Module(Module&& x) = default;
};
// --------------------------------------------------------------------
diff --git a/src/main.cpp b/src/main.cpp
index 369b1185..df8ca562 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -22,7 +22,7 @@ int g_debug_indent_level = 0;
bool debug_enabled()
{
- return g_cur_phase != "Parse";
+ return g_cur_phase != "Parse" && g_cur_phase != "Expand";
}
::std::ostream& debug_output(int indent, const char* function)
{
diff --git a/src/parse/lex.cpp b/src/parse/lex.cpp
index 0ed05123..7cf5ad76 100644
--- a/src/parse/lex.cpp
+++ b/src/parse/lex.cpp
@@ -1304,6 +1304,7 @@ Token TokenStream::innerGetToken()
}
Token TokenStream::getToken()
{
+ const bool DEBUG_PRINT_TOKENS = false;
if( m_cache_valid )
{
m_cache_valid = false;
@@ -1313,13 +1314,17 @@ Token TokenStream::getToken()
{
Token ret = m_lookahead.front();
m_lookahead.erase(m_lookahead.begin());
- ::std::cout << "getToken[" << typeid(*this).name() << "] - " << ret << ::std::endl;
+ if( DEBUG_PRINT_TOKENS ) {
+ ::std::cout << "getToken[" << typeid(*this).name() << "] - " << ret << ::std::endl;
+ }
return ret;
}
else
{
Token ret = this->innerGetToken();
- ::std::cout << "getToken[" << typeid(*this).name() << "] - " << ret << ::std::endl;
+ if( DEBUG_PRINT_TOKENS ) {
+ ::std::cout << "getToken[" << typeid(*this).name() << "] - " << ret << ::std::endl;
+ }
return ret;
}
}