Nikita Popov
Nikita Popov
Test failures are legitimate.
The change to trimming is fine -- to verify, I've landed it separately as https://github.com/nikic/PHP-Parser/commit/1f504d2c7da6020d56144cdb8443a3ba681f6183. This was a leftover from an older implementation, when comments were expected to have a...
@TomasVotruba PHP-Yacc is for generating parsers, I think this issue is more about generation of PHP code, though I'm not sure what exactly is being suggested. This library used to...
@tleb I guess the idea here is to tell the parser to generate `MyVariable` objects instead of normal `Variable` objects for `$var` nodes (and similarly allow changing the object type...
> If this file uses Mac-style line separator "\r", the comment will not be prettied very well. Is this a situation you encountered in real code, or just an academic...
Also, while we're at it, `Scalar\Encapsed` is not a scalar either, it should be `Expr`. `Scalar\MagicConst` is borderline.
And it would probably be good to rename some node types to be more obvious to people not familiar with ext/tokenizer lingo. E.g. `Encapsed` should be `InterpolatedString`, `DNumber` should be...
Planned renames are done. Though I also wonder whether it might make sense to drop the `Scalar` category and merge it into `Expr`. Not sure the distinction provides any real...
Attributes date back from sometime around the start of this project. At that time nodes extended `ArrayObject` in property mode and everything on that ArrayObject was considered a subnode. This...
Draft implementation: https://github.com/nikic/PHP-Parser/compare/attributes Note that this keeps the backing `$attributes` property and uses `__get/__set` to handle access, for two reasons: Firstly, we operate on the full array in some places,...