mirror of
https://github.com/roc-lang/roc.git
synced 2024-09-19 06:40:20 +03:00
Clean up file and repl support for Num.maxI128
This commit is contained in:
parent
66f07d984e
commit
3e4eb8d839
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -2927,6 +2927,7 @@ dependencies = [
|
||||
"pretty_assertions 0.5.1",
|
||||
"quickcheck 0.8.5",
|
||||
"quickcheck_macros 0.8.0",
|
||||
"roc_builtins",
|
||||
"roc_collections",
|
||||
"roc_module",
|
||||
"roc_parse",
|
||||
|
@ -82,6 +82,14 @@ fn jit_to_ast_help<'a>(
|
||||
content
|
||||
)))
|
||||
}
|
||||
Layout::Builtin(Builtin::Int128) => {
|
||||
Ok(run_jit_function!(
|
||||
lib,
|
||||
main_fn_name,
|
||||
i128,
|
||||
|num| num_to_ast(env, i128_to_ast(env.arena, num), content)
|
||||
))
|
||||
}
|
||||
Layout::Builtin(Builtin::Float64) => {
|
||||
Ok(run_jit_function!(lib, main_fn_name, f64, |num| num_to_ast(
|
||||
env,
|
||||
@ -852,6 +860,12 @@ fn i64_to_ast(arena: &Bump, num: i64) -> Expr<'_> {
|
||||
Expr::Num(arena.alloc(format!("{}", num)))
|
||||
}
|
||||
|
||||
/// This is centralized in case we want to format it differently later,
|
||||
/// e.g. adding underscores for large numbers
|
||||
fn i128_to_ast(arena: &Bump, num: i128) -> Expr<'_> {
|
||||
Expr::Num(arena.alloc(format!("{}", num)))
|
||||
}
|
||||
|
||||
/// This is centralized in case we want to format it differently later,
|
||||
/// e.g. adding underscores for large numbers
|
||||
fn f64_to_ast(arena: &Bump, num: f64) -> Expr<'_> {
|
||||
|
@ -386,7 +386,6 @@ pub fn types() -> MutMap<Symbol, (SolvedType, Region)> {
|
||||
|
||||
// maxI128 : I128
|
||||
add_type(Symbol::NUM_MAX_I128, i128_type());
|
||||
//add_type(Symbol::NUM_MAX_I128, int_type(flex(TVAR1)));
|
||||
|
||||
// Float module
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user