mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-17 17:25:01 +00:00
Add tips to REPL
Signed-off-by: João Mota <jackthemotorcycle@gmail.com>
This commit is contained in:
parent
b10c7722c9
commit
692d7651ab
1 changed files with 2 additions and 1 deletions
|
@ -45,6 +45,7 @@ pub const WELCOME_MESSAGE: &str = concatcp!(
|
||||||
"\n\n"
|
"\n\n"
|
||||||
);
|
);
|
||||||
pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :q to quit.\n";
|
pub const INSTRUCTIONS: &str = "Enter an expression, or :help, or :q to quit.\n";
|
||||||
|
pub const TIPS: &str = "Everything in the repl needs to be an expression, it needs to return something. See example below: \n\n\n foo = 1 \n\n foo";
|
||||||
pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " ");
|
pub const PROMPT: &str = concatcp!("\n", BLUE, "»", END_COL, " ");
|
||||||
pub const CONT_PROMPT: &str = concatcp!(BLUE, "…", END_COL, " ");
|
pub const CONT_PROMPT: &str = concatcp!(BLUE, "…", END_COL, " ");
|
||||||
|
|
||||||
|
@ -392,7 +393,7 @@ pub fn main() -> io::Result<()> {
|
||||||
// To debug rustyline:
|
// To debug rustyline:
|
||||||
// <UNCOMMENT> env_logger::init();
|
// <UNCOMMENT> env_logger::init();
|
||||||
// <RUN WITH:> RUST_LOG=rustyline=debug cargo run repl 2> debug.log
|
// <RUN WITH:> RUST_LOG=rustyline=debug cargo run repl 2> debug.log
|
||||||
print!("{}{}", WELCOME_MESSAGE, INSTRUCTIONS);
|
print!("{}{}", WELCOME_MESSAGE, INSTRUCTIONS, TIPS);
|
||||||
|
|
||||||
let mut prev_line_blank = false;
|
let mut prev_line_blank = false;
|
||||||
let mut editor = Editor::<ReplHelper>::new();
|
let mut editor = Editor::<ReplHelper>::new();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue