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
F13197361: D10121.diff
Mon, May 13, 12:07 AM
F13178682: D10121.diff
Wed, May 8, 8:35 PM
Unknown Object (File)
Mon, May 6, 7:22 AM
Unknown Object (File)
Sat, May 4, 3:22 AM
Unknown Object (File)
Thu, May 2, 9:31 AM
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
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
Branch
tokens
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 2001
Build 2002: [Placeholder Plan] Wait for 30 Seconds

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