Skip to content

Commit

Permalink
PHP: fix generating variable tags for rvalues
Browse files Browse the repository at this point in the history
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;
	}
  • Loading branch information
b4n committed Apr 12, 2013
1 parent 6e5f70a commit ed32142
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion php.c
Expand Up @@ -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;

Expand Down

0 comments on commit ed32142

Please sign in to comment.