Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emulate the way php-ast searches for doc comments for compatibility #11

Open
TysonAndre opened this issue Jul 9, 2017 · 0 comments
Open

Comments

@TysonAndre
Copy link
Owner

Only decls should have doc comments bound to them.

One way to emulate this would be to walk the tree post-order before processing, checking the comments attribute of each node, tracking the most recent doc comment.

  • If a function/method/node/const/property is seen, and doesn't have a doc comment, then add the doc comment. Clear the list of comments tracked so far, and continue traversing.
/** @param int $a */
$x = $y;
$a = function($a) {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant