[geany/geany] be4592: JavaScript parser: don't set token position information again and again

Colomban Wendling git-noreply at xxxxx
Sat Sep 22 16:13:07 UTC 2012


Branch:      refs/heads/master
Author:      Colomban Wendling <ban at herbesfolles.org>
Committer:   Colomban Wendling <ban at herbesfolles.org>
Date:        Sat, 22 Sep 2012 16:13:07
Commit:      be45924f7c04fcc0f511168b9fdb1c8a2d940a5c
             https://github.com/geany/geany/commit/be45924f7c04fcc0f511168b9fdb1c8a2d940a5c

Log Message:
-----------
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.


Modified Paths:
--------------
    tagmanager/ctags/js.c

Modified: tagmanager/ctags/js.c
5 files changed, 3 insertions(+), 2 deletions(-)
===================================================================
@@ -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;



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: TBD).



More information about the Commits mailing list