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
|
@ -5,6 +5,7 @@ pub use roc_gen_llvm::llvm::build::FunctionIterator;
|
|||
use roc_load::file::{LoadedModule, MonomorphizedModule};
|
||||
use roc_module::symbol::{Interns, ModuleId};
|
||||
use roc_mono::ir::OptLevel;
|
||||
use roc_region::all::LineInfo;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::time::Duration;
|
||||
|
||||
|
@ -81,13 +82,15 @@ fn report_problems_help(
|
|||
src_lines.extend(src.split('\n'));
|
||||
}
|
||||
|
||||
let lines = LineInfo::new(src);
|
||||
|
||||
// Report parsing and canonicalization problems
|
||||
let alloc = RocDocAllocator::new(&src_lines, *home, interns);
|
||||
|
||||
let problems = can_problems.remove(home).unwrap_or_default();
|
||||
|
||||
for problem in problems.into_iter() {
|
||||
let report = can_problem(&alloc, module_path.clone(), problem);
|
||||
let report = can_problem(&alloc, &lines, module_path.clone(), problem);
|
||||
let severity = report.severity;
|
||||
let mut buf = String::new();
|
||||
|
||||
|
@ -106,7 +109,7 @@ fn report_problems_help(
|
|||
let problems = type_problems.remove(home).unwrap_or_default();
|
||||
|
||||
for problem in problems {
|
||||
if let Some(report) = type_problem(&alloc, module_path.clone(), problem) {
|
||||
if let Some(report) = type_problem(&alloc, &lines, module_path.clone(), problem) {
|
||||
let severity = report.severity;
|
||||
let mut buf = String::new();
|
||||
|
||||
|
@ -126,7 +129,7 @@ fn report_problems_help(
|
|||
let problems = mono_problems.remove(home).unwrap_or_default();
|
||||
|
||||
for problem in problems {
|
||||
let report = mono_problem(&alloc, module_path.clone(), problem);
|
||||
let report = mono_problem(&alloc, &lines, module_path.clone(), problem);
|
||||
let severity = report.severity;
|
||||
let mut buf = String::new();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue