From 99318f39e34f615f6c7768551702c2ff3a0c108f Mon Sep 17 00:00:00 2001 From: Tom Alexander Date: Sun, 8 Oct 2023 23:41:41 -0400 Subject: [PATCH] Do not accept escaping {} for entities ending in whitespace. --- src/parser/entity.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/parser/entity.rs b/src/parser/entity.rs index 8e20f6b..022545d 100644 --- a/src/parser/entity.rs +++ b/src/parser/entity.rs @@ -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);