mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-01 03:21:41 +00:00
Make names starting with digits use normal name parsing code
This commit is contained in:
parent
2f4df12b2e
commit
c679565893
@ -37,6 +37,7 @@
|
||||
Bug #6184: Command and Calm and Demoralize and Frenzy and Rally magic effects inconsistencies with vanilla
|
||||
Bug #6197: Infinite Casting Loop
|
||||
Bug #6273: Respawning NPCs rotation is inconsistent
|
||||
Bug #6282: Laura craft doesn't follow the player character
|
||||
Bug #6289: Keyword search in dialogues expected the text to be all ASCII characters
|
||||
Feature #2554: Modifying an object triggers the instances table to scroll to the corresponding record
|
||||
Feature #2780: A way to see current OpenMW version in the console
|
||||
|
@ -164,8 +164,6 @@ namespace Compiler
|
||||
std::string value;
|
||||
c.appendTo(value);
|
||||
|
||||
bool error = false;
|
||||
|
||||
while (get (c))
|
||||
{
|
||||
if (c.isDigit())
|
||||
@ -174,16 +172,11 @@ namespace Compiler
|
||||
}
|
||||
else if (!c.isMinusSign() && isStringCharacter (c))
|
||||
{
|
||||
error = true;
|
||||
c.appendTo(value);
|
||||
/// workaround that allows names to begin with digits
|
||||
return scanName(c, parser, cont, value);
|
||||
}
|
||||
else if (c=='.')
|
||||
{
|
||||
if (error)
|
||||
{
|
||||
putback (c);
|
||||
break;
|
||||
}
|
||||
return scanFloat (value, parser, cont);
|
||||
}
|
||||
else
|
||||
@ -193,17 +186,6 @@ namespace Compiler
|
||||
}
|
||||
}
|
||||
|
||||
if (error)
|
||||
{
|
||||
/// workaround that allows names to begin with digits
|
||||
/// \todo disable
|
||||
TokenLoc loc (mLoc);
|
||||
mLoc.mLiteral.clear();
|
||||
cont = parser.parseName (value, loc, *this);
|
||||
return true;
|
||||
// return false;
|
||||
}
|
||||
|
||||
TokenLoc loc (mLoc);
|
||||
mLoc.mLiteral.clear();
|
||||
|
||||
@ -268,9 +250,8 @@ namespace Compiler
|
||||
nullptr
|
||||
};
|
||||
|
||||
bool Scanner::scanName (MultiChar& c, Parser& parser, bool& cont)
|
||||
bool Scanner::scanName (MultiChar& c, Parser& parser, bool& cont, std::string name)
|
||||
{
|
||||
std::string name;
|
||||
c.appendTo(name);
|
||||
|
||||
if (!scanName (name))
|
||||
|
@ -236,7 +236,7 @@ namespace Compiler
|
||||
|
||||
bool scanFloat (const std::string& intValue, Parser& parser, bool& cont);
|
||||
|
||||
bool scanName (MultiChar& c, Parser& parser, bool& cont);
|
||||
bool scanName (MultiChar& c, Parser& parser, bool& cont, std::string name = {});
|
||||
|
||||
/// \param name May contain the start of the name (one or more characters)
|
||||
bool scanName (std::string& name);
|
||||
|
Loading…
Reference in New Issue
Block a user