Compare radio target properties.
This commit is contained in:
@@ -2,6 +2,8 @@ use nom::branch::alt;
|
||||
use nom::bytes::complete::tag;
|
||||
use nom::character::complete::line_ending;
|
||||
use nom::character::complete::space0;
|
||||
use nom::combinator::consumed;
|
||||
use nom::combinator::map;
|
||||
use nom::combinator::verify;
|
||||
use nom::multi::many_till;
|
||||
|
||||
@@ -108,13 +110,16 @@ pub(crate) fn radio_target<'b, 'g, 'r, 's>(
|
||||
});
|
||||
let parser_context = context.with_additional_node(&parser_context);
|
||||
|
||||
let (remaining, (children, _exit_contents)) = verify(
|
||||
many_till(
|
||||
parser_with_context!(minimal_set_object)(&parser_context),
|
||||
parser_with_context!(exit_matcher_parser)(&parser_context),
|
||||
let (remaining, (raw_value, children)) = consumed(verify(
|
||||
map(
|
||||
many_till(
|
||||
parser_with_context!(minimal_set_object)(&parser_context),
|
||||
parser_with_context!(exit_matcher_parser)(&parser_context),
|
||||
),
|
||||
|(children, _)| children,
|
||||
),
|
||||
|(children, _exit_contents)| !children.is_empty(),
|
||||
)(remaining)?;
|
||||
|children: &Vec<_>| !children.is_empty(),
|
||||
))(remaining)?;
|
||||
|
||||
let (remaining, _closing) = tag(">>>")(remaining)?;
|
||||
let (remaining, _trailing_whitespace) =
|
||||
@@ -124,6 +129,7 @@ pub(crate) fn radio_target<'b, 'g, 'r, 's>(
|
||||
remaining,
|
||||
RadioTarget {
|
||||
source: source.into(),
|
||||
value: raw_value.into(),
|
||||
children,
|
||||
},
|
||||
))
|
||||
|
||||
Reference in New Issue
Block a user