Closed brandonspark closed 2 years ago
I added parsing for patterns which look like methods (with body and without body) that have decorators.
Test plan: @$DECORATOR('...') $NAME(): string parses as
@$DECORATOR('...') $NAME(): string
PartialDef( ({ name=EN( Id(("$NAME", ()), {id_info_id=1; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); })); attrs=[NamedAttr((), Id(("$DECORATOR", ()), {id_info_id=2; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); }), [Arg(L(String(("...", ()))))])]; tparams=[]; }, FuncDef( {fkind=(Method, ()); fparams=[]; frettype=Some({t_attrs=[]; t=TyN( Id(("string", ()), {id_info_id=3; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); })); }); fbody=FBStmt(Block([])); }))))
and
@$DECORATOR $NAME(): string { } parses as
@$DECORATOR $NAME(): string { }
Fld( F( DefStmt( ({ name=EN( Id(("$NAME", ()), {id_info_id=1; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); })); attrs=[NamedAttr((), Id(("$DECORATOR", ()), {id_info_id=2; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); }), [])]; tparams=[]; }, FuncDef( {fkind=(Method, ()); fparams=[]; frettype=Some({t_attrs=[]; t=TyN( Id(("string", ()), {id_info_id=3; id_hidden=false; id_resolved=Ref(None); id_type=Ref(None); id_svalue=Ref(None); })); }); fbody=FBStmt(Block([])); })))))
I added parsing for patterns which look like methods (with body and without body) that have decorators.
Test plan:
@$DECORATOR('...') $NAME(): string
parses asand
@$DECORATOR $NAME(): string { }
parses asSecurity