Branch: refs/heads/master Author: Colomban Wendling ban@herbesfolles.org Committer: Colomban Wendling ban@herbesfolles.org Date: Mon, 15 Apr 2013 16:53:59 UTC Commit: 1c3fd55818e55e35e214ef0feb043e3782c155f5 https://github.com/geany/geany/commit/1c3fd55818e55e35e214ef0feb043e3782c155...
Log Message: ----------- PHP: fix generating variable tags for rvalues
Only generate tags for variable declarations without assignments inside classes and interfaces not to get fooled by rvalues.
This prevents generation of a "$bar" tag for something like:
$foo = $bar;
while still generating "$bar" tag for:
class Foo { var $bar; }
Modified Paths: -------------- tagmanager/ctags/php.c
Modified: tagmanager/ctags/php.c 10 files changed, 9 insertions(+), 1 deletions(-) =================================================================== @@ -909,7 +909,15 @@ static boolean parseVariable (tokenInfo *const token) } } else if (token->type == TOKEN_SEMICOLON) - makeSimplePhpTag (name, K_VARIABLE, access); + { + /* generate tags for variable declarations in classes + * class Foo { + * protected $foo; + * } + * but don't get fooled by stuff like $foo = $bar; */ + if (token->parentKind == K_CLASS || token->parentKind == K_INTERFACE) + makeSimplePhpTag (name, K_VARIABLE, access); + } else readNext = FALSE;
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).