update cli

This commit is contained in:
Folkert 2020-04-10 23:34:03 +02:00
parent 06cd298126
commit a67fe6540c

View file

@ -102,7 +102,7 @@ fn main() -> io::Result<()> {
}
fn gen(filename: PathBuf, src: &str, target: Triple, dest_filename: &Path) {
use roc_reporting::report::{can_problem, DEFAULT_PALETTE};
use roc_reporting::report::{can_problem, RocDocAllocator, DEFAULT_PALETTE};
use roc_reporting::type_error::type_problem;
// Build the expr
@ -118,20 +118,22 @@ fn gen(filename: PathBuf, src: &str, target: Triple, dest_filename: &Path) {
let palette = DEFAULT_PALETTE;
// Report parsing and canonicalization problems
let alloc = RocDocAllocator::new(&src_lines, home, &interns);
for problem in can_problems.into_iter() {
let report = can_problem(filename.clone(), problem);
let report = can_problem(&alloc, filename.clone(), problem);
let mut buf = String::new();
report.render_color_terminal(&mut buf, &mut subs, home, &src_lines, &interns, &palette);
report.render_color_terminal(&mut buf, &alloc, &palette);
println!("\n{}\n", buf);
}
for problem in type_problems.into_iter() {
let report = type_problem(filename.clone(), problem);
let report = type_problem(&alloc, filename.clone(), problem);
let mut buf = String::new();
report.render_color_terminal(&mut buf, &mut subs, home, &src_lines, &interns, &palette);
report.render_color_terminal(&mut buf, &alloc, &palette);
println!("\n{}\n", buf);
}