2e569274d3
Part of #60485
309 lines
8.0 KiB
JavaScript
309 lines
8.0 KiB
JavaScript
const QUERY = [
|
|
'[[[D, []]]',
|
|
'[[[D, []]]]',
|
|
'[] u8',
|
|
'[u8]',
|
|
'[u8,u8]',
|
|
'[u8<u8>]',
|
|
'[]',
|
|
'[>',
|
|
'[<',
|
|
'[a>',
|
|
'[a<',
|
|
'[a',
|
|
'[',
|
|
']',
|
|
'primitive:[u8]',
|
|
'macro:[u8]',
|
|
];
|
|
|
|
const PARSED = [
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: '[[[D, []]]',
|
|
returned: [],
|
|
userQuery: '[[[d, []]]',
|
|
error: 'Unclosed `[`',
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "d",
|
|
fullPath: ["d"],
|
|
pathWithoutLast: [],
|
|
pathLast: "d",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: '[[[D, []]]]',
|
|
returned: [],
|
|
userQuery: '[[[d, []]]]',
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [],
|
|
typeFilter: 15,
|
|
},
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
foundElems: 2,
|
|
original: "[] u8",
|
|
returned: [],
|
|
userQuery: "[] u8",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: "[u8]",
|
|
returned: [],
|
|
userQuery: "[u8]",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: "[u8,u8]",
|
|
returned: [],
|
|
userQuery: "[u8,u8]",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: "[u8<u8>]",
|
|
returned: [],
|
|
userQuery: "[u8<u8>]",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: "[]",
|
|
returned: [],
|
|
userQuery: "[]",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[>",
|
|
returned: [],
|
|
userQuery: "[>",
|
|
error: "Unexpected `>` after `[`",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[<",
|
|
returned: [],
|
|
userQuery: "[<",
|
|
error: "Found generics without a path",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[a>",
|
|
returned: [],
|
|
userQuery: "[a>",
|
|
error: "Unexpected `>` after `[`",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[a<",
|
|
returned: [],
|
|
userQuery: "[a<",
|
|
error: "Unclosed `<`",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[a",
|
|
returned: [],
|
|
userQuery: "[a",
|
|
error: "Unclosed `[`",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "[",
|
|
returned: [],
|
|
userQuery: "[",
|
|
error: "Unclosed `[`",
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "]",
|
|
returned: [],
|
|
userQuery: "]",
|
|
error: "Unexpected `]`",
|
|
},
|
|
{
|
|
elems: [
|
|
{
|
|
name: "[]",
|
|
fullPath: ["[]"],
|
|
pathWithoutLast: [],
|
|
pathLast: "[]",
|
|
generics: [
|
|
{
|
|
name: "u8",
|
|
fullPath: ["u8"],
|
|
pathWithoutLast: [],
|
|
pathLast: "u8",
|
|
generics: [],
|
|
typeFilter: -1,
|
|
},
|
|
],
|
|
typeFilter: 15,
|
|
},
|
|
],
|
|
foundElems: 1,
|
|
original: "primitive:[u8]",
|
|
returned: [],
|
|
userQuery: "primitive:[u8]",
|
|
error: null,
|
|
},
|
|
{
|
|
elems: [],
|
|
foundElems: 0,
|
|
original: "macro:[u8]",
|
|
returned: [],
|
|
userQuery: "macro:[u8]",
|
|
error: "Invalid search type: primitive `[]` and `macro` both specified",
|
|
},
|
|
];
|