| const PARSED = [ | |
| // ML-style HOF | |
| { | |
| query: "(-> F<P>)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "F", | |
| fullPath: ["f"], | |
| pathWithoutLast: [], | |
| pathLast: "f", | |
| generics: [ | |
| { | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| }, | |
| ], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(-> F<P>)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(-> P)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(-> P)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(->,a)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(->,a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(F<P> ->)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [{ | |
| name: "F", | |
| fullPath: ["f"], | |
| pathWithoutLast: [], | |
| pathLast: "f", | |
| generics: [ | |
| { | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| }, | |
| ], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(F<P> ->)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(P ->)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [{ | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(P ->)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(,a->)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(,a->)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(aaaaa->a)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [{ | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(aaaaa->a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(aaaaa, b -> a)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(aaaaa, b -> a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "primitive:(aaaaa, b -> a)", | |
| elems: [{ | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: "primitive", | |
| }], | |
| foundElems: 1, | |
| userQuery: "primitive:(aaaaa, b -> a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "x, trait:(aaaaa, b -> a)", | |
| elems: [ | |
| { | |
| name: "x", | |
| fullPath: ["x"], | |
| pathWithoutLast: [], | |
| pathLast: "x", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: "trait", | |
| } | |
| ], | |
| foundElems: 2, | |
| userQuery: "x, trait:(aaaaa, b -> a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| // Rust-style HOF | |
| { | |
| query: "Fn () -> F<P>", | |
| elems: [{ | |
| name: "Fn", | |
| fullPath: ["fn"], | |
| pathWithoutLast: [], | |
| pathLast: "fn", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "F", | |
| fullPath: ["f"], | |
| pathWithoutLast: [], | |
| pathLast: "f", | |
| generics: [ | |
| { | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| }, | |
| ], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "Fn () -> F<P>", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "FnMut() -> P", | |
| elems: [{ | |
| name: "FnMut", | |
| fullPath: ["fnmut"], | |
| pathWithoutLast: [], | |
| pathLast: "fnmut", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "FnMut() -> P", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "(FnMut() -> P)", | |
| elems: [{ | |
| name: "FnMut", | |
| fullPath: ["fnmut"], | |
| pathWithoutLast: [], | |
| pathLast: "fnmut", | |
| generics: [], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "(FnMut() -> P)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "Fn(F<P>)", | |
| elems: [{ | |
| name: "Fn", | |
| fullPath: ["fn"], | |
| pathWithoutLast: [], | |
| pathLast: "fn", | |
| generics: [{ | |
| name: "F", | |
| fullPath: ["f"], | |
| pathWithoutLast: [], | |
| pathLast: "f", | |
| generics: [ | |
| { | |
| name: "P", | |
| fullPath: ["p"], | |
| pathWithoutLast: [], | |
| pathLast: "p", | |
| generics: [], | |
| }, | |
| ], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }], | |
| foundElems: 1, | |
| userQuery: "Fn(F<P>)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "primitive:fnonce(aaaaa, b) -> a", | |
| elems: [{ | |
| name: "fnonce", | |
| fullPath: ["fnonce"], | |
| pathWithoutLast: [], | |
| pathLast: "fnonce", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: "primitive", | |
| }], | |
| foundElems: 1, | |
| userQuery: "primitive:fnonce(aaaaa, b) -> a", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "primitive:fnonce(aaaaa, keyword:b) -> trait:a", | |
| elems: [{ | |
| name: "fnonce", | |
| fullPath: ["fnonce"], | |
| pathWithoutLast: [], | |
| pathLast: "fnonce", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: "keyword", | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: "trait", | |
| }], | |
| ], | |
| ], | |
| typeFilter: "primitive", | |
| }], | |
| foundElems: 1, | |
| userQuery: "primitive:fnonce(aaaaa, keyword:b) -> trait:a", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: "x, trait:fn(aaaaa, b -> a)", | |
| elems: [ | |
| { | |
| name: "x", | |
| fullPath: ["x"], | |
| pathWithoutLast: [], | |
| pathLast: "x", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "fn", | |
| fullPath: ["fn"], | |
| pathWithoutLast: [], | |
| pathLast: "fn", | |
| generics: [ | |
| { | |
| name: "->", | |
| fullPath: ["->"], | |
| pathWithoutLast: [], | |
| pathLast: "->", | |
| generics: [ | |
| { | |
| name: "aaaaa", | |
| fullPath: ["aaaaa"], | |
| pathWithoutLast: [], | |
| pathLast: "aaaaa", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [{ | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| ], | |
| ], | |
| typeFilter: null, | |
| }, | |
| ], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ] | |
| ], | |
| typeFilter: "trait", | |
| } | |
| ], | |
| foundElems: 2, | |
| userQuery: "x, trait:fn(aaaaa, b -> a)", | |
| returned: [], | |
| error: null, | |
| }, | |
| { | |
| query: 'a,b(c)', | |
| elems: [ | |
| { | |
| name: "a", | |
| fullPath: ["a"], | |
| pathWithoutLast: [], | |
| pathLast: "a", | |
| generics: [], | |
| typeFilter: null, | |
| }, | |
| { | |
| name: "b", | |
| fullPath: ["b"], | |
| pathWithoutLast: [], | |
| pathLast: "b", | |
| generics: [{ | |
| name: "c", | |
| fullPath: ["c"], | |
| pathWithoutLast: [], | |
| pathLast: "c", | |
| generics: [], | |
| typeFilter: null, | |
| }], | |
| bindings: [ | |
| [ | |
| "output", | |
| [], | |
| ] | |
| ], | |
| typeFilter: null, | |
| } | |
| ], | |
| foundElems: 2, | |
| userQuery: "a,b(c)", | |
| returned: [], | |
| error: null, | |
| }, | |
| ]; |