summaryrefslogtreecommitdiff
path: root/src/dump_as_rust.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-02-18 18:41:39 +1100
committerJohn Hodge <tpg@mutabah.net>2016-02-18 18:41:39 +1100
commit651ab293f3bfa117dae618edb9a4a9f328e07a91 (patch)
treed8a7ce58aa58a018a1f86aa5fa3f73e57e6c238a /src/dump_as_rust.cpp
parent13075f30738556212ca0ff02d28dab75c268c1fd (diff)
downloadmrust-651ab293f3bfa117dae618edb9a4a9f328e07a91.tar.gz
Random commit
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r--src/dump_as_rust.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp
index fee1ac34..11ace14b 100644
--- a/src/dump_as_rust.cpp
+++ b/src/dump_as_rust.cpp
@@ -837,19 +837,21 @@ void RustPrinter::handle_enum(const AST::Enum& s)
m_os << indent() << "{\n";
inc_indent();
+ unsigned int idx = 0;
for( const auto& i : s.variants() )
{
- m_os << indent() << i.m_name;
+ m_os << indent() << "/*"<<idx<<"*/" << i.m_name;
if( i.m_sub_types.size() )
{
for( const auto& t : i.m_sub_types )
m_os << t.print_pretty() << ", ";
}
- else
+ else if(i.m_value > 0)
{
m_os << " = " << i.m_value;
}
m_os << ",\n";
+ idx ++;
}
dec_indent();
m_os << indent() << "}\n";