Function dynparser::ast::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;
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();