1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 07:23:51 +00:00

ignore final whitespace/comments

This commit is contained in:
Evil Eye 2020-03-29 22:29:22 +02:00
parent fea7e68fe9
commit e07fa37fa3
2 changed files with 21 additions and 7 deletions

View file

@ -207,6 +207,7 @@
Bug #5300: NPCs don't switch from torch to shield when starting combat Bug #5300: NPCs don't switch from torch to shield when starting combat
Bug #5308: World map copying makes save loading much slower Bug #5308: World map copying makes save loading much slower
Bug #5313: Node properties of identical type are not applied in the correct order Bug #5313: Node properties of identical type are not applied in the correct order
Bug #5345: Dopey Necromancy does not work due to a missing quote
Feature #1774: Handle AvoidNode Feature #1774: Handle AvoidNode
Feature #2229: Improve pathfinding AI Feature #2229: Improve pathfinding AI
Feature #3025: Analogue gamepad movement controls Feature #3025: Analogue gamepad movement controls

View file

@ -368,15 +368,28 @@ namespace Compiler
{ {
if (mIgnoreNewline) if (mIgnoreNewline)
mErrorHandler.warning ("string contains newline character, make sure that it is intended", mLoc); mErrorHandler.warning ("string contains newline character, make sure that it is intended", mLoc);
else if (name.size() == 1 || (name.size() == 2 && name[1] == '\r')) else
{
bool allWhitespace = true;
for (size_t i = 1; i < name.size(); i++)
{
//ignore comments
if (name[i] == ';')
break;
else if (name[i] != '\t' && name[i] != ' ' && name[i] != '\r')
{
allWhitespace = false;
break;
}
}
if (allWhitespace)
{ {
name.clear(); name.clear();
mLoc.mLiteral.clear(); mLoc.mLiteral.clear();
mErrorHandler.warning ("unterminated empty string", mLoc); mErrorHandler.warning ("unterminated empty string", mLoc);
break; return true;
} }
else
{
error = true; error = true;
mErrorHandler.error ("incomplete string or name", mLoc); mErrorHandler.error ("incomplete string or name", mLoc);
break; break;