Handle puncuation-only search options.
Some checks failed
rust-build Build rust-build has succeeded
rust-test Build rust-test has failed
rust-foreign-document-test Build rust-foreign-document-test has failed

This commit is contained in:
Tom Alexander 2023-10-07 03:25:01 -04:00
parent 3aa84c1743
commit 20a8683894
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
2 changed files with 9 additions and 2 deletions

View File

@ -140,7 +140,14 @@ fn file_path_plain<'b, 'g, 'r, 's>(
tag(":"), tag(":"),
parser_with_context!(path_plain)(&parser_context), parser_with_context!(path_plain)(&parser_context),
opt(map( opt(map(
tuple((tag("::"), is_not(" \t\r\n"))), tuple((
tag("::"),
verify(is_not(" \t\r\n"), |search_option| {
Into::<&str>::into(search_option)
.chars()
.any(char::is_alphanumeric)
}),
)),
|(_, search_option)| search_option, |(_, search_option)| search_option,
)), )),
)))(input)?; )))(input)?;

View File

@ -262,7 +262,7 @@ fn file_path_reg<'s>(input: OrgSource<'s>) -> Res<OrgSource<'s>, PathReg<'s>> {
search_option: search_option search_option: search_option
.map(Into::<&str>::into) .map(Into::<&str>::into)
.map(Into::<Cow<str>>::into), .map(Into::<Cow<str>>::into),
application: todo!(), application: None, // TODO
}, },
)) ))
} }