Early work on scripting features
This commit is contained in:
@@ -28,7 +28,10 @@ pub fn read_line<'s>() -> ShResult<String> {
|
||||
}
|
||||
Ok(line)
|
||||
}
|
||||
Err(ReadlineError::Eof) => std::process::exit(0),
|
||||
Err(ReadlineError::Eof) => {
|
||||
kill(Pid::this(), Signal::SIGQUIT)?;
|
||||
Ok(String::new())
|
||||
}
|
||||
Err(ReadlineError::Interrupted) => Ok(String::new()),
|
||||
Err(e) => {
|
||||
return Err(e.into())
|
||||
|
||||
@@ -65,6 +65,7 @@ impl Highlighter for FernReadline {
|
||||
|
||||
impl Validator for FernReadline {
|
||||
fn validate(&self, ctx: &mut rustyline::validate::ValidationContext) -> rustyline::Result<rustyline::validate::ValidationResult> {
|
||||
return Ok(ValidationResult::Valid(None));
|
||||
let mut tokens = vec![];
|
||||
let tk_stream = LexStream::new(ctx.input(), LexFlags::empty());
|
||||
for tk in tk_stream {
|
||||
|
||||
Reference in New Issue
Block a user