rustdoc-search: parse and search with ML-style HOF

Option::map, for example, looks like this:

    option<t>, (t -> u) -> option<u>

This syntax searches all of the HOFs in Rust: traits Fn, FnOnce,
and FnMut, and bare fn primitives.
This commit is contained in:
Michael Howell
2024-01-06 13:17:51 -07:00
parent 5aad51d015
commit 7f427f86bd
7 changed files with 649 additions and 49 deletions

View File

@@ -114,7 +114,7 @@ const PARSED = [
original: "(p -> p",
returned: [],
userQuery: "(p -> p",
error: "Unexpected `-` after `(`",
error: "Unclosed `(`",
},
{
query: "::a::b",
@@ -330,7 +330,7 @@ const PARSED = [
original: 'a<->',
returned: [],
userQuery: 'a<->',
error: 'Unexpected `-` after `<`',
error: 'Unclosed `<`',
},
{
query: "a<a>:",