shortcut negation syntax

This commit is contained in:
zadam
2020-07-19 15:25:24 +02:00
parent df69b1d8dd
commit 4c7b1d6543
4 changed files with 65 additions and 17 deletions

View File

@@ -64,6 +64,11 @@ describe("Lexer expression", () => {
.toEqual(["#", "~author", ".", "title", "=", "hugh howey", "and", "note", ".", "book title", "=", "silo"]);
});
it("negation of label and relation", () => {
expect(lexer(`#!capital ~!neighbor`).expressionTokens)
.toEqual(["#!capital", "~!neighbor"]);
});
it("negation of sub-expression", () => {
expect(lexer(`# not(#capital) and note.noteId != "root"`).expressionTokens)
.toEqual(["#", "not", "(", "#capital", ")", "and", "note", ".", "noteid", "!=", "root"]);