mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
make the repl app mutable (for expect repl)
This commit is contained in:
parent
dfbad3c322
commit
6c0217c6f6
5 changed files with 58 additions and 49 deletions
|
@ -135,7 +135,7 @@ impl<'a> ReplApp<'a> for CliApp {
|
|||
|
||||
/// Run user code that returns a type with a `Builtin` layout
|
||||
/// Size of the return value is statically determined from its Rust type
|
||||
fn call_function<Return, F>(&self, main_fn_name: &str, transform: F) -> Expr<'a>
|
||||
fn call_function<Return, F>(&mut self, main_fn_name: &str, transform: F) -> Expr<'a>
|
||||
where
|
||||
F: Fn(&'a Self::Memory, Return) -> Expr<'a>,
|
||||
Self::Memory: 'a,
|
||||
|
@ -145,7 +145,7 @@ impl<'a> ReplApp<'a> for CliApp {
|
|||
|
||||
/// Run user code that returns a struct or union, whose size is provided as an argument
|
||||
fn call_function_dynamic_size<T, F>(
|
||||
&self,
|
||||
&mut self,
|
||||
main_fn_name: &str,
|
||||
ret_bytes: usize,
|
||||
transform: F,
|
||||
|
@ -424,11 +424,11 @@ fn gen_and_eval_llvm<'a>(
|
|||
let (lib, main_fn_name, subs) =
|
||||
mono_module_to_dylib(&arena, target, loaded, opt_level).expect("we produce a valid Dylib");
|
||||
|
||||
let app = CliApp { lib };
|
||||
let mut app = CliApp { lib };
|
||||
|
||||
let res_answer = jit_to_ast(
|
||||
&arena,
|
||||
&app,
|
||||
&mut app,
|
||||
main_fn_name,
|
||||
main_fn_layout,
|
||||
&content,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue