Adds AASTNode::$previousSibling and AASTNode::$nextSibling properties. The primary use case is for writing a custom linter rule.
Details
Details
- Reviewers
epriestley - Group Reviewers
Blessed Reviewers - Commits
- rPHU23edd1b1f443: Add previous and next sibling pointers to `AASTNode`
Tested in my custom linter rule.
Diff Detail
Diff Detail
- Repository
- rPHU libphutil
- Branch
- master
- Lint
Lint Passed Severity Location Code Message Advice src/parser/xhpast/api/XHPASTNode.php:245 XHP55 Unnecessary `final` Modifier - Unit
Tests Passed - Build Status
Buildable 8879 Build 10389: Run Core Tests Build 10388: arc lint + arc unit
Event Timeline
Comment Actions
Does this affect the time required to construct a large tree? I recall buildTree() being expensive in the past.
Comment Actions
It doesn't seem like it does... Using the following script as a benchmark:
(The library map from rP is the largest PHP source file that I could easily find at 656K or 8158 lines)
Before
Average: 2.281007s Total: 22.810069s
After
Average: 2.041991s Total: 20.419912s