Do not accept escaping {} for entities ending in whitespace.

This commit is contained in:
Tom Alexander 2023-10-08 23:41:41 -04:00
parent c679a85e77
commit 99318f39e3
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -5,6 +5,7 @@ use nom::combinator::eof;
use nom::combinator::map;
use nom::combinator::peek;
use nom::combinator::recognize;
use nom::combinator::verify;
use nom::sequence::tuple;
use super::org_source::OrgSource;
@ -53,7 +54,7 @@ fn name<'b, 'g, 'r, 's>(
let result = tuple((
tag::<_, _, CustomError<_>>(entity.name),
alt((
map(tag("{}"), |_| true),
verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(" ")),
map(peek(recognize(entity_end)), |_| false),
)),
))(input);