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