summaryrefslogtreecommitdiff
path: root/src/formats/osml/OsmlStreamParser.cpp
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-04-03 22:24:35 +0200
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2016-04-25 22:19:31 +0200
commit3899cd3c8fb3eccb73a43208e90d88cfcc64c41c (patch)
tree3731ca07606dbab40616de45a417ba44865f5ce7 /src/formats/osml/OsmlStreamParser.cpp
parent04ca3af777a18ba9148110500d3d9ad3f6210895 (diff)
Identifiers may not end with an underscore
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);