Compare commits

..

No commits in common. "bcdf1f5e9d13becc4429ef7476d2ed760726f30d" and "8db9038c53fbee46bc50c6c45a229d292e3cd3c2" have entirely different histories.

View File

@ -1,11 +1,11 @@
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::satisfy;
use nom::combinator::cond;
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;
@ -58,16 +58,13 @@ fn name<'b, 'g, 'r, 's>(
for entity in context.get_global_settings().entities {
let result = tuple((
tag::<_, _, CustomError>(entity.name),
cond(
!entity.name.ends_with(' '),
alt((
map(tag("{}"), |_| true),
verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(' ')),
map(peek(recognize(entity_end)), |_| false),
)),
),
))(input);
if let Ok((remaining, (ent, use_brackets))) = result {
return Ok((remaining, (entity, ent, use_brackets.unwrap_or(false))));
return Ok((remaining, (entity, ent, use_brackets)));
}
}