From bee6cdf08e4749d28c8e6bc44c4d604c8578d70d Mon Sep 17 00:00:00 2001 From: Nathan Fisher Date: Mon, 16 Jan 2023 00:45:17 -0500 Subject: [PATCH] Add mode::parser::parse_all method --- src/mode/parser.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mode/parser.rs b/src/mode/parser.rs index 5c6f692..af59e70 100644 --- a/src/mode/parser.rs +++ b/src/mode/parser.rs @@ -237,6 +237,13 @@ impl Parser { self.reset(); Ok(self.mode) } + + pub fn parse_all(&mut self, value: &str) -> Result { + for seg in value.split(',') { + self.parse(seg); + } + Ok(self.mode()) + } } #[cfg(test)]