Nikita Popov

Results 517 comments of Nikita Popov

By the way, the reason that some names are Node_Name and others are just strings is that some names can be namespaced and others can't. For example when calling a...

@felixfbecker Can you please open a separate issue for this?

The parser only collects comments before a node -- as the attributes are considered part of the class, the doc comment ends up being "inside" the class, and thus lost....

Thanks for bringing this up, I have also been wondering about this. I think the main issue is that we may end up generating stubs even though nothing changed --...

Probably something like this can be made based on reflection. Constructor argument names should match subnodes names and it should be possible to generate code based on that.

@flip111 `Class_::$name` is a subnode. `Break_::$num` is a subnode. With reflection, the property `Class_::$name` can be associated with the `$name` argument of the constructor. For `Class_` in particular there is...

@flip111 By subnodes I mean anything returned here: https://github.com/nikic/PHP-Parser/blob/master/lib/PhpParser/Node/Stmt/Class_.php#L47 All subnodes are public properties of the class.

To clarify, this works fine with the normal pretty printer, but the comment gets duplicated if formatting preservation is enabled. The dump looks like this: ``` array( 0: Stmt_Function[3:1 -...

Fixed by https://github.com/nikic/PHP-Parser/commit/9b46dffb12c6c83d33b993ae81b9a2895293dee8.

I don't really understand what you mean by "node address" and how it differs from the node itself.