diff --git a/parser/src/lib.rs b/parser/src/lib.rs index 8017390..9308a53 100644 --- a/parser/src/lib.rs +++ b/parser/src/lib.rs @@ -15,7 +15,6 @@ use sibillexer::Result as LexerResult; use sibiltypes::Obj; use node_parser::{NodeParser, NodeParseResult}; use program_parser::ProgramParser; -use sym_parser::SymParser; /// The output of calling `parse()` on a Parser is one of these Result objects. pub type Result = std::result::Result; @@ -45,13 +44,17 @@ impl Iterator for Parser where T: Iterator { type Item = Result; fn next(&mut self) -> Option { + let mut lex = self.input.next(); loop { - if let Some(lex) = self.input.next() { - if let Ok(lex) = lex { - } else { - } - } else { - break; + match lex { + Some(ref lex) => { + match lex { + Ok(ref lex) => { + } + Err(error) => {} + } + }, + None => break } } assert_eq!(self.parsers.len(), 0);