From 397083c65809c91d2791fa228cc41ebc49154cab Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Mon, 24 Apr 2023 20:27:28 -0400 Subject: [PATCH] Define a RematchObject trait for matching radio links based on radio targets. --- src/parser/radio_link.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/parser/radio_link.rs b/src/parser/radio_link.rs index 890f408..2066f24 100644 --- a/src/parser/radio_link.rs +++ b/src/parser/radio_link.rs @@ -6,6 +6,7 @@ use nom::combinator::verify; use nom::multi::many_till; use super::Context; +use super::Object; use crate::error::Res; use crate::parser::exiting::ExitClass; use crate::parser::object_parser::minimal_set_object; @@ -54,3 +55,11 @@ pub fn radio_target<'r, 's>( fn radio_target_end<'r, 's>(context: Context<'r, 's>, input: &'s str) -> Res<&'s str, &'s str> { alt((tag("<"), tag(">"), line_ending))(input) } + +pub trait RematchObject { + fn rematch_object<'r, 's>( + &self, + context: Context<'r, 's>, + input: &'s str, + ) -> Res<&'s str, Object<'s>>; +}