Skip to content
Snippets Groups Projects

Feature/builtin functions

3 files
+ 142
13
Compare changes
  • Side-by-side
  • Inline

Files

#include <language/ast/ASTNodeDataTypeFlattener.hpp>
#include <language/PEGGrammar.hpp>
#include <language/utils/BuiltinFunctionEmbedder.hpp>
#include <language/utils/FunctionTable.hpp>
#include <language/utils/SymbolTable.hpp>
@@ -33,9 +34,20 @@ ASTNodeDataTypeFlattener::ASTNodeDataTypeFlattener(ASTNode& node, FlattenedDataT
}
break;
}
case ASTNodeDataType::builtin_function_t: {
uint64_t builtin_function_id = std::get<uint64_t>(i_function_symbol->attributes().value());
auto builtin_function_embedder = node.m_symbol_table->builtinFunctionEmbedderTable()[builtin_function_id];
const auto& compound_data_type = builtin_function_embedder->getReturnDataType();
for (auto data_type : compound_data_type.contentTypeList()) {
flattened_datatype_list.push_back({*data_type, node});
}
break;
}
// LCOV_EXCL_START
default: {
throw ParseError("unexpected function type", node.begin());
throw ParseError{"unexpected function type", node.begin()};
}
// LCOV_EXCL_STOP
}
Loading