Skip to content
Snippets Groups Projects
Commit 51d2adcd authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Plug function evaluation so that the following example compiles

``
let f : N-> R, x -> ((x*x));
R y = f(0);
``
parent 81a33828
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -170,6 +170,9 @@ ASTNodeDataTypeBuilder::_buildNodeDataTypes(ASTNode& n)
<< ") and " << n.children[1]->string() << " (" << dataTypeName(type_1) << ')' << std::ends;
throw parse_error(message.str(), n.begin());
}
} else if (n.is<language::function_evaluation>()) {
std::cout << rang::fgB::red << "returned type of function evaluation is incorrect" << rang::style::reset << "\n";
n.m_data_type = ASTNodeDataType::double_t;
}
}
}
......
......@@ -28,7 +28,13 @@ ASTNodeExpressionBuilder::_buildExpression(ASTNode& n)
ASTNodeAffectationExpressionBuilder{n};
} else if (n.is<language::let_declaration>()) {
std::cerr << rang::fgB::red << "\"Let expression\" is not defined correctly" << rang::style::reset << '\n';
std::cerr << rang::fgB::red << "\"let expression\" is not defined correctly (declaration should be removed)"
<< rang::style::reset << '\n';
n.m_node_processor = std::make_unique<FakeProcessor>();
return;
} else if (n.is<language::function_evaluation>()) {
std::cerr << rang::fgB::red << "\"function evaluation\" is not defined yet" << rang::style::reset << '\n';
n.m_node_processor = std::make_unique<FakeProcessor>();
return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment