static anonymous functions
Summary:
This diff adds parsing for static anonymous functions.
HHVM behavior is pretty loose when parsing modifier lists: it does not check that modifier is already present in the list or enforce any particular order of modifiers i.e. this code is accepted
```lang=php
<?hh
class A {
function f() {
$a = static static static static static static async async function () { $a = 1; };
}
}
```
I was not able to find any docs that will state that multiple appearance of modififers is intentional so it is not supported in this diff. Also [[https://docs.hhvm.com/hack/async/blocks|this page]] states:
>In async functions declared with the function keyword, async immediately precedes function, which in turn immediately precedes the arguments.
Current diff follows behavior mentioned above and assumes that order of modifiers should be `static` `async`.
Reviewed By: oulgen
Differential Revision:
D5372690
fbshipit-source-id:
082539ac5ccd7dc3c382940c17e6c1ec3970e55c