2022-01-09 14:12:46 +00:00
|
|
|
const QUERY = [
|
|
|
|
'<"P">',
|
|
|
|
'"P" "P"',
|
|
|
|
'P "P"',
|
|
|
|
'"p" p',
|
|
|
|
'"const": p',
|
|
|
|
"<:a>", "<::a>",
|
|
|
|
"((a))",
|
|
|
|
"->,a",
|
|
|
|
"(p -> p",
|
|
|
|
"::a::b",
|
|
|
|
"a::::b",
|
|
|
|
"a::b::",
|
|
|
|
":a",
|
|
|
|
"a b:",
|
|
|
|
"a (b:",
|
|
|
|
"{:",
|
|
|
|
];
|
2021-12-20 16:45:52 +00:00
|
|
|
|
|
|
|
const PARSED = [
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "<\"P\">",
|
|
|
|
returned: [],
|
2022-01-04 14:44:00 +00:00
|
|
|
typeFilter: -1,
|
2022-01-03 15:43:30 +00:00
|
|
|
userQuery: "<\"p\">",
|
2021-12-20 16:45:52 +00:00
|
|
|
error: "`\"` cannot be used in generics",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "\"P\" \"P\"",
|
|
|
|
returned: [],
|
2022-01-04 14:44:00 +00:00
|
|
|
typeFilter: -1,
|
2022-01-03 15:43:30 +00:00
|
|
|
userQuery: "\"p\" \"p\"",
|
2021-12-20 16:45:52 +00:00
|
|
|
error: "Cannot have more than one literal search element",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "P \"P\"",
|
|
|
|
returned: [],
|
2022-01-04 14:44:00 +00:00
|
|
|
typeFilter: -1,
|
2022-01-03 15:43:30 +00:00
|
|
|
userQuery: "p \"p\"",
|
2021-12-20 16:45:52 +00:00
|
|
|
error: "Cannot use literal search when there is more than one element",
|
|
|
|
},
|
2022-01-03 22:51:20 +00:00
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "\"p\" p",
|
|
|
|
returned: [],
|
2022-01-04 14:44:00 +00:00
|
|
|
typeFilter: -1,
|
2022-01-03 22:51:20 +00:00
|
|
|
userQuery: "\"p\" p",
|
|
|
|
error: "You cannot have more than one element if you use quotes",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "\"const\": p",
|
|
|
|
returned: [],
|
2022-01-04 14:44:00 +00:00
|
|
|
typeFilter: -1,
|
2022-01-03 22:51:20 +00:00
|
|
|
userQuery: "\"const\": p",
|
|
|
|
error: "You cannot use quotes on type filter",
|
|
|
|
},
|
2022-01-09 14:12:46 +00:00
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "<:a>",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "<:a>",
|
|
|
|
error: "Unexpected `:` after `<`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "<::a>",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "<::a>",
|
|
|
|
error: "Unexpected `::`: paths cannot start with `::`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "((a))",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "((a))",
|
|
|
|
error: "Unexpected `(` after `(`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "->,a",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "->,a",
|
|
|
|
error: "Unexpected `,` after `->`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "(p -> p",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "(p -> p",
|
|
|
|
error: "Unexpected `-` after `(`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "::a::b",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "::a::b",
|
|
|
|
error: "Paths cannot start with `::`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "a::::b",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "a::::b",
|
|
|
|
error: "Unexpected `::::`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "a::b::",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "a::b::",
|
|
|
|
error: "Paths cannot end with `::`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: ":a",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: ":a",
|
|
|
|
error: "Expected type filter before `:`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "a b:",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "a b:",
|
|
|
|
error: "Unexpected `:`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "a (b:",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "a (b:",
|
|
|
|
error: "Unexpected `:` after `(`",
|
|
|
|
},
|
|
|
|
{
|
|
|
|
args: [],
|
|
|
|
elems: [],
|
|
|
|
foundElems: 0,
|
|
|
|
original: "{:",
|
|
|
|
returned: [],
|
|
|
|
typeFilter: -1,
|
|
|
|
userQuery: "{:",
|
|
|
|
error: "Unknown type filter `{`",
|
|
|
|
},
|
2021-12-20 16:45:52 +00:00
|
|
|
];
|