diff --git a/src/parser.rs b/src/parser.rs index 5bb3f7c07..fccd8b741 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -121,6 +121,7 @@ impl Pars for f in filters.iter() { let f = f.as_str(); match f { + "all" => res.push(Box::new(|_: &Node| -> bool { true })), "call" => res.push(Box::new(T::is_call)), "comment" => res.push(Box::new(T::is_comment)), "error" => res.push(Box::new(T::is_error)), @@ -131,6 +132,11 @@ impl Pars res.push(Box::new(move |node: &Node| -> bool { node.object().kind_id() == n })); + } else { + let f = f.to_owned(); + res.push(Box::new(move |node: &Node| -> bool { + node.object().kind().contains(&f) + })); } } }