diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 21:51:41 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-02-03 21:51:41 +0100 |
commit | e5a0db3de5bcee624e680ef62d1c02f22e1d3591 (patch) | |
tree | 4b6f7949983d37964f12d6db13256cda7871bdcf /src/core/parser/ParserScope.cpp | |
parent | 5fb3d3f7f785144425513a734e2a9fc0dfd8a045 (diff) |
Throwing an Exception in RttiScope.select if no node is found. This is much cleaner.
Diffstat (limited to 'src/core/parser/ParserScope.cpp')
-rw-r--r-- | src/core/parser/ParserScope.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/core/parser/ParserScope.cpp b/src/core/parser/ParserScope.cpp index 4f44a96..1937697 100644 --- a/src/core/parser/ParserScope.cpp +++ b/src/core/parser/ParserScope.cpp @@ -90,7 +90,10 @@ Rooted<Node> ParserScopeBase::select(RttiSet types, int maxDepth) return nodes[i]; } } - return nullptr; + throw LoggableException{ + std::string( + "Expected be inside an element of one of the internal types ") + + Utils::join(types, "\", \"", "\"", "\"")}; } /* Class DeferredResolution */ @@ -352,9 +355,9 @@ bool ParserScope::resolveValue(Variant &data, Handle<Type> type, return Type::MagicCallbackResult::NOT_FOUND; } - // Check whether the inner type of the constant is correct - Type::MagicCallbackResult res = Type::MagicCallbackResult::FOUND_VALID; + Type::MagicCallbackResult res = + Type::MagicCallbackResult::FOUND_VALID; Rooted<Type> constantType = constant->getType(); if (!constantType->checkIsa(innerType)) { logger.error(std::string("Expected value of type \"") + |