diff options
Diffstat (limited to 'src/core/parser')
-rw-r--r-- | src/core/parser/ParserScope.cpp | 23 | ||||
-rw-r--r-- | src/core/parser/ParserScope.hpp | 4 |
2 files changed, 10 insertions, 17 deletions
diff --git a/src/core/parser/ParserScope.cpp b/src/core/parser/ParserScope.cpp index 5e4b37f..7a7cb74 100644 --- a/src/core/parser/ParserScope.cpp +++ b/src/core/parser/ParserScope.cpp @@ -409,20 +409,15 @@ bool ParserScope::resolveType(const std::string &name, Handle<Node> owner, return resolveType(Utils::split(name, '.'), owner, logger, resultCallback); } -bool ParserScope::resolveValue(Variant &data, Handle<Node> owner, - Handle<Type> type, Logger &logger) +bool ParserScope::resolveValue(Variant &data, Handle<Type> type, Logger &logger) { - return type->build(data, logger, - [&](bool async, const Rtti *rttiType, - const std::vector<std::string> &path, - ResolutionResultCallback resultCallback) mutable { - if (!async) { - Rooted<Node> resolved = ParserScopeBase::resolve(rttiType, path, logger); - resultCallback(resolved, owner, logger); - return resolved != nullptr; - } - return resolve(rttiType, path, type, logger, resultCallback); - }); + // Run the build function + return type->build( + data, logger, + [&logger, this](const Rtti *rttiType, + const std::vector<std::string> &path) mutable { + return ParserScopeBase::resolve(rttiType, path, logger); + }); } bool ParserScope::resolveTypeWithValue(const std::vector<std::string> &path, @@ -440,7 +435,7 @@ bool ParserScope::resolveTypeWithValue(const std::vector<std::string> &path, [=](Handle<Node> resolved, Handle<Node> owner, Logger &logger) mutable { if (resolved != nullptr) { Rooted<Type> type = resolved.cast<Type>(); - scope.resolveValue(*valuePtr, owner, type, logger); + scope.resolveValue(*valuePtr, type, logger); } // Call the result callback with the type diff --git a/src/core/parser/ParserScope.hpp b/src/core/parser/ParserScope.hpp index eec4751..b4ce037 100644 --- a/src/core/parser/ParserScope.hpp +++ b/src/core/parser/ParserScope.hpp @@ -700,14 +700,12 @@ public: * @param data is a reference at a variant that may contain magic values * (even in inner structures). The data will be passed to the "build" * function of the given type. - * @param owner is the node for which the resolution takes place. * @param type is the Typesystem type the data should be interpreted with. * @param logger is the logger instance into which resolution problems * should be logged. * @return true if the value was successfully built. */ - bool resolveValue(Variant &data, Handle<Node> owner, Handle<Type> type, - Logger &logger); + bool resolveValue(Variant &data, Handle<Type> type, Logger &logger); /** * Resolves a type and makes sure the corresponding value is of the correct |