added const correctness to extract functions in Token

optimizations added in

more elegant solution created for m declaration

ubuntu wants to get rid of 0 <= first statement...so I will

change returnToken to token
This commit is contained in:
RJ Catalano
2016-02-18 11:22:58 -06:00
parent 84f2eb461b
commit d2c0712f36
4 changed files with 50 additions and 113 deletions
+4 -4
View File
@@ -387,8 +387,8 @@ void Scanner::scanToken()
Token::Value token;
// M and N are for the purposes of grabbing different type sizes
unsigned M;
unsigned N;
unsigned m;
unsigned n;
do
{
// Remember the position of the next token
@@ -556,7 +556,7 @@ void Scanner::scanToken()
break;
default:
if (isIdentifierStart(m_char))
tie(token, M, N) = scanIdentifierOrKeyword();
tie(token, m, n) = scanIdentifierOrKeyword();
else if (isDecimalDigit(m_char))
token = scanNumber();
else if (skipWhitespace())
@@ -573,7 +573,7 @@ void Scanner::scanToken()
while (token == Token::Whitespace);
m_nextToken.location.end = sourcePos();
m_nextToken.token = token;
m_nextToken.extendedTokenInfo = make_tuple(M,N);
m_nextToken.extendedTokenInfo = make_tuple(m, n);
}
bool Scanner::scanEscape()