Skip to content

Commit 94ff4bd

Browse files
committed
Pretty printing
1 parent c38d8e0 commit 94ff4bd

File tree

9 files changed

+390
-302
lines changed

9 files changed

+390
-302
lines changed

crates/sml-core/src/elaborate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ impl<'ar> Context<'ar> {
233233
.get(&sym)
234234
.expect("error: redefine_value");
235235
let s = Scheme::Mono(self.fresh_tyvar());
236-
std::mem::replace(&mut self.values[id.0 as usize].0, s);
236+
let _ = std::mem::replace(&mut self.values[id.0 as usize].0, s);
237237
}
238238

239239
/// Starting from the current [`Namespace`], search for a bound name.

crates/sml-core/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,5 +317,3 @@ impl<'ar> fmt::Debug for Decl<'ar> {
317317
}
318318
}
319319
}
320-
321-
use pretty_print::{PrettyPrinter, Print};

crates/sml-core/src/match_compile.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ pub fn fun<'a>(
6868
let rec = SortedRecord::new_unchecked(
6969
vars.iter()
7070
.enumerate()
71-
.map(|(idx, (s, t))| Row {
71+
.map(|(idx, (s, _))| Row {
7272
label: Symbol::tuple_field(idx as u32 + 1),
7373
data: *s,
7474
span: Span::dummy(),
@@ -344,7 +344,7 @@ impl<'a, 'ctx> Matrix<'a, 'ctx> {
344344
}
345345

346346
match arity {
347-
Some((name, ty)) => {
347+
Some((name, _)) => {
348348
facts.add(mat.vars[0].0, Fact::Con(*head, Some(name)));
349349
mat.vars[0].0 = name;
350350
}
@@ -378,7 +378,6 @@ impl<'a, 'ctx> Matrix<'a, 'ctx> {
378378
// of data constructors for a datatype, and the arity of each
379379
// data constructor. We just mock it instead
380380
let fresh = self.ctx.fresh_var();
381-
println!("spec {:?} {:?}", fresh, con);
382381
let mut f = facts.clone();
383382
let expr = self.specialize(&mut f, con, arg_ty.map(|ty| (fresh, ty)));
384383

crates/sml-core/src/monomorphize.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![allow(dead_code)]
12
use super::*;
23

34
pub struct Cache<'a> {

crates/sml-core/src/pretty_print.rs

Lines changed: 0 additions & 269 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)