diff options
author | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-29 03:24:23 +0100 |
---|---|---|
committer | Andreas Stöckel <astoecke@techfak.uni-bielefeld.de> | 2015-01-29 03:24:23 +0100 |
commit | cf493215beb33c427a0687d56b1e18d8e6f85586 (patch) | |
tree | 55f9926152d31024ab00c24bfb49fe02c98628b5 /src/core | |
parent | c2f21f12b9e8d99fd2018f9cdf44fdf78261af33 (diff) |
Improved error message
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/model/Node.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/model/Node.cpp b/src/core/model/Node.cpp index 366dcc6..6c00e89 100644 --- a/src/core/model/Node.cpp +++ b/src/core/model/Node.cpp @@ -418,17 +418,22 @@ bool Node::validateIsAcyclic(const std::string &name, this); logger.note("The following nodes are included in the cycle: ", SourceLocation{}, MessageMode::NO_CONTEXT); - for (const Node *node : path) { + for (size_t i = 0; i < path.size(); i++) { + auto node = path[i]; const std::string &name = node->getName(); const std::string &typeName = node->type().name; + const std::string suffix = + i == path.size() - 1 + ? std::string{" (this node closes the cycle):"} + : std::string{":"}; if (name.empty()) { logger.note(std::string("Node of internal type ") + typeName + - std::string(" declared here:"), + std::string(" declared here") + suffix, node); } else { logger.note(std::string("Node \"") + name + std::string("\" of internal type ") + typeName + - std::string(" declared here:"), + std::string(" declared here") + suffix, node); } } |