summaryrefslogtreecommitdiff
path: root/src/formats/osml/OsmlStreamParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/formats/osml/OsmlStreamParser.cpp')
-rw-r--r--src/formats/osml/OsmlStreamParser.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/formats/osml/OsmlStreamParser.cpp b/src/formats/osml/OsmlStreamParser.cpp
index daf800a..acad57b 100644
--- a/src/formats/osml/OsmlStreamParser.cpp
+++ b/src/formats/osml/OsmlStreamParser.cpp
@@ -441,7 +441,15 @@ Variant OsmlStreamParserImpl::parseIdentifier(size_t start, bool allowNSSep)
// Abort if this character is not a valid identifer character
if ((first && Utils::isIdentifierStartCharacter(c)) ||
(!first && Utils::isIdentifierCharacter(c))) {
- identifier.push_back(c);
+ if (Utils::isIdentifierEndCharacter(c) ||
+ (reader.fetchPeek(c2) && Utils::isIdentifierCharacter(c2))) {
+ identifier.push_back(c);
+ } else {
+ // Break if a non-identifier-end character is reached and the
+ // next character is a non-identifer character
+ reader.resetPeek();
+ break;
+ }
} else if (c == ':' && hasCharSinceNSSep && reader.fetchPeek(c2) &&
Utils::isIdentifierStartCharacter(c2)) {
identifier.push_back(c);