mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-25 08:03:54 -07:00
update handling of keywords: AND, OR, NOT in card search (#5788)
* update hnadling of keywords: AND, OR, NOT in card search * added and * update test * update test * update OR to not be [oO][rR] and just look for OR * keyword testing * adjusted new test * implement test case for cards with keyword in name * implement test case to cards with keyword in name * format * update test case * change test cas * update truth test case * changed test card search from real cards to fake and added cards * Update tests/carddatabase/data/cards.xml Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> * Update tests/carddatabase/filter_string_test.cpp Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> * Update tests/carddatabase/filter_string_test.cpp Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com> * update formatting * update cardatabase_test to include +2 cards * update test case +1 set + 1 type --------- Co-authored-by: RickyRister <42636155+RickyRister@users.noreply.github.com>
This commit is contained in:
parent
26dcb015ce
commit
574ea01e08
4 changed files with 43 additions and 10 deletions
|
|
@ -10,15 +10,15 @@
|
|||
peg::parser search(R"(
|
||||
Start <- QueryPartList
|
||||
~ws <- [ ]+
|
||||
QueryPartList <- ComplexQueryPart ( ws ("and" ws)? ComplexQueryPart)* ws*
|
||||
QueryPartList <- ComplexQueryPart ( ws ("AND" ws)? ComplexQueryPart)* ws*
|
||||
|
||||
ComplexQueryPart <- SomewhatComplexQueryPart ws $or<[oO][rR]> ws ComplexQueryPart / SomewhatComplexQueryPart
|
||||
ComplexQueryPart <- SomewhatComplexQueryPart ws "OR" ws ComplexQueryPart / SomewhatComplexQueryPart
|
||||
|
||||
SomewhatComplexQueryPart <- [(] QueryPartList [)] / QueryPart
|
||||
|
||||
QueryPart <- NotQuery / SetQuery / RarityQuery / CMCQuery / FormatQuery / PowerQuery / ToughnessQuery / ColorQuery / TypeQuery / OracleQuery / FieldQuery / GenericQuery
|
||||
|
||||
NotQuery <- ('not' ws/'-') SomewhatComplexQueryPart
|
||||
NotQuery <- ('NOT' ws/'-') SomewhatComplexQueryPart
|
||||
SetQuery <- ('e'/'set') [:] FlexStringValue
|
||||
OracleQuery <- 'o' [:] RegexString
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue