From 1cd222f5381cf180634ee1846c6741472fce7644 Mon Sep 17 00:00:00 2001 From: John Hodge Date: Thu, 13 Oct 2016 10:16:34 +0800 Subject: AST Dump - Support associated statics+consts --- src/dump_as_rust.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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"; ), -- cgit v1.2.3