diff --git a/src/error.rs b/src/error.rs index 069b750..020fee5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -41,6 +41,16 @@ impl Display for CommandNotFoundError { } } +pub struct UnmatchedQuoteError { + index: usize, +} + +impl Display for UnmatchedQuoteError { + fn fmt(&self, f: &mut Formatter) -> fmt::Result { + write!(f, "unmatched quote at character {}", self.index) + } +} + pub fn print(error: Error) { let name = env::args().next().unwrap_or(String::from("rash")); let name = Path::new(&name).file_name().unwrap().to_str().unwrap(); diff --git a/src/parser.rs b/src/parser.rs index 9d2d299..b1a7c07 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -106,6 +106,3 @@ pub fn parse(line: String, variables: &Variables) -> CommandSequence { command_sequence } - -#[derive(Debug)] -struct UnmatchedQuoteError;