Skip to content

Commit

Permalink
JavaScript parser: don't set token position information again and again
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
b4n committed Sep 22, 2012
1 parent 772509e commit be45924
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tagmanager/ctags/js.c
Expand Up @@ -370,11 +370,12 @@ static void readToken (tokenInfo *const token)
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;
Expand Down

0 comments on commit be45924

Please sign in to comment.