pub fn parse_record(&mut self) -> GedcomData {
        let mut data = GedcomData::default();
        loop {
            let level = match self.tokenizer.current_token {
                Token::Level(n) => n,
                _ => panic!(
                    "{} Expected Level, found {:?}",
                    self.dbg(),
                    self.tokenizer.current_token
                ),
            };

            self.tokenizer.next_token();

            let mut pointer: Option<String> = None;
            if let Token::Pointer(xref) = &self.tokenizer.current_token {
                pointer = Some(xref.to_string());
                self.tokenizer.next_token();
            }

            if let Token::Tag(tag) = &self.tokenizer.current_token {
                match tag.as_str() {
                    "FAM" => data.add_family(self.parse_family(level, pointer)),
                    "HEAD" => self.parse_header(),
                    "INDI" => data.add_individual(self.parse_individual(level, pointer)),
                    "REPO" => data.add_repository(self.parse_repository(level, pointer)),
                    "SOUR" => data.add_source(self.parse_source(level, pointer)),
                    "SUBM" => data.add_submitter(self.parse_submitter(level, pointer)),
                    "TRLR" => break,
                    _ => {
                        println!("{} Unhandled tag {}", self.dbg(), tag);
                        self.tokenizer.next_token();
                    }
                };
            } else {
                println!(
                    "{} Unhandled token {:?}",
                    self.dbg(),
                    self.tokenizer.current_token
                );
                self.tokenizer.next_token();
            };
        }

        data
    }
/// Does the actual parsing of the record.
Does the actual parsing of the record.
Does the actual parsing of the record .
pub fn parse_record(&mut self) -> GedcomData {
        let mut data = GedcomData::default();
        loop {
            let level = match self.tokenizer.current_token {
                Token::Level(n) => n,
                _ => panic!(
                    "{} Expected Level, found {:?}",
                    self.dbg(),
                    self.tokenizer.current_token
                ),
            };
            self.tokenizer.next_token();
            let mut pointer: Option<String> = None;
            if let Token::Pointer(xref) = &self.tokenizer.current_token {
                pointer = Some(xref.to_string());
                self.tokenizer.next_token();
            }
            if let Token::Tag(tag) = &self.tokenizer.current_token {
                match tag.as_str() {
                    "FAM" => data.add_family(self.parse_family(level, pointer)),
                    "HEAD" => self.parse_header(),
                    "INDI" => data.add_individual(self.parse_individual(level, pointer)),
                    "REPO" => data.add_repository(self.parse_repository(level, pointer)),
                    "SOUR" => data.add_source(self.parse_source(level, pointer)),
                    "SUBM" => data.add_submitter(self.parse_submitter(level, pointer)),
                    "TRLR" => break,
                    _ => {
                        println!("{} Unhandled tag {}", self.dbg(), tag);
                        self.tokenizer.next_token();
                    }
                };
            } else {
                println!(
                    "{} Unhandled token {:?}",
                    self.dbg(),
                    self.tokenizer.current_token
                );
                self.tokenizer.next_token();
            };
        }
        data
    }
pub fn parse_record ( & mut self ) -> GedcomData { let mut data = GedcomData :: default ( ) ; loop { let level = match self . tokenizer . current_token { Token :: Level ( n ) => n , _ => panic ! ( " " self dbg ( ) self tokenizer current_token ) , } ; self . tokenizer . next_token ( ) ; let mut pointer : Option < String > = None ; if let Token :: Pointer ( xref ) = & self . tokenizer . current_token { pointer = Some ( xref . to_string ( ) ) ; self . tokenizer . next_token ( ) ; } if let Token :: Tag ( tag ) = & self . tokenizer . current_token { match tag . as_str ( ) { " " => data . add_family ( self . parse_family ( level , pointer ) ) , " " => self . parse_header ( ) , " " => data . add_individual ( self . parse_individual ( level , pointer ) ) , " " => data . add_repository ( self . parse_repository ( level , pointer ) ) , " " => data . add_source ( self . parse_source ( level , pointer ) ) , " " => data . add_submitter ( self . parse_submitter ( level , pointer ) ) , " " => break , _ => { println ! ( " " self dbg ( ) tag ) ; self . tokenizer . next_token ( ) ; } } ; } else { println ! ( " " self dbg ( ) self tokenizer current_token ) ; self . tokenizer . next_token ( ) ; } ; } data }
Does the actual parsing of the record.
Does the actual parsing of the record .
&mut self