Add isIdentCharacter function to ensure that unexpected characters are handled correctly

This commit is contained in:
Guillaume Gomez
2022-03-23 17:26:32 +01:00
parent f9251eef68
commit 8e29ed43d9
3 changed files with 45 additions and 15 deletions

View File

@@ -17,9 +17,10 @@ const QUERY = [
":a",
"a b:",
"a (b:",
"{:",
"_:",
"a-bb",
"a>bb",
"ab'",
];
const PARSED = [
@@ -188,11 +189,11 @@ const PARSED = [
{
elems: [],
foundElems: 0,
original: "{:",
original: "_:",
returned: [],
typeFilter: -1,
userQuery: "{:",
error: "Unknown type filter `{`",
userQuery: "_:",
error: "Unknown type filter `_`",
},
{
elems: [],
@@ -212,4 +213,13 @@ const PARSED = [
userQuery: "a>bb",
error: "Unexpected `>` (did you mean `->`?)",
},
{
elems: [],
foundElems: 0,
original: "ab'",
returned: [],
typeFilter: -1,
userQuery: "ab'",
error: "Unexpected `'`",
},
];