rustdoc-search: add search query syntax Fn(T) -> U
This is implemented, in addition to the ML-style one, because Rust does it. If we don't, we'll never hear the end of it. This commit also refactors some duplicate parts of the parser into a dedicated function.
This commit is contained in:
@@ -195,7 +195,7 @@ const PARSED = [
|
||||
original: "a (b:",
|
||||
returned: [],
|
||||
userQuery: "a (b:",
|
||||
error: "Expected `,`, `:` or `->`, found `(`",
|
||||
error: "Unclosed `(`",
|
||||
},
|
||||
{
|
||||
query: "_:",
|
||||
@@ -357,7 +357,16 @@ const PARSED = [
|
||||
original: "a,:",
|
||||
returned: [],
|
||||
userQuery: "a,:",
|
||||
error: 'Unexpected `,` in type filter (before `:`)',
|
||||
error: 'Expected type filter before `:`',
|
||||
},
|
||||
{
|
||||
query: "a!:",
|
||||
elems: [],
|
||||
foundElems: 0,
|
||||
original: "a!:",
|
||||
returned: [],
|
||||
userQuery: "a!:",
|
||||
error: 'Unexpected `!` in type filter (before `:`)',
|
||||
},
|
||||
{
|
||||
query: " a<> :",
|
||||
@@ -366,7 +375,7 @@ const PARSED = [
|
||||
original: "a<> :",
|
||||
returned: [],
|
||||
userQuery: "a<> :",
|
||||
error: 'Unexpected `<` in type filter (before `:`)',
|
||||
error: 'Expected `,`, `:` or `->` after `>`, found `:`',
|
||||
},
|
||||
{
|
||||
query: "mod : :",
|
||||
|
||||
Reference in New Issue
Block a user