Skip to main content

matches_kind

Macro matches_kind 

Source
macro_rules! matches_kind {
    ($arena:expr, $node_ref:expr, $variant:ident) => { ... };
    ($node:expr, $variant:ident) => { ... };
}
Expand description

Helper macro to match kind data.

ยงExamples

use rushdown::ast::{Arena, NodeRef, KindData, Paragraph};
use rushdown::matches_kind;

let mut arena = Arena::new();
let para_ref: NodeRef = arena.new_node(Paragraph::new());
assert!(matches_kind!(arena, para_ref, Paragraph));
assert!(matches_kind!(arena[para_ref], Paragraph));