fn parse(&mut self) -> Option<Box<dyn error::Error>> {
        use lexer::Token as T;

        match self.iter.next() {
            Some(t) => match t {
                Ok((token, token_info)) => match token {
                    T::EntrySymbol => {}
                    T::EntryType(kind) => self.current.kind.push_str(&kind),
                    T::OpenEntry => {}
                    T::EntryId(id) => self.current.id.push_str(&id),
                    T::FieldName(name) => {
                        self.name_cached = name;
                    }
                    T::FieldData(data) => {
                        let name = mem::take(&mut self.name_cached);
                        if self.current.fields.get(&name).is_some() {
                            return Some(Box::new(errors::ParsingError {
                                kind: errors::ParsingErrorKind::DuplicateName(name),
                                info: token_info,
                            }));
                        }
                        self.current.fields.insert(name, data);
                    }
                    T::CloseEntry => {
                        let finished = mem::replace(&mut self.current, types::BibEntry::new());
                        self.entries.push_back(finished);
                    }
                    T::EndOfFile => {}
                },
                Err(e) => return Some(e),
            },
            None => self.finished = true,
        }
        None
    }
/// parse() continues parsing and adds new elements to `self.entries`
parse() continues parsing and adds new elements to `self.entries`
parse () continues parsing and adds new elements to ` self . entries `
fn parse(&mut self) -> Option<Box<dyn error::Error>> {
        use lexer::Token as T;
        match self.iter.next() {
            Some(t) => match t {
                Ok((token, token_info)) => match token {
                    T::EntrySymbol => {}
                    T::EntryType(kind) => self.current.kind.push_str(&kind),
                    T::OpenEntry => {}
                    T::EntryId(id) => self.current.id.push_str(&id),
                    T::FieldName(name) => {
                        self.name_cached = name;
                    }
                    T::FieldData(data) => {
                        let name = mem::take(&mut self.name_cached);
                        if self.current.fields.get(&name).is_some() {
                            return Some(Box::new(errors::ParsingError {
                                kind: errors::ParsingErrorKind::DuplicateName(name),
                                info: token_info,
                            }));
                        }
                        self.current.fields.insert(name, data);
                    }
                    T::CloseEntry => {
                        let finished = mem::replace(&mut self.current, types::BibEntry::new());
                        self.entries.push_back(finished);
                    }
                    T::EndOfFile => {}
                },
                Err(e) => return Some(e),
            },
            None => self.finished = true,
        }
        None
    }
fn parse ( & mut self ) -> Option < Box < dyn error :: Error > > { use lexer :: Token as T ; match self . iter . next ( ) { Some ( t ) => match t { Ok ( ( token , token_info ) ) => match token { T :: EntrySymbol => { } T :: EntryType ( kind ) => self . current . kind . push_str ( & kind ) , T :: OpenEntry => { } T :: EntryId ( id ) => self . current . id . push_str ( & id ) , T :: FieldName ( name ) => { self . name_cached = name ; } T :: FieldData ( data ) => { let name = mem :: take ( & mut self . name_cached ) ; if self . current . fields . get ( & name ) . is_some ( ) { return Some ( Box :: new ( errors :: ParsingError { kind : errors :: ParsingErrorKind :: DuplicateName ( name ) , info : token_info , } ) ) ; } self . current . fields . insert ( name , data ) ; } T :: CloseEntry => { let finished = mem :: replace ( & mut self . current , types :: BibEntry :: new ( ) ) ; self . entries . push_back ( finished ) ; } T :: EndOfFile => { } } , Err ( e ) => return Some ( e ) , } , None => self . finished = true , } None }
parse() continues parsing and adds new elements to `self.entries`
parse () continues parsing and adds new elements to ` self . entries `
&mut self
&mut self