mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Reorganize some REPL modules
This commit is contained in:
parent
2e873d6a9a
commit
9f498add60
6 changed files with 401 additions and 288 deletions
|
@ -272,8 +272,12 @@ pub async fn entrypoint_from_js(src: String) -> Result<String, String> {
|
|||
|
||||
// Transform the Expr to a string
|
||||
// `Result::Err` becomes a JS exception that will be caught and displayed
|
||||
match format_answer(arena, res_answer, expr_type_str) {
|
||||
ReplOutput::NoProblems { expr, expr_type } => Ok(format!("{} : {}", expr, expr_type)),
|
||||
match format_answer(arena, res_answer, expr_type_str, val_name) {
|
||||
ReplOutput::NoProblems {
|
||||
expr,
|
||||
expr_type,
|
||||
val_name,
|
||||
} => Ok(format!("{expr} : {expr_type} # {val_name}")),
|
||||
ReplOutput::Problems(lines) => Err(format!("\n{}\n", lines.join("\n\n"))),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue