1
Fork 0

Fix eBNF and handling of whitespace characters when not in a path

This commit is contained in:
Guillaume Gomez 2023-06-13 14:01:01 +02:00
parent 4f0a9124bd
commit e4ee329865
2 changed files with 116 additions and 3 deletions

View file

@ -366,7 +366,7 @@ const PARSED = [
original: "a<> :",
returned: [],
userQuery: "a<> :",
error: 'Expected `,`, `:` or `->` after `>`, found ` `',
error: 'Unexpected `<` in type filter (before `:`)',
},
{
query: "mod : :",
@ -440,4 +440,108 @@ const PARSED = [
userQuery: "a<",
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,
original: "p<x> , y",
returned: [],
userQuery: "p<x> , y",
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,
original: "p<x , y>",
returned: [],
userQuery: "p<x , y>",
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,
original: "p ,x , y",
returned: [],
userQuery: "p ,x , y",
error: null,
},
];