Language refactoring, added builtin function registry

This commit is contained in:
WerWolv
2021-01-11 23:54:12 +01:00
parent 90e0aa83d8
commit c09a8bca7f
20 changed files with 203 additions and 208 deletions

View File

@@ -73,4 +73,15 @@ namespace hex {
return *SharedData::get().commandPaletteCommands;
}
/* Pattern Language Functions */
void ContentRegistry::PatternLanguageFunctions::add(std::string_view name, u32 parameterCount, const std::function<hex::lang::ASTNode*(std::vector<hex::lang::ASTNode*>)> &func) {
(*SharedData::get().patternLanguageFunctions)[name.data()] = Function{ parameterCount, func };
}
std::map<std::string, ContentRegistry::PatternLanguageFunctions::Function> ContentRegistry::PatternLanguageFunctions::getEntries() {
return *SharedData::get().patternLanguageFunctions;
}
}