#
159b984b |
| 24-Jun-2017 |
Tyson Andre |
Add constructors with parameters for Node (#55) Signature: new Node(kind, flags, children, lineno) Assume that the constructor is either never used with parameters or used very
Add constructors with parameters for Node (#55) Signature: new Node(kind, flags, children, lineno) Assume that the constructor is either never used with parameters or used very frequently (e.g. ast simplifier, code refactoring, php-parser to ast conversion, etc.) Validate the data types of params, but not the values themselves. For backwards compatibility reasons, leave parameters with no passed values as null, and make everything nullable. - Assume no pre-existing code would pass in values. This constructor hasn't been benchmarked yet (compare with assigning params manually). php-parser-to-php-ast (incomplete) is one codebase that could be used to test this, e.g. in a loop. Also, add aliases to simplify setting a Node property to a zend_long. - AST_CACHE_SLOT_FLAGS was missing in one place, this PR added it back. Was the absense deliberate? - TRY_DELREF is unnecessary in some places, and wrong for parameters to the constructor.
show more ...
|