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

Add a filter to data that cannot be printed

parent 30fd651e
No related branches found
No related tags found
1 merge request!37Feature/language
......@@ -33,7 +33,13 @@ class OStreamProcessor final : public INodeProcessor
OStreamProcessor(ASTNode& node, std::ostream& os) : m_node{node}, m_os(os)
{
;
for (auto& child : m_node.children) {
if ((child->m_data_type == ASTNodeDataType::type_id_t) or (child->m_data_type == ASTNodeDataType::function_t) or
(child->m_data_type == ASTNodeDataType::c_function_t)) {
throw parse_error("invalid argument, cannot print a '" + dataTypeName(child->m_data_type) + "'",
std::vector{child->begin()});
}
}
}
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment