fix: print for string literal

This commit is contained in:
Leonardo de Moura 2019-12-16 07:34:40 -08:00
parent a172998954
commit 7d736e63b1

View file

@ -280,8 +280,11 @@ struct print_expr_fn {
case expr_kind::Lit:
switch (lit_value(a).kind()) {
case literal_kind::Nat: out() << lit_value(a).get_nat().to_mpz(); break;
case literal_kind::String: out() << escaped(lit_value(a).get_string().data()); break; // HACK Lean string as C string
}
case literal_kind::String: {
std::string val(lit_value(a).get_string().data() + 1);
val.pop_back();
out() << "\"" << escaped(val.c_str()) << "\""; break; // HACK Lean string as C string
}}
break;
}
}