some cleanup

moveref
Marc Zinnschlag 10 years ago
parent bbbf431ae3
commit ac7c2a1473

@ -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…
Cancel
Save