pub fn consume_this_value<'a>(
    v: &str,
    nodes: &'a [Node]
) -> Result<&'a [Node], Error>
Expand description

Consume a node if it’s a Val kind and the vaule is equal to the provider one

     use dynparser::ast;
     let nodes = vec![
                 ast::Node::Val("hello".to_string()),
                 ast::Node::Val("world".to_string()),
                 ast::Node::Val(".".to_string()),
     ];
     
     let nodes = ast::consume_this_value("hello", &nodes).unwrap();
     let nodes = ast::consume_this_value("world", &nodes).unwrap();