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