mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-10-30 20:44:34 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			511 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			511 lines
		
	
	
		
			15 KiB
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| const PARSED = [
 | |
|     {
 | |
|         query: '&[',
 | |
|         elems: [],
 | |
|         foundElems: 0,
 | |
|         userQuery: '&[',
 | |
|         returned: [],
 | |
|         error: 'Unclosed `[`',
 | |
|     },
 | |
|     {
 | |
|         query: '[&',
 | |
|         elems: [],
 | |
|         foundElems: 0,
 | |
|         userQuery: '[&',
 | |
|         returned: [],
 | |
|         error: 'Unclosed `[`',
 | |
|     },
 | |
|     {
 | |
|         query: '&&&D, []',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "reference",
 | |
|                                 fullPath: ["reference"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "reference",
 | |
|                                 generics: [
 | |
|                                     {
 | |
|                                         name: "D",
 | |
|                                         fullPath: ["d"],
 | |
|                                         pathWithoutLast: [],
 | |
|                                         pathLast: "d",
 | |
|                                         generics: [],
 | |
|                                         typeFilter: -1,
 | |
|                                     },
 | |
|                                 ],
 | |
|                                 typeFilter: 1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|             {
 | |
|                 name: "[]",
 | |
|                 fullPath: ["[]"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "[]",
 | |
|                 generics: [],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 2,
 | |
|         userQuery: '&&&D, []',
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&&&[D]',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "reference",
 | |
|                                 fullPath: ["reference"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "reference",
 | |
|                                 generics: [
 | |
|                                     {
 | |
|                                         name: "[]",
 | |
|                                         fullPath: ["[]"],
 | |
|                                         pathWithoutLast: [],
 | |
|                                         pathLast: "[]",
 | |
|                                         generics: [
 | |
|                                             {
 | |
|                                                 name: "D",
 | |
|                                                 fullPath: ["d"],
 | |
|                                                 pathWithoutLast: [],
 | |
|                                                 pathLast: "d",
 | |
|                                                 generics: [],
 | |
|                                                 typeFilter: -1,
 | |
|                                             },
 | |
|                                         ],
 | |
|                                         typeFilter: 1,
 | |
|                                     },
 | |
|                                 ],
 | |
|                                 typeFilter: 1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: '&&&[D]',
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: '&',
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&mut',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "mut",
 | |
|                         fullPath: ["mut"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "mut",
 | |
|                         generics: [],
 | |
|                         typeFilter: 0,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: '&mut',
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&,u8',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 2,
 | |
|         userQuery: "&,u8",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&mut,u8',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "mut",
 | |
|                         fullPath: ["mut"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "mut",
 | |
|                         generics: [],
 | |
|                         typeFilter: 0,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 2,
 | |
|         userQuery: "&mut,u8",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&u8',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [],
 | |
|                         typeFilter: -1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "&u8",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: '&u8<u8>',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "u8",
 | |
|                                 fullPath: ["u8"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "u8",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: -1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: -1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "&u8<u8>",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'u8<&u8>',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "u8",
 | |
|                                 fullPath: ["u8"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "u8",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: -1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "u8<&u8>",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'u8<&u8, u8>',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "u8",
 | |
|                                 fullPath: ["u8"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "u8",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: -1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [],
 | |
|                         typeFilter: -1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "u8<&u8, u8>",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'u8<&u8>',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "u8",
 | |
|                                 fullPath: ["u8"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "u8",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: -1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "u8<&u8>",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'u8<&mut u8, u8>',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "u8",
 | |
|                 fullPath: ["u8"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "u8",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "reference",
 | |
|                         fullPath: ["reference"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "reference",
 | |
|                         generics: [
 | |
|                             {
 | |
|                                 name: "mut",
 | |
|                                 fullPath: ["mut"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "mut",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: 0,
 | |
|                             },
 | |
|                             {
 | |
|                                 name: "u8",
 | |
|                                 fullPath: ["u8"],
 | |
|                                 pathWithoutLast: [],
 | |
|                                 pathLast: "u8",
 | |
|                                 generics: [],
 | |
|                                 typeFilter: -1,
 | |
|                             },
 | |
|                         ],
 | |
|                         typeFilter: 1,
 | |
|                     },
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [],
 | |
|                         typeFilter: -1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: -1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "u8<&mut u8, u8>",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'primitive:&u8',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [],
 | |
|                         typeFilter: -1,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "primitive:&u8",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
|     {
 | |
|         query: 'macro:&u8',
 | |
|         elems: [],
 | |
|         foundElems: 0,
 | |
|         userQuery: "macro:&u8",
 | |
|         returned: [],
 | |
|         error: "Invalid search type: primitive `&` and `macro` both specified",
 | |
|     },
 | |
|     {
 | |
|         query: '¯o:u8',
 | |
|         elems: [
 | |
|             {
 | |
|                 name: "reference",
 | |
|                 fullPath: ["reference"],
 | |
|                 pathWithoutLast: [],
 | |
|                 pathLast: "reference",
 | |
|                 generics: [
 | |
|                     {
 | |
|                         name: "u8",
 | |
|                         fullPath: ["u8"],
 | |
|                         pathWithoutLast: [],
 | |
|                         pathLast: "u8",
 | |
|                         generics: [],
 | |
|                         typeFilter: 16,
 | |
|                     },
 | |
|                 ],
 | |
|                 typeFilter: 1,
 | |
|             },
 | |
|         ],
 | |
|         foundElems: 1,
 | |
|         userQuery: "¯o:u8",
 | |
|         returned: [],
 | |
|         error: null,
 | |
|     },
 | |
| ];
 | 
