pfff: accept isset(f()[0])

Summary:
This is a quick parsing error fix.
The right thing(TM), which is to rewrite and simplify how we parse lvalues
would take far more time.

Test Plan:
unit test included
$ make test
no regression

$ ./pfff -parse_php ~/www/flib/feed/display/data/BaseStoryData.php
OK

Reviewers: pieter, jakubv, julienv, amenghra

Reviewed By: amenghra

Differential Revision: https://phabricator.fb.com/D617229

Task ID: 1852187
pfff: handle more complex kind of HPHP attributes

Summary:
Aran needs that. This just extend the grammar (not sure
we actually have right now any attribute more complex than
__MOCK. anyway.

The following patch will extend the AST in pfff.

Test Plan:
unit test included
$ make test

Reviewers: julienv, pieter, amenghra, adonohue, andrewparoski, michalburger1

Reviewed By: amenghra

CC: ps

Differential Revision: https://phabricator.fb.com/D618375
* commons/ocaml.ml: fix
pfff: add HPHP attributes in ast_php.ml

Test Plan:
$ ~/pfff/pfff -dump_php attributes.php
[ClassDef(
   {c_type=ClassFinal(i_1, i_2); c_name=Name(("A", i_3)); c_extends=None;
    c_implements=None; c_attrs=None;
    c_body=(i_4,
            [Method(
               {f_tok=i_5; f_type=MethodRegular; f_attrs=None;
                f_modifiers=[(Final, i_6); (Public, i_7)]; f_ref=None;
                f_name=Name(("foo", i_8)); f_params=(i_9, [], i_10);
                f_return_type=None; f_body=(i_11, [], i_12); })],
            i_13);
    });
 ClassDef(
   {c_type=ClassRegular(i_14); c_name=Name(("MockD", i_15));
    c_extends=Some((i_16, Name(("A", i_17)))); c_implements=None;
    c_attrs=Some((i_18, [Left(Attribute(("__MockClass", i_19)))], i_20));
    c_body=(i_21,
            [Method(
               {f_tok=i_22; f_type=MethodRegular; f_attrs=None;
                f_modifiers=[(Public, i_23)]; f_ref=None;
                f_name=Name(("foo", i_24)); f_params=(i_25, [], i_26);
                f_return_type=None; f_body=(i_27, [], i_28); })],
            i_29);
    });
 FuncDef(
   {f_tok=i_30; f_type=FunctionRegular;
    f_attrs=Some((i_31, [Left(Attribute(("__attribute", i_32)))], i_33));
    f_modifiers=[]; f_ref=None; f_name=Name(("foo", i_34));
    f_params=(i_35, [], i_36); f_return_type=None; f_body=(i_37, [], i_38); });
 FuncDef(
   {f_tok=i_39; f_type=FunctionRegular;
    f_attrs=Some((i_40,
                  [Left(Attribute(("Foo", i_41))); Right(i_42);
                   Left(AttributeWithArgs(("Bar", i_43), (i_44, [], i_45)));
                   Right(i_46);
                   Left(
                     AttributeWithArgs(("Baz", i_47),
                       (i_48,
                        [Left(Sc(C(String(("hello", i_49))))); Right(i_50);
                         Left(
                           ArrayLong(i_51,
                             (i_52,
                              [Left(ArrayExpr(Sc(C(Int(("1", i_53))))));
                               Right(i_54);
                               Left(ArrayExpr(Sc(C(Int(("2", i_55))))))],
                              i_56)))],
                        i_57)))],
                  i_58));
    f_modifiers=[]; f_ref=None; f_name=Name(("f", i_59));
    f_params=(i_60, [], i_61); f_return_type=None; f_body=(i_62, [], i_63); });
 FinalDef(i_64)]

look at the c_attrs and f_attrs above.

Reviewers: julienv, pieter, amenghra, adonohue, andrewparoski, michalburger1

Reviewed By: pieter

CC: jakubv, ps

Differential Revision: https://phabricator.fb.com/D618474
* lang_php/parsing/visitor_php.ml: CEs
pfff: support for HPHP attributes in ast_php_simple

Test Plan:
$ make
$ ~/pfff/pfff -dump_php_simple attributes.php
[ClassDef(
   {c_name="A"; c_kind=ClassFinal; c_extends=None; c_implements=[];
    c_attrs=[]; c_constants=[]; c_variables=[];
    c_body=[{f_name="foo"; f_kind=Method; f_params=[]; f_ref=false;
             f_return_type=None; m_modifiers=[Final; Public]; l_uses=[
             ]; f_attrs=[]; f_body=[]; }];
    });
 ClassDef(
   {c_name="MockD"; c_kind=ClassRegular; c_extends=Some("A");
    c_implements=[]; c_attrs=[Id("__MockClass")]; c_constants=[];
    c_variables=[];
    c_body=[{f_name="foo"; f_kind=Method; f_params=[]; f_ref=false;
             f_return_type=None; m_modifiers=[Public]; l_uses=[]; f_attrs=[
             ]; f_body=[]; }];
    });
 FuncDef(
   {f_name="foo"; f_kind=Function; f_params=[]; f_ref=false;
    f_return_type=None; m_modifiers=[]; l_uses=[];
    f_attrs=[Id("__attribute")]; f_body=[]; });
 FuncDef(
   {f_name="f"; f_kind=Function; f_params=[]; f_ref=false;
    f_return_type=None; m_modifiers=[]; l_uses=[];
    f_attrs=[Id("Foo"); Call(Id("Bar"), []);
             Call(Id("Baz"),
               [String("hello"); ConsArray([Aval(Int("1")); Aval(Int("2"))])])];
    f_body=[]; })]

Reviewers: julienv, pieter, amenghra, adonohue, andrewparoski, michalburger1

Reviewed By: amenghra

CC: ps

Differential Revision: https://phabricator.fb.com/D618549
Merge branch 'pfff_attributes_part2'
* lang_c/analyze/ast_c_simple.ml: comment