List dependencies in the stdlib explicitly rather than hard-coding

This commit is contained in:
Ayaz Hafiz 2022-10-05 18:49:48 -05:00
parent 0b57b00235
commit 5416eb7cbf
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
10 changed files with 69 additions and 17 deletions

View file

@ -2232,24 +2232,15 @@ fn update<'a>(
// add the prelude
let mut header = header;
if ![ModuleId::RESULT, ModuleId::BOOL].contains(&header.module_id) {
extend_header_with_builtin(&mut header, ModuleId::RESULT);
}
if ![ModuleId::NUM, ModuleId::BOOL, ModuleId::RESULT].contains(&header.module_id) {
extend_header_with_builtin(&mut header, ModuleId::NUM);
}
if ![ModuleId::BOOL].contains(&header.module_id) {
extend_header_with_builtin(&mut header, ModuleId::BOOL);
}
if !header.module_id.is_builtin() {
extend_header_with_builtin(&mut header, ModuleId::BOX);
extend_header_with_builtin(&mut header, ModuleId::NUM);
extend_header_with_builtin(&mut header, ModuleId::BOOL);
extend_header_with_builtin(&mut header, ModuleId::STR);
extend_header_with_builtin(&mut header, ModuleId::LIST);
extend_header_with_builtin(&mut header, ModuleId::RESULT);
extend_header_with_builtin(&mut header, ModuleId::DICT);
extend_header_with_builtin(&mut header, ModuleId::SET);
extend_header_with_builtin(&mut header, ModuleId::LIST);
extend_header_with_builtin(&mut header, ModuleId::BOX);
extend_header_with_builtin(&mut header, ModuleId::ENCODE);
extend_header_with_builtin(&mut header, ModuleId::DECODE);
extend_header_with_builtin(&mut header, ModuleId::HASH);