Move WELCOME_MESSAGE to be cli-specific

This commit is contained in:
Richard Feldman 2023-09-18 00:08:05 -04:00
parent 0ab49454b3
commit e6b9446755
No known key found for this signature in database
GPG Key ID: F1F21AA5B1D9E43B
4 changed files with 17 additions and 17 deletions

View File

@ -20,6 +20,18 @@ use target_lexicon::Triple;
use crate::cli_gen::eval_llvm;
pub const WELCOME_MESSAGE: &str = concatcp!(
"\n The rockin ",
BLUE,
"roc repl",
END_COL,
"\n",
PINK,
"────────────────────────",
END_COL,
"\n\n"
);
#[derive(Completer, Helper, Hinter, Default)]
pub struct ReplHelper {
validator: InputValidator,

View File

@ -1,11 +1,11 @@
use roc_repl_cli::WELCOME_MESSAGE;
use roc_repl_ui::SHORT_INSTRUCTIONS;
use roc_test_utils::assert_multiline_str_eq;
use std::env;
use std::io::Write;
use std::path::PathBuf;
use std::process::{Command, ExitStatus, Stdio};
use roc_repl_ui::{SHORT_INSTRUCTIONS, WELCOME_MESSAGE};
use roc_test_utils::assert_multiline_str_eq;
const ERROR_MESSAGE_START: char = '─';
#[derive(Debug)]

View File

@ -1403,7 +1403,7 @@ fn interpolation_with_nested_interpolation() {
<https://www.roc-lang.org/tutorial#string-interpolation>
Enter an expression to evaluate, or a definition (like x = 1) to use in future expressions.
Enter an expression to evaluate, or a definition (like x = 1) to use later.
Tips:

View File

@ -11,25 +11,13 @@ use roc_parse::ast::{Expr, ValueDef};
use roc_repl_eval::gen::{Problems, ReplOutput};
use roc_reporting::report::StyleCodes;
pub const WELCOME_MESSAGE: &str = concatcp!(
"\n The rockin ",
BLUE,
"roc repl",
END_COL,
"\n",
PINK,
"────────────────────────",
END_COL,
"\n\n"
);
// TODO add link to repl tutorial(does not yet exist).
pub const TIPS: &str = concatcp!(
"\nEnter an expression to evaluate, or a definition (like ",
BLUE,
"x = 1",
END_COL,
") to use in future expressions.\n\nTips:\n\n",
") to use later.\n\nTips:\n\n",
if cfg!(target_family = "wasm") {
// In the web REPL, the :quit command doesn't make sense. Just close the browser tab!
// We use Shift-Enter for newlines because it's nicer than our workaround for Unix terminals (see below)