diff options
author | John Hodge <tpg@mutabah.net> | 2015-06-04 17:19:28 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2015-06-04 17:19:28 +0800 |
commit | 9f69517be928bf78b7d63c2937941d6d9c93b48c (patch) | |
tree | 91df9882aeb77a5c1e67f1f157ff81dbfd9180dd /src/convert/resolve.cpp | |
parent | f2c96d7c448934baec49c91b5cb2ac7c05562437 (diff) | |
download | mrust-9f69517be928bf78b7d63c2937941d6d9c93b48c.tar.gz |
Fix issues with printout, lexing, and pattern resolving
Diffstat (limited to 'src/convert/resolve.cpp')
-rw-r--r-- | src/convert/resolve.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 {
|