From ed3214294dab8504c83ab90d177ad2c42eb0dd23 Mon Sep 17 00:00:00 2001 From: Colomban Wendling Date: Tue, 9 Apr 2013 22:57:07 +0200 Subject: [PATCH] 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; } --- php.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/php.c b/php.c index ebe6ab3..b37749a 100644 --- a/php.c +++ b/php.c @@ -902,7 +902,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;