Apply else-after-return across the tree

This commit is contained in:
AI-scor 2026-11-10 19:18:53 +01:00
parent 5c7ac6412e
commit 012b30c9de
22 changed files with 48 additions and 25 deletions

View file

@ -57,7 +57,8 @@ double Expression::eval(const peg::Ast &ast)
const auto &nodes = ast.nodes;
if (ast.name == "NUMBER") {
return stod(std::string(ast.token));
} else if (ast.name == "FUNCTION") {
}
if (ast.name == "FUNCTION") {
QString name = QString::fromStdString(std::string(nodes[0]->token));
if (!fns.contains(name)) {
return 0;