Change parse_escape to return an AnsiSequence
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use crate::{AnsiSequence, Output};
|
||||
use crate::AnsiSequence;
|
||||
|
||||
use core::convert::TryInto;
|
||||
use heapless::Vec;
|
||||
@@ -324,10 +324,10 @@ named!(
|
||||
);
|
||||
|
||||
named!(
|
||||
pub parse_escape<&str, Output>,
|
||||
pub parse_escape<&str, AnsiSequence>,
|
||||
do_parse!(
|
||||
tag!("\u{1b}") >>
|
||||
seq: combined >>
|
||||
(Output::Escape(seq))
|
||||
(seq)
|
||||
)
|
||||
);
|
||||
|
@@ -41,7 +41,7 @@ impl<'a> Iterator for AnsiParseIterator<'a> {
|
||||
|
||||
if let Ok(ret) = res {
|
||||
self.dat = &ret.0;
|
||||
Some(ret.1)
|
||||
Some(Output::Escape(ret.1))
|
||||
}else{
|
||||
let pos = self.dat[(loc+1)..].find('\u{1b}');
|
||||
if let Some(loc) = pos {
|
||||
|
Reference in New Issue
Block a user