Skip to content

Commit

Permalink
Consistency Check
Browse files Browse the repository at this point in the history
* fixed logger integration in the consistency check pass, due to an API change
  in the libstdhl::Logger implementation
  - see: sealangdotorg/libuse@84fe1df
  • Loading branch information
ppaulweber committed May 7, 2017
1 parent b6eda43 commit c4a115a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/analyze/ConsistencyCheckPass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,19 +63,15 @@ class ConsistencyCheckVisitor final : public RecursiveVisitor

void visit( ReferenceAtom& node ) override;

u64 errors( void ) const;

private:
Logger& m_log;
u64 m_err;
const Namespace& m_symboltable;
u1 m_functionInitially;
};

ConsistencyCheckVisitor::ConsistencyCheckVisitor(
Logger& log, const Namespace& symboltable )
: m_log( log )
, m_err( 0 )
, m_symboltable( symboltable )
, m_functionInitially( false )
{
Expand All @@ -89,7 +85,6 @@ void ConsistencyCheckVisitor::visit( Specification& node )
}
catch( const std::domain_error& e )
{
m_err++;
m_log.error( { node.sourceLocation() },
"no init definition found in the specification",
Code::AgentInitRuleNotDefined );
Expand All @@ -110,8 +105,6 @@ void ConsistencyCheckVisitor::visit( FunctionDefinition& node )
{
const auto name = node.identifier()->name();

m_err++;

if( name.compare( PROGRAM ) == 0 )
{
m_log.error( { node.sourceLocation(), *e.locations().begin() },
Expand Down Expand Up @@ -148,11 +141,6 @@ void ConsistencyCheckVisitor::visit( ReferenceAtom& node )
}
}

u64 ConsistencyCheckVisitor::errors( void ) const
{
return m_err;
}

//
// ConsistencyCheckPass
//
Expand All @@ -173,7 +161,7 @@ u1 ConsistencyCheckPass::run( libpass::PassResult& pr )
ConsistencyCheckVisitor visitor( log, symboltable );
specification->accept( visitor );

const auto errors = visitor.errors();
const auto errors = log.errors();
if( errors )
{
log.debug( "found %lu error(s) during consistency checking", errors );
Expand Down

0 comments on commit c4a115a

Please sign in to comment.