mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49: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
|
@ -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<'_> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue