use super::{
iter_pattern::PatternOrPredicate,
patterns::{Matcher, PatternName},
};
use crate::context::{QueryContext, StaticDefinitions};
pub trait AstNodePattern<Q: QueryContext>:
Clone + std::fmt::Debug + Matcher<Q> + PatternName + Sized
{
const INCLUDES_TRIVIA: bool;
fn children<'a>(
&'a self,
definitions: &'a StaticDefinitions<Q>,
) -> Vec<PatternOrPredicate<'a, Q>>;
fn matches_kind_of(&self, node: &Q::Node<'_>) -> bool;
}
pub trait AstLeafNodePattern<Q: QueryContext>:
Clone + std::fmt::Debug + Matcher<Q> + PatternName + Sized
{
fn text(&self) -> Option<&str> {
None
}
}