Do not match POST for entities that end with a space.
This is a special case for en-spaces.
This commit is contained in:
parent
8db9038c53
commit
17d8e76e05
@ -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,13 +58,16 @@ fn name<'b, 'g, 'r, 's>(
|
||||
for entity in context.get_global_settings().entities {
|
||||
let result = tuple((
|
||||
tag::<_, _, CustomError>(entity.name),
|
||||
alt((
|
||||
verify(map(tag("{}"), |_| true), |_| !entity.name.ends_with(' ')),
|
||||
map(peek(recognize(entity_end)), |_| false),
|
||||
)),
|
||||
cond(
|
||||
!entity.name.ends_with(' '),
|
||||
alt((
|
||||
map(tag("{}"), |_| true),
|
||||
map(peek(recognize(entity_end)), |_| false),
|
||||
)),
|
||||
),
|
||||
))(input);
|
||||
if let Ok((remaining, (ent, use_brackets))) = result {
|
||||
return Ok((remaining, (entity, ent, use_brackets)));
|
||||
return Ok((remaining, (entity, ent, use_brackets.unwrap_or(false))));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user