fn match_with_symbols(symbols: &Vec<MatchSymbol>, input: &CellRef) -> Result<Vec<MatchBinding>, BindError> {
        // Current position in the input
        let mut input_pos   = &**input;
        let mut bindings    = vec![];

        // Match the input position against the expected symbol
        for symbol in symbols.iter() {
            // Match the next symbol
            let (new_bindings, new_pos) = Self::match_symbol(symbol, input_pos)?;

            // Store the bindings
            bindings.extend(new_bindings);

            // Advance the input position
            input_pos = new_pos;
        }

        if let SafasCell::Nil = input_pos {
            // Reached the end of the input: match succeded
            Ok(bindings)
        } else {
            // Only matched a prefix of what was expected
            Err(BindError::SyntaxMatchedPrefix)
        }
    }
///
/// Performs matching directly against a symbol list
///
Performs matching directly against a symbol list
Performs matching directly against a symbol list
fn match_with_symbols(symbols: &Vec<MatchSymbol>, input: &CellRef) -> Result<Vec<MatchBinding>, BindError> {
        // Current position in the input
        let mut input_pos   = &**input;
        let mut bindings    = vec![];
        // Match the input position against the expected symbol
        for symbol in symbols.iter() {
            // Match the next symbol
            let (new_bindings, new_pos) = Self::match_symbol(symbol, input_pos)?;
            // Store the bindings
            bindings.extend(new_bindings);
            // Advance the input position
            input_pos = new_pos;
        }
        if let SafasCell::Nil = input_pos {
            // Reached the end of the input: match succeded
            Ok(bindings)
        } else {
            // Only matched a prefix of what was expected
            Err(BindError::SyntaxMatchedPrefix)
        }
    }
fn match_with_symbols ( symbols : & Vec < MatchSymbol > , input : & CellRef ) -> Result < Vec < MatchBinding > , BindError > { // Current position in the input let mut input_pos = & * * input ; let mut bindings = vec ! [ ] ; // Match the input position against the expected symbol for symbol in symbols . iter ( ) { // Match the next symbol let ( new_bindings , new_pos ) = Self :: match_symbol ( symbol , input_pos ) ? ; // Store the bindings bindings . extend ( new_bindings ) ; // Advance the input position input_pos = new_pos ; } if let SafasCell :: Nil = input_pos { // Reached the end of the input: match succeded Ok ( bindings ) } else { // Only matched a prefix of what was expected Err ( BindError :: SyntaxMatchedPrefix ) } }
Performs matching directly against a symbol list
Performs matching directly against a symbol list
symbols
&Vec<MatchSymbol>
input
&CellRef
symbols
&Vec<MatchSymbol>
input
&CellRef