From 9f69517be928bf78b7d63c2937941d6d9c93b48c Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 4 Jun 2015 17:19:28 +0800 Subject: Fix issues with printout, lexing, and pattern resolving --- src/convert/resolve.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/convert/resolve.cpp') diff --git a/src/convert/resolve.cpp b/src/convert/resolve.cpp index 68633dc8..f3ba701f 100644 --- a/src/convert/resolve.cpp +++ b/src/convert/resolve.cpp @@ -276,10 +276,12 @@ CPathResolver::CPathResolver(const AST::Crate& crate): void CPathResolver::start_scope() { DEBUG(""); + m_scope_stack.push_back( {0, nullptr, AST::Path(), {}} ); m_locals.push_back( LocalItem() ); } void CPathResolver::end_scope() { + m_scope_stack.pop_back( ); DEBUG(m_locals.size() << " items"); for( auto it = m_locals.end(); it-- != m_locals.begin(); ) { @@ -437,7 +439,8 @@ void CPathResolver::handle_path_int(AST::Path& path, CASTIterator::PathMode mode // 1. function scopes (variables and local items) // > Return values: name or path { - if( this->find_local_item(path, /*allow_variables=*/path.is_trivial()) ) { + bool allow_variables = (mode == CASTIterator::MODE_EXPR && path.is_trivial()); + if( this->find_local_item(path, allow_variables) ) { break ; } else { -- cgit v1.2.3