[Orxonox-commit 5612] r10272 - code/trunk/src/libraries/core
landauf at orxonox.net
landauf at orxonox.net
Sun Feb 15 21:37:55 CET 2015
Author: landauf
Date: 2015-02-15 21:37:54 +0100 (Sun, 15 Feb 2015)
New Revision: 10272
Modified:
code/trunk/src/libraries/core/Loader.cc
Log:
reverted a part of the changes from r10264. only single lua-tags between quotes should be filtered, not pairs of tags.
"<?lua" -> filtered
"<?lua code() ?>" -> not filtered
Modified: code/trunk/src/libraries/core/Loader.cc
===================================================================
--- code/trunk/src/libraries/core/Loader.cc 2015-02-14 23:19:13 UTC (rev 10271)
+++ code/trunk/src/libraries/core/Loader.cc 2015-02-15 20:37:54 UTC (rev 10272)
@@ -339,16 +339,26 @@
// erase all tags from the map that are between two quotes
{
std::map<size_t, bool>::iterator it = luaTags.begin();
- while(it != luaTags.end())
+ std::map<size_t, bool>::iterator it2 = it;
+ bool bBetweenQuotes = false;
+ size_t pos = 0;
+ while ((pos = getNextQuote(text, pos)) != std::string::npos)
{
- if (isBetweenQuotes(text, it->first))
+ while ((it != luaTags.end()) && (it->first < pos))
{
- luaTags.erase(it++);
+ if (bBetweenQuotes)
+ {
+ it2++;
+ if (it->second && !(it2->second) && it2->first < pos)
+ it = ++it2;
+ else
+ luaTags.erase(it++);
+ }
+ else
+ ++it;
}
- else
- {
- ++it;
- }
+ bBetweenQuotes = !bBetweenQuotes;
+ pos++;
}
}
More information about the Orxonox-commit
mailing list