mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 22:34:45 +00:00
Merge remote-tracking branch 'origin/trunk' into str-fromUtf8
This commit is contained in:
commit
57b78dde06
156 changed files with 19265 additions and 10809 deletions
|
@ -2,15 +2,20 @@ use std::fs::File;
|
|||
use std::io::prelude::Read;
|
||||
use std::vec::Vec;
|
||||
|
||||
const PATH: &str = env!(
|
||||
const BC_PATH: &str = env!(
|
||||
"BUILTINS_BC",
|
||||
"Env var BUILTINS_BC not found. Is there a problem with the build script?"
|
||||
);
|
||||
|
||||
pub const OBJ_PATH: &str = env!(
|
||||
"BUILTINS_O",
|
||||
"Env var BUILTINS_O not found. Is there a problem with the build script?"
|
||||
);
|
||||
|
||||
pub fn get_bytes() -> Vec<u8> {
|
||||
// In the build script for the builtins module, we compile the builtins bitcode and set
|
||||
// BUILTINS_BC to the path to the compiled output.
|
||||
let mut builtins_bitcode = File::open(PATH).expect("Unable to find builtins bitcode source");
|
||||
let mut builtins_bitcode = File::open(BC_PATH).expect("Unable to find builtins bitcode source");
|
||||
let mut buffer = Vec::new();
|
||||
builtins_bitcode
|
||||
.read_to_end(&mut buffer)
|
||||
|
@ -34,5 +39,34 @@ pub const STR_STARTS_WITH: &str = "roc_builtins.str.starts_with";
|
|||
pub const STR_ENDS_WITH: &str = "roc_builtins.str.ends_with";
|
||||
pub const STR_NUMBER_OF_BYTES: &str = "roc_builtins.str.number_of_bytes";
|
||||
pub const STR_FROM_INT: &str = "roc_builtins.str.from_int";
|
||||
pub const STR_FROM_FLOAT: &str = "roc_builtins.str.from_float";
|
||||
pub const STR_EQUAL: &str = "roc_builtins.str.equal";
|
||||
pub const STR_VALIDATE_UTF_BYTES: &str = "roc_builtins.str.validate_utf8_bytes";
|
||||
|
||||
pub const DICT_HASH: &str = "roc_builtins.dict.hash";
|
||||
pub const DICT_HASH_STR: &str = "roc_builtins.dict.hash_str";
|
||||
pub const DICT_LEN: &str = "roc_builtins.dict.len";
|
||||
pub const DICT_EMPTY: &str = "roc_builtins.dict.empty";
|
||||
pub const DICT_INSERT: &str = "roc_builtins.dict.insert";
|
||||
pub const DICT_REMOVE: &str = "roc_builtins.dict.remove";
|
||||
pub const DICT_CONTAINS: &str = "roc_builtins.dict.contains";
|
||||
pub const DICT_GET: &str = "roc_builtins.dict.get";
|
||||
pub const DICT_ELEMENTS_RC: &str = "roc_builtins.dict.elementsRc";
|
||||
pub const DICT_KEYS: &str = "roc_builtins.dict.keys";
|
||||
pub const DICT_VALUES: &str = "roc_builtins.dict.values";
|
||||
pub const DICT_UNION: &str = "roc_builtins.dict.union";
|
||||
pub const DICT_DIFFERENCE: &str = "roc_builtins.dict.difference";
|
||||
pub const DICT_INTERSECTION: &str = "roc_builtins.dict.intersection";
|
||||
pub const DICT_WALK: &str = "roc_builtins.dict.walk";
|
||||
|
||||
pub const SET_FROM_LIST: &str = "roc_builtins.dict.set_from_list";
|
||||
|
||||
pub const LIST_MAP: &str = "roc_builtins.list.map";
|
||||
pub const LIST_MAP_WITH_INDEX: &str = "roc_builtins.list.map_with_index";
|
||||
pub const LIST_KEEP_IF: &str = "roc_builtins.list.keep_if";
|
||||
pub const LIST_KEEP_OKS: &str = "roc_builtins.list.keep_oks";
|
||||
pub const LIST_KEEP_ERRS: &str = "roc_builtins.list.keep_errs";
|
||||
pub const LIST_WALK: &str = "roc_builtins.list.walk";
|
||||
pub const LIST_WALK_BACKWARDS: &str = "roc_builtins.list.walk_backwards";
|
||||
pub const LIST_CONTAINS: &str = "roc_builtins.list.contains";
|
||||
pub const LIST_REPEAT: &str = "roc_builtins.list.repeat";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue