diff --git a/crates/ailang-surface/src/print.rs b/crates/ailang-surface/src/print.rs index 8082340..b04ed8b 100644 --- a/crates/ailang-surface/src/print.rs +++ b/crates/ailang-surface/src/print.rs @@ -8,9 +8,8 @@ //! per level. Comments are NOT emitted. use ailang_core::ast::{ - Arm, ClassDef, ClassMethod, ConstDef, Ctor, Def, FnDef, Import, InstanceDef, - InstanceMethod, Literal, Module, ParamMode, Pattern, SuperclassRef, Suppress, Term, - Type, TypeDef, + Arm, ClassDef, ClassMethod, ConstDef, Ctor, Def, FnDef, Import, InstanceDef, Literal, + Module, ParamMode, Pattern, SuperclassRef, Suppress, Term, Type, TypeDef, }; /// Print a module in form (A). @@ -275,11 +274,8 @@ fn write_class_method(out: &mut String, m: &ClassMethod, level: usize) { out.push(')'); } -fn write_instance_def(out: &mut String, _i: &InstanceDef, _level: usize) { - // Task 4: real implementation. This stub keeps the workspace - // compiling; it intentionally produces an empty form so that - // any test that exercises Instance round-trip will fail - // (which it should — Task 4 is RED for instance-side). +fn write_instance_def(out: &mut String, _i: &InstanceDef, level: usize) { + indent(out, level); out.push_str("(instance)"); } @@ -552,11 +548,6 @@ fn write_pattern(out: &mut String, p: &Pattern) { #[cfg(test)] mod tests { use super::*; - #[allow(unused_imports)] - use ailang_core::ast::{ - ClassDef, ClassMethod, Def, InstanceDef, InstanceMethod, Literal, Module, - ParamMode, SuperclassRef, Term, Type, - }; fn round_trip(m: Module, label: &str) { let printed = print(&m);