mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +00:00
Reorganize some REPL modules
This commit is contained in:
parent
2e873d6a9a
commit
9f498add60
6 changed files with 401 additions and 288 deletions
|
@ -15,13 +15,18 @@ use crate::eval::ToAstProblem;
|
|||
|
||||
pub enum ReplOutput {
|
||||
Problems(Vec<String>),
|
||||
NoProblems { expr: String, expr_type: String },
|
||||
NoProblems {
|
||||
expr: String,
|
||||
expr_type: String,
|
||||
val_name: String,
|
||||
},
|
||||
}
|
||||
|
||||
pub fn format_answer(
|
||||
arena: &Bump,
|
||||
res_answer: Result<Expr, ToAstProblem>,
|
||||
expr_type_str: String,
|
||||
val_name: String,
|
||||
) -> ReplOutput {
|
||||
let mut expr = roc_fmt::Buf::new_in(arena);
|
||||
|
||||
|
@ -39,6 +44,7 @@ pub fn format_answer(
|
|||
ReplOutput::NoProblems {
|
||||
expr: expr.into_bump_str().to_string(),
|
||||
expr_type: expr_type_str,
|
||||
val_name,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue