Nikita Popov
Nikita Popov
@davidmpaz The reason why I wouldn't separate visibility and other modifiers is that they are not ordered. I.e. both `public static` and `static public` are valid. It doesn't really matter...
The first case is implemented in https://github.com/nikic/PHP-Parser/commit/01e85a26c663acb20472bb5cf17ae39743da338a. The variable will be an `Expr\Error` in this case. Also works for `...` and `&`, though I guess those are not important in...
@Gert-dev I've pushed https://github.com/nikic/PHP-Parser/commit/7b201b63d2cef4ec795d52044a31d20e79e871fb which makes the `function (Test)` case work. As code editors usually insert `()` pairs, this will probably handle the common cases.
Regarding the null statement, the problem is the first `;` in front of `;null;` -- The comments will be associated with the `;` statement, which is not represented in the...
So, here is how I would go about your particular case: In the lexer, [enable token end positions](https://github.com/nikic/PHP-Parser/blob/1.x/doc/component/Lexer.markdown#lexer-options). Get the tokens from the current file via `$lexer->getTokens()`. Now you should...
@mindplay-dk If [formatting-preservation](https://github.com/nikic/PHP-Parser/blob/master/doc/component/Pretty_printing.markdown#formatting-preserving-pretty-printing) is enabled, then comments will be kept without modification, yes. The representation of the comments in the AST has stayed the same though.
To add a use node outside a namespace you need to add it to the top-level $stmts array. Not sure where the assertion failure above comes from, but I suspect...
The problem here is probably in the JSON encoding. JSON only allows valid UTF-8 in strings, and `\x7f` is not a valid UTF-8 sequence.
Nope. Any suggestions on what to do about this?
> Before converting ast to json, iterate through all nodes and encode the variable containing the illegal utf-8 string using base64_encode. That sounds reasonable. We can add two extra visitors...