os-rust/tests/rustdoc-js-std/parser-errors.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

496 lines
12 KiB
JavaScript
Raw Permalink Normal View History

2021-12-20 17:45:52 +01:00
const PARSED = [
{
2023-06-09 16:49:38 +02:00
query: '<P>',
elems: [],
foundElems: 0,
userQuery: "<P>",
returned: [],
error: "Found generics without a path",
},
{
2023-06-09 16:49:38 +02:00
query: '-> <P>',
elems: [],
foundElems: 0,
userQuery: "-> <P>",
returned: [],
error: "Found generics without a path",
},
{
query: '-> *',
elems: [],
foundElems: 0,
userQuery: "-> *",
returned: [],
2024-06-07 11:42:17 +08:00
error: "Unexpected `*` after ` ` (not a valid identifier)",
},
2021-12-20 17:45:52 +01:00
{
2023-06-09 16:49:38 +02:00
query: 'a<"P">',
2021-12-20 17:45:52 +01:00
elems: [],
foundElems: 0,
userQuery: "a<\"P\">",
2021-12-20 17:45:52 +01:00
returned: [],
error: "Unexpected `\"` in generics",
2021-12-20 17:45:52 +01:00
},
{
2023-06-09 16:49:38 +02:00
query: '"P" "P"',
2021-12-20 17:45:52 +01:00
elems: [],
foundElems: 0,
userQuery: "\"P\" \"P\"",
2021-12-20 17:45:52 +01:00
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
query: '"P","P"',
elems: [],
foundElems: 0,
userQuery: "\"P\",\"P\"",
2023-06-12 16:05:00 +02:00
returned: [],
2021-12-20 17:45:52 +01:00
error: "Cannot have more than one literal search element",
},
{
2023-06-12 16:05:00 +02:00
query: "P,\"P\"",
2021-12-20 17:45:52 +01:00
elems: [],
foundElems: 0,
userQuery: "P,\"P\"",
2021-12-20 17:45:52 +01:00
returned: [],
error: "Cannot use literal search when there is more than one element",
},
{
2023-06-09 16:49:38 +02:00
query: '"p" p',
elems: [],
foundElems: 0,
userQuery: "\"p\" p",
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
query: '"p",p',
elems: [],
foundElems: 0,
userQuery: "\"p\",p",
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
2023-06-09 16:49:38 +02:00
query: '"const": p',
elems: [],
foundElems: 0,
userQuery: "\"const\": p",
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot use quotes on type filter",
},
{
2023-06-09 16:49:38 +02:00
query: "a<:a>",
elems: [],
foundElems: 0,
userQuery: "a<:a>",
returned: [],
error: "Expected type filter before `:`",
},
{
2023-06-09 16:49:38 +02:00
query: "a<::a>",
elems: [],
foundElems: 0,
userQuery: "a<::a>",
returned: [],
error: "Unexpected `::`: paths cannot start with `::`",
},
{
2023-06-09 16:49:38 +02:00
query: "(p -> p",
elems: [],
foundElems: 0,
userQuery: "(p -> p",
returned: [],
error: "Unclosed `(`",
},
{
2023-06-09 16:49:38 +02:00
query: "::a::b",
elems: [],
foundElems: 0,
userQuery: "::a::b",
returned: [],
error: "Paths cannot start with `::`",
},
2023-06-12 16:05:00 +02:00
{
query: " ::a::b",
elems: [],
foundElems: 0,
userQuery: "::a::b",
returned: [],
2023-06-12 16:05:00 +02:00
error: "Paths cannot start with `::`",
},
{
2023-06-09 16:49:38 +02:00
query: "a::::b",
elems: [],
foundElems: 0,
userQuery: "a::::b",
returned: [],
error: "Unexpected `::::`",
},
{
query: "a:: ::b",
elems: [],
foundElems: 0,
userQuery: "a:: ::b",
returned: [],
error: "Unexpected `:: ::`",
},
{
query: "a::\t::b",
elems: [],
foundElems: 0,
userQuery: "a:: ::b",
returned: [],
error: "Unexpected `:: ::`",
},
{
2023-06-09 16:49:38 +02:00
query: ":a",
elems: [],
foundElems: 0,
userQuery: ":a",
returned: [],
error: "Expected type filter before `:`",
},
{
2023-06-12 16:05:00 +02:00
query: "a,b:",
elems: [],
foundElems: 0,
2023-06-12 16:05:00 +02:00
userQuery: "a,b:",
returned: [],
2023-06-12 16:05:00 +02:00
error: "Unexpected `:` (expected path after type filter `b:`)",
},
{
2023-06-09 16:49:38 +02:00
query: "a (b:",
elems: [],
foundElems: 0,
userQuery: "a (b:",
returned: [],
error: "Unclosed `(`",
},
{
2023-06-09 16:49:38 +02:00
query: "_:",
elems: [],
foundElems: 0,
userQuery: "_:",
returned: [],
2024-06-07 11:42:17 +08:00
error: "Unexpected `_` (not a valid identifier)",
},
{
2024-06-07 11:42:17 +08:00
query: "ab:",
elems: [],
foundElems: 0,
2024-06-07 11:42:17 +08:00
userQuery: "ab:",
returned: [],
2024-06-07 11:42:17 +08:00
error: "Unexpected `:` (expected path after type filter `ab:`)",
},
{
query: "a:b",
elems: [],
foundElems: 0,
userQuery: "a:b",
returned: [],
2024-06-07 11:42:17 +08:00
error: "Unknown type filter `a`",
},
{
2023-06-09 16:49:38 +02:00
query: "a-bb",
elems: [],
foundElems: 0,
userQuery: "a-bb",
returned: [],
error: "Unexpected `-` (did you mean `->`?)",
},
{
2023-06-09 16:49:38 +02:00
query: "a>bb",
elems: [],
foundElems: 0,
userQuery: "a>bb",
returned: [],
error: "Unexpected `>` (did you mean `->`?)",
},
{
2023-06-09 16:49:38 +02:00
query: "ab'",
elems: [],
foundElems: 0,
userQuery: "ab'",
returned: [],
2024-06-07 11:42:17 +08:00
error: "Unexpected `'` after `b` (not a valid identifier)",
},
{
2023-06-09 16:49:38 +02:00
query: '"p" <a>',
elems: [],
foundElems: 0,
userQuery: '"p" <a>',
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
query: '"p",<a>',
elems: [],
foundElems: 0,
userQuery: '"p",<a>',
returned: [],
error: "Found generics without a path",
},
{
2023-06-09 16:49:38 +02:00
query: '"p" a<a>',
elems: [],
foundElems: 0,
userQuery: '"p" a<a>',
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
query: '"p",a<a>',
elems: [],
foundElems: 0,
userQuery: '"p",a<a>',
returned: [],
2023-06-12 16:05:00 +02:00
error: "Cannot have more than one element if you use quotes",
},
{
2023-06-09 16:49:38 +02:00
query: "a,<",
elems: [],
foundElems: 0,
userQuery: 'a,<',
returned: [],
error: 'Found generics without a path',
},
{
2023-06-09 16:49:38 +02:00
query: "aaaaa<>b",
elems: [],
foundElems: 0,
userQuery: 'aaaaa<>b',
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Expected `,`, `:` or `->` after `>`, found `b`',
},
{
2023-06-09 16:49:38 +02:00
query: "fn:aaaaa<>b",
elems: [],
foundElems: 0,
userQuery: 'fn:aaaaa<>b',
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Expected `,`, `:` or `->` after `>`, found `b`',
},
{
2023-06-09 16:49:38 +02:00
query: "->a<>b",
elems: [],
foundElems: 0,
userQuery: '->a<>b',
returned: [],
error: 'Expected `,` or `=` after `>`, found `b`',
},
{
2023-06-09 16:49:38 +02:00
query: "a<->",
elems: [],
foundElems: 0,
userQuery: 'a<->',
returned: [],
error: 'Unclosed `<`',
},
2022-04-17 12:05:31 +02:00
{
2023-06-09 16:49:38 +02:00
query: "a<a>:",
2022-04-17 12:05:31 +02:00
elems: [],
foundElems: 0,
userQuery: "a<a>:",
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Unexpected `<` in type filter (before `:`)',
2022-04-17 12:05:31 +02:00
},
{
2023-06-09 16:49:38 +02:00
query: "a<>:",
2022-04-17 12:05:31 +02:00
elems: [],
foundElems: 0,
userQuery: "a<>:",
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Unexpected `<` in type filter (before `:`)',
2022-04-17 12:05:31 +02:00
},
{
2023-06-09 16:49:38 +02:00
query: "a,:",
2022-04-17 12:05:31 +02:00
elems: [],
foundElems: 0,
userQuery: "a,:",
returned: [],
error: 'Expected type filter before `:`',
},
{
query: "a!:",
elems: [],
foundElems: 0,
userQuery: "a!:",
returned: [],
error: 'Unexpected `!` in type filter (before `:`)',
2022-04-17 12:05:31 +02:00
},
{
2023-06-09 16:49:38 +02:00
query: " a<> :",
2022-04-17 12:05:31 +02:00
elems: [],
foundElems: 0,
userQuery: "a<> :",
returned: [],
error: 'Expected `,`, `:` or `->` after `>`, found `:`',
2022-04-17 12:05:31 +02:00
},
2022-04-18 23:11:42 +02:00
{
2023-06-09 16:49:38 +02:00
query: "mod : :",
2022-04-18 23:11:42 +02:00
elems: [],
foundElems: 0,
userQuery: "mod : :",
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Unexpected `:` (expected path after type filter `mod:`)',
},
{
query: "mod: :",
elems: [],
foundElems: 0,
userQuery: "mod: :",
returned: [],
2023-06-12 16:05:00 +02:00
error: 'Unexpected `:` (expected path after type filter `mod:`)',
2022-04-18 23:11:42 +02:00
},
{
2023-06-09 16:49:38 +02:00
query: "a!a",
elems: [],
foundElems: 0,
userQuery: "a!a",
returned: [],
error: 'Unexpected `!`: it can only be at the end of an ident',
},
{
2023-06-09 16:49:38 +02:00
query: "a!!",
elems: [],
foundElems: 0,
userQuery: "a!!",
returned: [],
error: 'Cannot have more than one `!` in an ident',
},
{
2023-06-09 16:49:38 +02:00
query: "mod:a!",
elems: [],
foundElems: 0,
userQuery: "mod:a!",
returned: [],
error: 'Invalid search type: macro `!` and `mod` both specified',
},
{
query: "mod:!",
elems: [],
foundElems: 0,
userQuery: "mod:!",
returned: [],
error: 'Invalid search type: primitive never type `!` and `mod` both specified',
},
{
2023-06-09 16:49:38 +02:00
query: "a!::a",
elems: [],
foundElems: 0,
userQuery: "a!::a",
returned: [],
error: 'Cannot have associated items in macros',
},
2023-03-02 14:28:15 +01:00
{
2023-06-09 16:49:38 +02:00
query: "a<",
2023-03-02 14:28:15 +01:00
elems: [],
foundElems: 0,
userQuery: "a<",
returned: [],
2023-03-02 14:28:15 +01:00
error: "Unclosed `<`",
},
{
query: "p<x> , y",
elems: [
{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [
{
name: "x",
fullPath: ["x"],
pathWithoutLast: [],
pathLast: "x",
generics: [],
typeFilter: -1,
},
],
typeFilter: -1,
},
{
name: "y",
fullPath: ["y"],
pathWithoutLast: [],
pathLast: "y",
generics: [],
typeFilter: -1,
},
],
foundElems: 2,
userQuery: "p<x> , y",
returned: [],
error: null,
},
{
query: "p<x , y>",
elems: [
{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [
{
name: "x",
fullPath: ["x"],
pathWithoutLast: [],
pathLast: "x",
generics: [],
typeFilter: -1,
},
{
name: "y",
fullPath: ["y"],
pathWithoutLast: [],
pathLast: "y",
generics: [],
typeFilter: -1,
},
],
typeFilter: -1,
},
],
foundElems: 1,
userQuery: "p<x , y>",
returned: [],
error: null,
},
{
query: "p ,x , y",
elems: [
{
name: "p",
fullPath: ["p"],
pathWithoutLast: [],
pathLast: "p",
generics: [],
typeFilter: -1,
},
{
name: "x",
fullPath: ["x"],
pathWithoutLast: [],
pathLast: "x",
generics: [],
typeFilter: -1,
},
{
name: "y",
fullPath: ["y"],
pathWithoutLast: [],
pathLast: "y",
generics: [],
typeFilter: -1,
},
],
foundElems: 3,
userQuery: "p ,x , y",
returned: [],
error: null,
},
2021-12-20 17:45:52 +01:00
];