summaryrefslogtreecommitdiff
path: root/src/core/common/Utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/common/Utils.cpp')
-rw-r--r--src/core/common/Utils.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/core/common/Utils.cpp b/src/core/common/Utils.cpp
index 67920c2..f665db5 100644
--- a/src/core/common/Utils.cpp
+++ b/src/core/common/Utils.cpp
@@ -47,16 +47,18 @@ bool Utils::isIdentifierOrEmpty(const std::string &name)
bool Utils::isNamespacedIdentifier(const std::string &name)
{
bool first = true;
- for (char c : name) {
+ for (size_t i = 0; i < name.size(); i++) {
+ const char c = name[i];
if (first && !isIdentifierStartCharacter(c)) {
return false;
}
- if (!first && (!isIdentifierCharacter(c) && c != ':')) {
+ if (!first && (!(isIdentifierCharacter(c) || c == ':') ||
+ (c == ':' && !isIdentifierEndCharacter(name[i - 1])))) {
return false;
}
first = (c == ':');
}
- return !first;
+ return !first && isIdentifierEndCharacter(name.back());
}
bool Utils::hasNonWhitepaceChar(const std::string &s)