double bug in script name handling workaround (Fixes #1730)

moveref
Marc Zinnschlag 10 years ago
parent 9f6a2d00e8
commit bbbf431ae3

@ -112,6 +112,7 @@ namespace Compiler
scanner.scan (mScriptParser);
mState = EndNameState;
scanner.allowNameStartingwithDigit();
return true;
}

@ -19,6 +19,12 @@ bool Compiler::QuickFileParser::parseName (const std::string& name, const TokenL
bool Compiler::QuickFileParser::parseKeyword (int keyword, const TokenLoc& loc, Scanner& scanner)
{
if (keyword==Scanner::K_begin)
{
scanner.allowNameStartingwithDigit();
return true;
}
if (keyword==Scanner::K_end)
return false;

@ -314,12 +314,10 @@ namespace Compiler
bool Scanner::scanName (char c, std::string& name)
{
bool first = true;
bool error = false;
name.clear();
putback (c);
name += c;
while (get (c))
{
@ -352,13 +350,9 @@ namespace Compiler
putback (c);
break;
}
if (first && (std::isdigit (c) || c=='`' || c=='-'))
error = true;
}
name += c;
first = false;
}
return !error;

Loading…
Cancel
Save