From be45924f7c04fcc0f511168b9fdb1c8a2d940a5c Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Sat, 22 Sep 2012 18:13:07 +0200 Subject: [PATCH] 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. --- tagmanager/ctags/js.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tagmanager/ctags/js.c b/tagmanager/ctags/js.c index 66b38898..b4f84b88 100644 --- a/tagmanager/ctags/js.c +++ b/tagmanager/ctags/js.c @@ -370,11 +370,12 @@ getNextChar: 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;