----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://git.reviewboard.kde.org/r/120163/ -----------------------------------------------------------
Review request for Baloo. Repository: baloo Description ------- This patch rewrites AdvancedQueryParser so that it does not use regular expressions anymore. This allows some additional features: * Some one-character-long comparators are now supported: =, <, > and :. Adding support for two-chars comparators like <= and >= would slightly complicate how the lexer works but should be possible. This patch is already quite complicated and I did not want to make it too big. * Values without a property are recognized : "key:value value value" = AND(key:value, "":value, "":value) * The logical operators AND and OR (case-insensitive) are recognized : "a:b AND c:d OR e:f" = OR(AND(a:b, c:d), e:f). Logical operators are left-associative. * Braces are allowed when left-associativity is not wanted: "a:b AND (c:d OR e:f)" = AND(a:b, OR(c:d, e:f)) * Multiple ANDs and ORs are simplified, as shown in the first example (there is only one AND instead of "AND(AND(a, b), c)" ) * Because braces, ANDs and ORs can be used, simply fusing all the literals that have no property into a big query text does not work anymore. For instance, "baloo AND (kde OR kf5)" is not equivalent to "baloo kde kf5". The parser therefore keeps the literals separate, as shown in the first example (there are two terms having no property). Diffs ----- src/core/advancedqueryparser.cpp 3b222ff src/core/autotests/advancedqueryparsertest.h 26859a2 src/core/autotests/advancedqueryparsertest.cpp 14d9cc9 Diff: https://git.reviewboard.kde.org/r/120163/diff/ Testing ------- The existing tests continue to pass and I've added new ones for AND, OR, their combination and nested queries. Thanks, Denis Steckelmacher
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<