Page MenuHomePhabricator

Add a `selectTokensOfTypes` method to the `AASTNode` class
ClosedPublic

Authored by joshuaspence on Aug 2 2014, 9:08 AM.
Tags
None
Referenced Files
F15443317: D10121.id24346.diff
Thu, Mar 27, 3:41 AM
F15441642: D10121.id24343.diff
Wed, Mar 26, 7:04 PM
F15439087: D10121.id.diff
Wed, Mar 26, 5:41 AM
F15438284: D10121.diff
Tue, Mar 25, 11:58 PM
F15411000: D10121.diff
Wed, Mar 19, 8:46 AM
Unknown Object (File)
Feb 16 2025, 4:22 PM
Unknown Object (File)
Feb 11 2025, 7:43 PM
Unknown Object (File)
Feb 9 2025, 7:45 AM
Subscribers

Details

Summary

Add a selectTokensOfTypes class which allows multiple token types to be extracted from an AASTNode.

Test Plan

This will make more sense in my next diff.

Diff Detail

Repository
rPHU libphutil
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

joshuaspence retitled this revision from to Add a `selectTokensOfTypes` method to the `AASTNode` class.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
epriestley added inline comments.
src/parser/aast/api/AASTNode.php
145

Avoid array_merge() in a loop. Probably easiest here to just iterate over the results explicitly rather than trying to array_mergev() later on.

https://secure.phabricator.com/book/phabflavor/article/php_pitfalls/#array-merge-in-incredibl

This revision is now accepted and ready to land.Aug 2 2014, 9:13 AM
joshuaspence edited edge metadata.
  • Don't use array_merge inside a loop