mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-03 00:24:34 +00:00
Import Decode by default in all modules
This commit is contained in:
parent
f10c47ec20
commit
06bef34829
4 changed files with 81 additions and 57 deletions
|
@ -124,6 +124,14 @@ const MODULE_ENCODE_TYPES: &[(&str, Symbol)] = &[
|
|||
("EncoderFormatting", Symbol::ENCODE_ENCODERFORMATTING),
|
||||
];
|
||||
|
||||
const MODULE_DECODE_TYPES: &[(&str, Symbol)] = &[
|
||||
("DecodeError", Symbol::DECODE_DECODE_ERROR),
|
||||
("DecodeResult", Symbol::DECODE_DECODE_RESULT),
|
||||
("Decoder", Symbol::DECODE_DECODER_OPAQUE),
|
||||
("Decoding", Symbol::DECODE_DECODING),
|
||||
("DecoderFormatting", Symbol::DECODE_DECODERFORMATTING),
|
||||
];
|
||||
|
||||
macro_rules! log {
|
||||
($($arg:tt)*) => (dbg_do!(ROC_PRINT_LOAD_LOG, println!($($arg)*)))
|
||||
}
|
||||
|
@ -2249,6 +2257,7 @@ fn update<'a>(
|
|||
.imported_modules
|
||||
.insert(ModuleId::LIST, Region::zero());
|
||||
|
||||
// ENCODE
|
||||
header
|
||||
.package_qualified_imported_modules
|
||||
.insert(PackageQualified::Unqualified(ModuleId::ENCODE));
|
||||
|
@ -2262,6 +2271,21 @@ fn update<'a>(
|
|||
.exposed_imports
|
||||
.insert(Ident::from(*type_name), (*symbol, Region::zero()));
|
||||
}
|
||||
|
||||
// DECODE
|
||||
header
|
||||
.package_qualified_imported_modules
|
||||
.insert(PackageQualified::Unqualified(ModuleId::DECODE));
|
||||
|
||||
header
|
||||
.imported_modules
|
||||
.insert(ModuleId::DECODE, Region::zero());
|
||||
|
||||
for (type_name, symbol) in MODULE_DECODE_TYPES {
|
||||
header
|
||||
.exposed_imports
|
||||
.insert(Ident::from(*type_name), (*symbol, Region::zero()));
|
||||
}
|
||||
}
|
||||
|
||||
state
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue