diff options
author | John Hodge <tpg@mutabah.net> | 2016-10-13 10:16:34 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-10-13 10:16:34 +0800 |
commit | 1cd222f5381cf180634ee1846c6741472fce7644 (patch) | |
tree | 1a23c7d257774b382f765aeacaa685a28f60ae5a /src/dump_as_rust.cpp | |
parent | fd34d6446ef8706a7d9011d650fbdce45b95d7c5 (diff) | |
download | mrust-1cd222f5381cf180634ee1846c6741472fce7644.tar.gz |
AST Dump - Support associated statics+consts
Diffstat (limited to 'src/dump_as_rust.cpp')
-rw-r--r-- | src/dump_as_rust.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dump_as_rust.cpp b/src/dump_as_rust.cpp index c26698f5..d93a3ff1 100644 --- a/src/dump_as_rust.cpp +++ b/src/dump_as_rust.cpp @@ -715,6 +715,18 @@ void RustPrinter::handle_module(const AST::Module& mod) (MacroInv, // TODO: Dump macro invocations ), + (Static, + m_os << indent(); + switch(e.s_class()) + { + case ::AST::Static::CONST: m_os << "const "; break; + case ::AST::Static::STATIC: m_os << "static "; break; + case ::AST::Static::MUT: m_os << "static mut "; break; + } + m_os << it.name << ": " << e.type() << " = "; + e.value().visit_nodes(*this); + m_os << ";\n"; + ), (Type, m_os << indent() << "type " << it.name << " = " << e.type() << ";\n"; ), |