Skip to content

Commit

Permalink
AST Dump Source
Browse files Browse the repository at this point in the history
* fixed incorrect indention implementation for structure, feature and
  implementation definitions
* related to sealangdotorg/sea#35
  • Loading branch information
ppaulweber committed Jul 31, 2017
1 parent 73a3732 commit b5feb16
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/transform/AstDumpSourcePass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,10 @@ void AstDumpSourceVisitor::visit( StructureDefinition& node )
m_stream << "structure ";
node.identifier()->accept( *this );
m_stream << " =\n{";
const auto levelGuard = Indentation::NextLevel( m_indentation );
for( auto& e : *node.functions() )
{
m_stream << "\n ";
m_stream << "\n" << m_indentation;
e->accept( *this );
}
m_stream << "}";
Expand All @@ -345,9 +346,10 @@ void AstDumpSourceVisitor::visit( FeatureDefinition& node )
m_stream << "feature ";
node.identifier()->accept( *this );
m_stream << " =\n{";
const auto levelGuard = Indentation::NextLevel( m_indentation );
for( auto& e : *node.definitions() )
{
m_stream << "\n ";
m_stream << "\n" << m_indentation;
e->accept( *this );
}
m_stream << "}";
Expand All @@ -363,9 +365,10 @@ void AstDumpSourceVisitor::visit( ImplementationDefinition& node )
}
node.type()->accept( *this );
m_stream << " =\n{";
const auto levelGuard = Indentation::NextLevel( m_indentation );
for( auto& e : *node.definitions() )
{
m_stream << "\n ";
m_stream << "\n" << m_indentation;
e->accept( *this );
}
m_stream << "}";
Expand Down

0 comments on commit b5feb16

Please sign in to comment.