feat(library/export): simplify format

This commit is contained in:
Leonardo de Moura 2015-05-04 18:22:12 -07:00
parent 701b0ae66f
commit c0c0490db3

View file

@ -33,8 +33,7 @@ class exporter {
return it->second; return it->second;
unsigned i; unsigned i;
if (n.is_anonymous()) { if (n.is_anonymous()) {
i = m_name2idx.size(); lean_unreachable();
m_out << i << " n\n";
} else if (n.is_string()) { } else if (n.is_string()) {
unsigned p = export_name(n.get_prefix()); unsigned p = export_name(n.get_prefix());
i = m_name2idx.size(); i = m_name2idx.size();
@ -56,8 +55,7 @@ class exporter {
unsigned l1, l2, n; unsigned l1, l2, n;
switch (l.kind()) { switch (l.kind()) {
case level_kind::Zero: case level_kind::Zero:
i = m_level2idx.size(); lean_unreachable();
m_out << i << " UZ\n";
break; break;
case level_kind::Succ: case level_kind::Succ:
l1 = export_level(succ_of(l)); l1 = export_level(succ_of(l));
@ -275,6 +273,8 @@ public:
exporter(std::ostream & out, environment const & env):m_out(out), m_env(env) {} exporter(std::ostream & out, environment const & env):m_out(out), m_env(env) {}
void operator()() { void operator()() {
m_name2idx.insert(mk_pair(name(), 0));
m_level2idx.insert(mk_pair(level(), 0));
export_direct_imports(); export_direct_imports();
export_global_universes(); export_global_universes();
export_declarations(); export_declarations();