Add builtin functions to the prelude

Starting with 'not', will add 'always' and 'identity' later.
This commit is contained in:
KtorZ
2022-12-29 12:05:30 +01:00
parent 602a6a03a8
commit 1701cacb52
2 changed files with 81 additions and 2 deletions

View File

@@ -486,8 +486,12 @@ where
let mut imports = HashMap::new();
let mut constants = HashMap::new();
let option_data_type = TypedDataType::option(generic_var(self.id_gen.next()));
let prelude_functions = builtins::prelude_functions();
for (access_key, func) in prelude_functions.iter() {
functions.insert(access_key.clone(), func);
}
let option_data_type = TypedDataType::option(generic_var(self.id_gen.next()));
data_types.insert(
DataTypeKey {
module_name: "".to_string(),
@@ -582,6 +586,11 @@ where
let mut imports = HashMap::new();
let mut constants = HashMap::new();
let prelude_functions = builtins::prelude_functions();
for (access_key, func) in prelude_functions.iter() {
functions.insert(access_key.clone(), func);
}
let option_data_type = TypedDataType::option(generic_var(self.id_gen.next()));
data_types.insert(