pub fn advance(&mut self, token: Token<'text>) -> Result<(), ParseError<'text>> {
        let matches = self.current_node
            .successors()
            .iter()
            .filter(|n| n.acceptable(self, n) && n.matches(self, token))
            .cloned()
            .collect::<Vec<_>>();
        match matches.len() {
            1 => {
                let matching_node = &matches[0];
                matching_node.accept(self, token, matching_node);
                self.current_node = Rc::clone(matching_node);
                self.nodes.push(Rc::clone(matching_node));
                self.tokens.push(token);
                Ok(())
            }
            0 => {
                Err(ParseError::NoMatches(
                    token,
                    self.current_node
                        .successors()
                        .iter()
                        .filter(|n| n.acceptable(self, n))
                        .cloned()
                        .collect::<Vec<_>>(),
                ))
            }
            _ => Err(ParseError::AmbiguousMatch(token, matches)),
        }
    }
/// Parse a single token, advancing through the node hierarchy.
Parse a single token, advancing through the node hierarchy.
Parse a single token advancing through the node hierarchy .
pub fn advance(&mut self, token: Token<'text>) -> Result<(), ParseError<'text>> {
        let matches = self.current_node
            .successors()
            .iter()
            .filter(|n| n.acceptable(self, n) && n.matches(self, token))
            .cloned()
            .collect::<Vec<_>>();
        match matches.len() {
            1 => {
                let matching_node = &matches[0];
                matching_node.accept(self, token, matching_node);
                self.current_node = Rc::clone(matching_node);
                self.nodes.push(Rc::clone(matching_node));
                self.tokens.push(token);
                Ok(())
            }
            0 => {
                Err(ParseError::NoMatches(
                    token,
                    self.current_node
                        .successors()
                        .iter()
                        .filter(|n| n.acceptable(self, n))
                        .cloned()
                        .collect::<Vec<_>>(),
                ))
            }
            _ => Err(ParseError::AmbiguousMatch(token, matches)),
        }
    }
pub fn advance ( & mut self , token : Token < ' text > ) -> Result < ( ) , ParseError < ' text > > { let matches = self . current_node . successors ( ) . iter ( ) . filter ( | n | n . acceptable ( self , n ) && n . matches ( self , token ) ) . cloned ( ) . collect :: < Vec < _ > > ( ) ; match matches . len ( ) { 1 => { let matching_node = & matches [ 0 ] ; matching_node . accept ( self , token , matching_node ) ; self . current_node = Rc :: clone ( matching_node ) ; self . nodes . push ( Rc :: clone ( matching_node ) ) ; self . tokens . push ( token ) ; Ok ( ( ) ) } 0 => { Err ( ParseError :: NoMatches ( token , self . current_node . successors ( ) . iter ( ) . filter ( | n | n . acceptable ( self , n ) ) . cloned ( ) . collect :: < Vec < _ > > ( ) , ) ) } _ => Err ( ParseError :: AmbiguousMatch ( token , matches ) ) , } }
Parse a single token, advancing through the node hierarchy.
Parse a single token advancing through the node hierarchy .
&mut self
token
Token<'text>
&mut self
token
Token<'text>