codegen_style: preparing to parse the whole input file.

This commit is contained in:
John Preston
2016-04-17 12:30:14 +03:00
parent 19f9b56d2c
commit 45bd2dc5fa
13 changed files with 637 additions and 215 deletions
@@ -148,18 +148,18 @@ Type BasicTokenizedFile::uniteLastTokens(Type type) {
}
Type BasicTokenizedFile::readNameOrNumber() {
bool onlyDigits = true;
while (!reader_.atEnd()) {
if (!isDigitChar(reader_.currentChar())) {
onlyDigits = false;
break;
}
reader_.skipChar();
}
bool onlyDigits = true;
while (!reader_.atEnd()) {
if (!isNameChar(reader_.currentChar())) {
break;
}
onlyDigits = false;
reader_.skipChar();
}
return saveToken(onlyDigits ? Type::Int : Type::Name);