parens handler + parser in progress

This commit is contained in:
zadam
2020-05-19 00:00:35 +02:00
parent 81bf84f2de
commit b72dc977e6
7 changed files with 171 additions and 14 deletions

21
spec/parens.spec.js Normal file
View File

@@ -0,0 +1,21 @@
const parens = require('../src/services/search/parens');
describe("Parens handler", () => {
it("handles parens", () => {console.log(parens(["(", "hello", ")", "and", "(", "(", "pick", "one", ")", "and", "another", ")"]))
expect(parens(["(", "hello", ")", "and", "(", "(", "pick", "one", ")", "and", "another", ")"]))
.toEqual([
[
"hello"
],
"and",
[
[
"pick",
"one"
],
"and",
"another"
]
]);
});
});