diff --git a/src/protocol/ast_writer.rs b/src/protocol/ast_writer.rs index 6411ae43cdff50018a3480bfe57184099ff812aa..1b376a16f7f674291c2b55efa010ea1b25ff23d9 100644 --- a/src/protocol/ast_writer.rs +++ b/src/protocol/ast_writer.rs @@ -365,8 +365,12 @@ impl ASTWriter { self.write_variable(heap, *variable_id, indent3); } - self.kv(indent2).with_s_key("Body"); - self.write_stmt(heap, def.body.upcast(), indent3); + if def.source.is_builtin() { + self.kv(indent2).with_s_key("Body").with_s_val("Builtin"); + } else { + self.kv(indent2).with_s_key("Body"); + self.write_stmt(heap, def.body.upcast(), indent3); + } }, } } @@ -685,6 +689,11 @@ impl ASTWriter { Literal::True => { val.with_s_val("true"); }, Literal::False => { val.with_s_val("false"); }, Literal::Character(data) => { val.with_disp_val(data); }, + Literal::Bytestring(bytes) => { + // Bytestrings are ASCII, so just convert back + let string = String::from_utf8_lossy(bytes.as_slice()); + val.with_disp_val(&string); + }, Literal::String(data) => { // Stupid hack let string = String::from(data.as_str());