Upgrade hosted header in the style module header

This commit is contained in:
Sam Mohr 2025-01-26 15:07:57 -08:00
parent 3f09235d6a
commit 631e59ce06
No known key found for this signature in database
GPG key ID: EA41D161A3C1BC99
22 changed files with 256 additions and 185 deletions

View file

@ -3952,17 +3952,25 @@ fn parse_header<'a>(
},
parse_state,
)) => {
let module_name = match opt_expected_module_name {
Some(pq_name) => arena.alloc_str(pq_name.as_inner().as_str()),
None => {
// [modules-revamp] [privacy-changes] TODO: Support test/check on nested modules
arena.alloc_str(filename.file_stem().unwrap().to_str().unwrap())
}
};
let info = HeaderInfo {
filename,
is_root_module,
opt_shorthand,
packages: &[],
header_type: HeaderType::Hosted {
name: header.name.value,
exposes: unspace(arena, header.exposes.item.items),
name: roc_parse::header::ModuleName::new(module_name),
exposes: unspace(arena, header.exposes.items),
},
module_comments: comments,
header_imports: Some(header.imports),
header_imports: header.old_imports,
};
let (module_id, _, header) =