mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 11:23:51 +00:00
ignore unterminated empty strings
This commit is contained in:
parent
8779d261ba
commit
8dc081a60d
1 changed files with 9 additions and 0 deletions
|
@ -282,6 +282,8 @@ namespace Compiler
|
||||||
|
|
||||||
if (!scanName (name))
|
if (!scanName (name))
|
||||||
return false;
|
return false;
|
||||||
|
else if(name.empty())
|
||||||
|
return true;
|
||||||
|
|
||||||
TokenLoc loc (mLoc);
|
TokenLoc loc (mLoc);
|
||||||
mLoc.mLiteral.clear();
|
mLoc.mLiteral.clear();
|
||||||
|
@ -366,6 +368,13 @@ 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')
|
||||||
|
{
|
||||||
|
name.clear();
|
||||||
|
mLoc.mLiteral.clear();
|
||||||
|
mErrorHandler.warning ("unterminated empty string", mLoc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = true;
|
error = true;
|
||||||
|
|
Loading…
Reference in a new issue