Skip to content
Snippets Groups Projects

Feature/builtin functions

4 files
+ 152
14
Compare changes
  • Side-by-side
  • Inline

Files

#include <language/ast/ASTNodeDataTypeFlattener.hpp>
#include <language/ast/ASTNodeDataTypeFlattener.hpp>
#include <language/PEGGrammar.hpp>
#include <language/PEGGrammar.hpp>
 
#include <language/utils/BuiltinFunctionEmbedder.hpp>
#include <language/utils/FunctionTable.hpp>
#include <language/utils/FunctionTable.hpp>
#include <language/utils/SymbolTable.hpp>
#include <language/utils/SymbolTable.hpp>
@@ -33,9 +34,20 @@ ASTNodeDataTypeFlattener::ASTNodeDataTypeFlattener(ASTNode& node, FlattenedDataT
@@ -33,9 +34,20 @@ ASTNodeDataTypeFlattener::ASTNodeDataTypeFlattener(ASTNode& node, FlattenedDataT
}
}
break;
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
// LCOV_EXCL_START
default: {
default: {
throw ParseError("unexpected function type", node.begin());
throw ParseError{"unexpected function type", node.begin()};
}
}
// LCOV_EXCL_STOP
// LCOV_EXCL_STOP
}
}
Loading