Permalink
Browse files

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.
  • Loading branch information...
1 parent 772509e commit be45924f7c04fcc0f511168b9fdb1c8a2d940a5c @b4n b4n committed Sep 22, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 tagmanager/ctags/js.c
View
5 tagmanager/ctags/js.c
@@ -370,11 +370,12 @@ static void readToken (tokenInfo *const token)
do
{
c = fileGetc ();
- token->lineNumber = getSourceLineNumber ();
- token->filePosition = getInputFilePosition ();
}
while (c == '\t' || c == ' ' || c == '\n');
+ token->lineNumber = getSourceLineNumber ();
+ token->filePosition = getInputFilePosition ();
+
switch (c)
{
case EOF: longjmp (Exception, (int)ExceptionEOF); break;

0 comments on commit be45924

Please sign in to comment.