JavaScript parser: don't set token position information again and again

There is no need to set the token position information in the loop
searching for the initial token character, simply do that when we
finally found the token start.
This commit is contained in:
Colomban Wendling 2012-09-22 18:13:07 +02:00
parent 772509e898
commit be45924f7c

View File

@ -370,11 +370,12 @@ getNextChar:
do do
{ {
c = fileGetc (); c = fileGetc ();
token->lineNumber = getSourceLineNumber ();
token->filePosition = getInputFilePosition ();
} }
while (c == '\t' || c == ' ' || c == '\n'); while (c == '\t' || c == ' ' || c == '\n');
token->lineNumber = getSourceLineNumber ();
token->filePosition = getInputFilePosition ();
switch (c) switch (c)
{ {
case EOF: longjmp (Exception, (int)ExceptionEOF); break; case EOF: longjmp (Exception, (int)ExceptionEOF); break;