fn readline(&mut self, editor: &mut Editor<RadishRustylineHelper>) -> ReplResult<()> {
        let line = editor.readline(self.prompt);

        match line {
            Ok(line) if line == HELP => {
                self.print_help();
                editor.add_history_entry(line.to_string());
                ReplResult::Ok(())
            }
            Ok(line) => {
                self.lines.push(line.clone());
                editor.add_history_entry(line.to_string());

                match self.eval() {
                    Ok(_) => ReplResult::Ok(()),
                    Err(err) => match err {
                        RadishError::CompilerError(err) => {
                            // check if the error was caused by an unexpected end of input.
                            // if it was then we persume that the user meant to keep typing.
                            if err.clone().is_unexpected_eof() {
                                self.prompt = CONTINUE;

                                self.readline(editor)
                            } else {
                                // otherwise turn it back into a RadishError and report it.
                                ReplResult::Error(err.into())
                            }
                        }
                        _ => ReplResult::Error(err),
                    },
                }
            }
            Err(ReadlineError::Interrupted) => ReplResult::Interrupted,
            Err(ReadlineError::Eof) => ReplResult::Eof,
            Err(err) => ReplResult::Error(err.to_string().into()),
        }
    }
/// Read a line, also handling multiline input.
Read a line, also handling multiline input.
Read a line also handling multiline input .
fn readline(&mut self, editor: &mut Editor<RadishRustylineHelper>) -> ReplResult<()> {
        let line = editor.readline(self.prompt);
        match line {
            Ok(line) if line == HELP => {
                self.print_help();
                editor.add_history_entry(line.to_string());
                ReplResult::Ok(())
            }
            Ok(line) => {
                self.lines.push(line.clone());
                editor.add_history_entry(line.to_string());
                match self.eval() {
                    Ok(_) => ReplResult::Ok(()),
                    Err(err) => match err {
                        RadishError::CompilerError(err) => {
                            // check if the error was caused by an unexpected end of input.
                            // if it was then we persume that the user meant to keep typing.
                            if err.clone().is_unexpected_eof() {
                                self.prompt = CONTINUE;
                                self.readline(editor)
                            } else {
                                // otherwise turn it back into a RadishError and report it.
                                ReplResult::Error(err.into())
                            }
                        }
                        _ => ReplResult::Error(err),
                    },
                }
            }
            Err(ReadlineError::Interrupted) => ReplResult::Interrupted,
            Err(ReadlineError::Eof) => ReplResult::Eof,
            Err(err) => ReplResult::Error(err.to_string().into()),
        }
    }
fn readline ( & mut self , editor : & mut Editor < RadishRustylineHelper > ) -> ReplResult < ( ) > { let line = editor . readline ( self . prompt ) ; match line { Ok ( line ) if line == HELP => { self . print_help ( ) ; editor . add_history_entry ( line . to_string ( ) ) ; ReplResult :: Ok ( ( ) ) } Ok ( line ) => { self . lines . push ( line . clone ( ) ) ; editor . add_history_entry ( line . to_string ( ) ) ; match self . eval ( ) { Ok ( _ ) => ReplResult :: Ok ( ( ) ) , Err ( err ) => match err { RadishError :: CompilerError ( err ) => { // check if the error was caused by an unexpected end of input. // if it was then we persume that the user meant to keep typing. if err . clone ( ) . is_unexpected_eof ( ) { self . prompt = CONTINUE ; self . readline ( editor ) } else { // otherwise turn it back into a RadishError and report it. ReplResult :: Error ( err . into ( ) ) } } _ => ReplResult :: Error ( err ) , } , } } Err ( ReadlineError :: Interrupted ) => ReplResult :: Interrupted , Err ( ReadlineError :: Eof ) => ReplResult :: Eof , Err ( err ) => ReplResult :: Error ( err . to_string ( ) . into ( ) ) , } }
Read a line, also handling multiline input.
Read a line also handling multiline input .
&mut self
editor
&mut Editor<RadishRustylineHelper>