Function dynparser::ast::flat::consume_this_value
source · Expand description
Consume a node if it’s a Val kind and the vaule is equal to the provider one
use dynparser::ast::flat;
let nodes = vec![
flat::Node::Val("hello".to_string()),
flat::Node::Val("world".to_string()),
flat::Node::Val(".".to_string()),
];
let nodes = flat::consume_this_value("hello", &nodes).unwrap();
let nodes = flat::consume_this_value("world", &nodes).unwrap();