Define a RematchObject trait for matching radio links based on radio targets.

This commit is contained in:
Tom Alexander 2023-04-24 20:27:28 -04:00
parent 5108dfb8f4
commit 397083c658
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
1 changed files with 9 additions and 0 deletions

View File

@ -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>>;
}