Skip to content

Commit 14f070a

Browse files
Firehedepriestley
authored and
epriestley
committedJan 24, 2014
Skip anon functions in symbol generation script
Summary: Filters closures out of symbol generator script, per @epriestley's comment in T4334 Test Plan: Before: eric@eric-dev ~/phabricator/scripts/symbols: echo 'closure.php' | ./generate_php_symbols.php function php /closure.php d function php 10 /closure.php function php /closure.php a class php 3 /closure.php a b method php 4 /closure.php After: eric@eric-dev ~/phabricator/scripts/symbols: echo 'closure.php' | ./generate_php_symbols.php d function php 10 /closure.php a class php 3 /closure.php a b method php 4 /closure.php eric@eric-dev ~/phabricator/scripts/symbols: cat closure.php <?php class a { function b() { $c = function() { return 1; }; $c(); } } function d() { return 2; } $e = function() { return 3; }; Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley CC: epriestley, Korvin, aran Differential Revision: https://secure.phabricator.com/D8054
1 parent febc494 commit 14f070a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed
 

‎scripts/symbols/generate_php_symbols.php

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
$functions = $root->selectDescendantsOfType('n_FUNCTION_DECLARATION');
3535
foreach ($functions as $function) {
3636
$name = $function->getChildByIndex(2);
37+
// Skip anonymous functions
38+
if (!$name->getConcreteString()) {
39+
continue;
40+
}
3741
print_symbol($file, 'function', $name);
3842
}
3943

0 commit comments

Comments
 (0)
Failed to load comments.