mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-06 01:57:56 -08:00
ignore "deck" at start of a list add tests add tests to clangify.sh
This commit is contained in:
@@ -492,7 +492,9 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
|
||||
const QRegularExpression reEmpty("^\\s*$");
|
||||
const QRegularExpression reComment("[\\w\\[\\(\\{].*$", QRegularExpression::UseUnicodePropertiesOption);
|
||||
const QRegularExpression reSBMark("^\\s*sb:\\s*(.+)", QRegularExpression::CaseInsensitiveOption);
|
||||
const QRegularExpression reSBComment("sideboard", QRegularExpression::CaseInsensitiveOption);
|
||||
const QRegularExpression reSBComment("^sideboard\\b.*$", QRegularExpression::CaseInsensitiveOption);
|
||||
const QRegularExpression reDeckComment("^((main)?deck(list)?|mainboard)\\b",
|
||||
QRegularExpression::CaseInsensitiveOption);
|
||||
|
||||
// simplified matches
|
||||
const QRegularExpression reMultiplier("^[xX\\(\\[]*(\\d+)[xX\\*\\)\\]]* ?(.+)");
|
||||
@@ -563,6 +565,16 @@ bool DeckList::loadFromStream_Plain(QTextStream &in)
|
||||
}
|
||||
comments.chop(1); // remove last newline
|
||||
|
||||
// discard empty lines
|
||||
while (index < max_line && inputs.at(index).contains(reEmpty)) {
|
||||
++index;
|
||||
}
|
||||
|
||||
// discard line if it starts with deck or mainboard, all cards until the sideboard starts are in the mainboard
|
||||
if (inputs.at(index).contains(reDeckComment)) {
|
||||
++index;
|
||||
}
|
||||
|
||||
// parse decklist
|
||||
for (; index < max_line; ++index) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user