Fix parsing the optional value.
This commit is contained in:
parent
4a44d88461
commit
c4edcb8c24
@ -15,6 +15,7 @@ use nom::multi::many_till;
|
|||||||
use nom::sequence::tuple;
|
use nom::sequence::tuple;
|
||||||
|
|
||||||
use super::object_parser::standard_set_object;
|
use super::object_parser::standard_set_object;
|
||||||
|
use super::util::confine_context;
|
||||||
use crate::context::parser_with_context;
|
use crate::context::parser_with_context;
|
||||||
use crate::context::Context;
|
use crate::context::Context;
|
||||||
use crate::context::ContextElement;
|
use crate::context::ContextElement;
|
||||||
@ -62,9 +63,11 @@ pub(crate) fn parse_affiliated_keywords<'g, 's>(
|
|||||||
tag("["),
|
tag("["),
|
||||||
map_parser(
|
map_parser(
|
||||||
recognize(many_till(anychar, peek(tuple((tag("]"), eof))))),
|
recognize(many_till(anychar, peek(tuple((tag("]"), eof))))),
|
||||||
all_consuming(many0(parser_with_context!(standard_set_object)(
|
confine_context(|i| {
|
||||||
&initial_context,
|
all_consuming(many0(parser_with_context!(standard_set_object)(
|
||||||
))),
|
&initial_context,
|
||||||
|
)))(i)
|
||||||
|
}),
|
||||||
),
|
),
|
||||||
tag("]"),
|
tag("]"),
|
||||||
eof,
|
eof,
|
||||||
|
Loading…
Reference in New Issue
Block a user