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
Unknown Object (File)
Thu, Apr 25, 3:19 AM
Unknown Object (File)
Thu, Apr 18, 9:04 AM
Unknown Object (File)
Wed, Apr 17, 8:39 PM
Unknown Object (File)
Sat, Apr 6, 7:42 PM
Unknown Object (File)
Mar 29 2024, 7:18 PM
Unknown Object (File)
Mar 29 2024, 5:03 PM
Unknown Object (File)
Mar 19 2024, 5:54 AM
Unknown Object (File)
Feb 27 2024, 1:41 PM
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