shared: LooqsQuery: Fix logic of implicit AND booleans. Add 'limit:' support

Add implicit AND booleans at the end.

This fixes a number of issues in LooqsQuery:

(1) A query like a b c p:(something) would fail, because
a b c get merged into one word. This happens at the end.

lonewords are special and do not become a token immediatly. So previous
logic to add implicit ANDs does not apply.

(2) Negations were also broken with lonewords.

(3) The TokenType enum fields were too narrow to be useful for the bitmask

Independent of that, add support for 'limit:'
Αυτή η υποβολή περιλαμβάνεται σε:
2022-06-04 23:12:58 +02:00
γονέας 821bed6706
υποβολή a6ddcef0c0
3 αρχεία άλλαξαν με 45 προσθήκες και 26 διαγραφές

@@ -4,24 +4,25 @@
enum TokenType
{
WORD,
NEGATION = 2,
BOOL = 4,
WORD = 8,
NEGATION = 16,
BOOL = 32,
BOOL_AND,
BOOL_OR,
GROUP = 8,
GROUP = 64,
BRACKET_OPEN,
BRACKET_CLOSE,
SORT = 16,
FILTER_PATH = 32,
SORT = 128,
FILTER_PATH = 256,
FILTER_PATH_MTIME,
FILTER_PATH_CONTAINS,
FILTER_PATH_SIZE,
FILTER_PATH_ENDS,
FILTER_PATH_STARTS,
FILTER_CONTENT = 64,
FILTER_CONTENT = 512,
FILTER_CONTENT_CONTAINS,
FILTER_CONTENT_PAGE,
LIMIT = 1024
};
class Token