mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-17 15:32:11 -08:00
Update PegLib, Fix Database Searching CFG (#5244)
* Support C++20 Standard * Update peglib.h * Fix lambdas * Move from for loops to std::any/all_of * Support fixed CFG * Fix Rarity Search to be more accurate
This commit is contained in:
@@ -51,9 +51,9 @@ double Expression::eval(const peg::Ast &ast)
|
||||
{
|
||||
const auto &nodes = ast.nodes;
|
||||
if (ast.name == "NUMBER") {
|
||||
return stod(ast.token);
|
||||
return stod(std::string(ast.token));
|
||||
} else if (ast.name == "FUNCTION") {
|
||||
QString name = QString::fromStdString(nodes[0]->token);
|
||||
QString name = QString::fromStdString(std::string(nodes[0]->token));
|
||||
if (!fns.contains(name))
|
||||
return 0;
|
||||
return fns[name](eval(*nodes[1]));
|
||||
|
||||
Reference in New Issue
Block a user