Refactoring parser

- put all used strings in one place to have it easier to track
- don't use `$` for shortcuts, it's a detail not interesting to a
  user; now names must not clash (which is a good idea anyways)
- Added two more shortcuts `conc` and `corr`
This commit is contained in:
Eike Kettner
2021-03-08 22:46:40 +01:00
parent e681ffa96f
commit 77a87782b7
14 changed files with 183 additions and 79 deletions

View File

@ -35,7 +35,8 @@ object ItemQueryGeneratorTest extends SimpleTestSuite {
val cond = ItemQueryGenerator(now, tables, Ident.unsafe("coll"))(q)
val expect =
tables.item.name.like("hello") &&
tables.item.itemDate >= mkTimestamp(2020, 2, 1) &&
coalesce(tables.item.itemDate.s, tables.item.created.s) >=
mkTimestamp(2020, 2, 1) &&
(tables.item.source.like("expense%") || tables.folder.name === "test")
assertEquals(cond, expect)