-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi @jedrzejboczar! I'm using easy-repl as a front end to a REPL for a language, but I'm having difficulties passing the full string to my parser/interpreter.
I tried the following:
fn main() {
let mut repl = Repl::builder().add(":e", command! {
"Evaluate an expression using the interpreter.",
(raw: Vec<String>) => |raw: Vec<String>| {
let expr = raw.join(" ");
match libstachio::run_program(expr.as_str()) {
Ok(v) => println!("{}", libstachio::unspan(v)),
Err(reports) => libstachio::print_reports(expr.as_str(), reports),
};
Ok(CommandStatus::Done)
}
}).build().expect("Failed to create REPL.");
repl.run().expect("Critical REPL error.");
}But this doesn't work -- is there an idiom that will allow me to get the entire input after the command :e as a String or a Vec<String> all together?
Metadata
Metadata
Assignees
Labels
No labels