forked from mirror/openmw-tes3mp
some cleanup
This commit is contained in:
parent
bbbf431ae3
commit
ac7c2a1473
2 changed files with 8 additions and 6 deletions
|
@ -270,8 +270,9 @@ namespace Compiler
|
|||
bool Scanner::scanName (char c, Parser& parser, bool& cont)
|
||||
{
|
||||
std::string name;
|
||||
name += c;
|
||||
|
||||
if (!scanName (c, name))
|
||||
if (!scanName (name))
|
||||
return false;
|
||||
|
||||
TokenLoc loc (mLoc);
|
||||
|
@ -312,13 +313,11 @@ namespace Compiler
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Scanner::scanName (char c, std::string& name)
|
||||
bool Scanner::scanName (std::string& name)
|
||||
{
|
||||
char c;
|
||||
bool error = false;
|
||||
|
||||
name.clear();
|
||||
name += c;
|
||||
|
||||
while (get (c))
|
||||
{
|
||||
if (!name.empty() && name[0]=='"')
|
||||
|
@ -333,12 +332,14 @@ namespace Compiler
|
|||
// {
|
||||
// if (!get (c))
|
||||
// {
|
||||
// error = true;
|
||||
// mErrorHandler.error ("incomplete escape sequence", mLoc);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
else if (c=='\n')
|
||||
{
|
||||
error = true;
|
||||
mErrorHandler.error ("incomplete string or name", mLoc);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -89,7 +89,8 @@ namespace Compiler
|
|||
|
||||
bool scanName (char c, Parser& parser, bool& cont);
|
||||
|
||||
bool scanName (char c, std::string& name);
|
||||
/// \param name May contain the start of the name (one or more characters)
|
||||
bool scanName (std::string& name);
|
||||
|
||||
bool scanSpecial (char c, Parser& parser, bool& cont);
|
||||
|
||||
|
|
Loading…
Reference in a new issue