mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
report errors in the header with correct source
This commit is contained in:
parent
b4dd5687e3
commit
27130c3172
2 changed files with 98 additions and 25 deletions
|
@ -36,7 +36,14 @@ pub fn gen_from_mono_module(
|
|||
let code_gen_start = SystemTime::now();
|
||||
|
||||
for (home, (module_path, src)) in loaded.sources {
|
||||
let src_lines: Vec<&str> = src.split('\n').collect();
|
||||
let mut src_lines: Vec<&str> = Vec::new();
|
||||
|
||||
if let Some((_, header_src)) = loaded.header_sources.get(&home) {
|
||||
src_lines.extend(header_src.split('\n'));
|
||||
src_lines.extend(src.split('\n').skip(1));
|
||||
} else {
|
||||
src_lines.extend(src.split('\n'));
|
||||
}
|
||||
let palette = DEFAULT_PALETTE;
|
||||
|
||||
// Report parsing and canonicalization problems
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue