mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-02 00:01:16 +00:00
Introduce LineColumnRegion and force conversion
This commit is contained in:
parent
721233f9c8
commit
82d2be0635
11 changed files with 507 additions and 287 deletions
|
@ -9,6 +9,7 @@ use roc_collections::all::{MutMap, MutSet};
|
|||
use roc_gen_llvm::llvm::externs::add_default_roc_externs;
|
||||
use roc_module::symbol::Symbol;
|
||||
use roc_mono::ir::OptLevel;
|
||||
use roc_region::all::LineInfo;
|
||||
use roc_types::subs::VarStore;
|
||||
use target_lexicon::Triple;
|
||||
|
||||
|
@ -105,6 +106,7 @@ fn create_llvm_module<'a>(
|
|||
continue;
|
||||
}
|
||||
|
||||
let line_info = LineInfo::new(&src);
|
||||
let src_lines: Vec<&str> = src.split('\n').collect();
|
||||
let palette = DEFAULT_PALETTE;
|
||||
|
||||
|
@ -121,7 +123,7 @@ fn create_llvm_module<'a>(
|
|||
| RuntimeError(_)
|
||||
| UnsupportedPattern(_, _)
|
||||
| ExposedButNotDefined(_) => {
|
||||
let report = can_problem(&alloc, module_path.clone(), problem);
|
||||
let report = can_problem(&alloc, &line_info, module_path.clone(), problem);
|
||||
let mut buf = String::new();
|
||||
|
||||
report.render_color_terminal(&mut buf, &alloc, &palette);
|
||||
|
@ -130,7 +132,7 @@ fn create_llvm_module<'a>(
|
|||
lines.push(buf);
|
||||
}
|
||||
_ => {
|
||||
let report = can_problem(&alloc, module_path.clone(), problem);
|
||||
let report = can_problem(&alloc, &line_info, module_path.clone(), problem);
|
||||
let mut buf = String::new();
|
||||
|
||||
report.render_color_terminal(&mut buf, &alloc, &palette);
|
||||
|
@ -141,7 +143,7 @@ fn create_llvm_module<'a>(
|
|||
}
|
||||
|
||||
for problem in type_problems {
|
||||
if let Some(report) = type_problem(&alloc, module_path.clone(), problem) {
|
||||
if let Some(report) = type_problem(&alloc, &line_info, module_path.clone(), problem) {
|
||||
let mut buf = String::new();
|
||||
|
||||
report.render_color_terminal(&mut buf, &alloc, &palette);
|
||||
|
@ -151,7 +153,7 @@ fn create_llvm_module<'a>(
|
|||
}
|
||||
|
||||
for problem in mono_problems {
|
||||
let report = mono_problem(&alloc, module_path.clone(), problem);
|
||||
let report = mono_problem(&alloc, &line_info, module_path.clone(), problem);
|
||||
let mut buf = String::new();
|
||||
|
||||
report.render_color_terminal(&mut buf, &alloc, &palette);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue