Given an ast that represents a send call, clear and create our generic Call object. Some calls have no chance at resolution (e.g. array[2](param)) so we return nothing instead. :param func_el ast: :rtype: Call|None
(func_el)
| 37 | |
| 38 | |
| 39 | def get_call_from_send_el(func_el): |
| 40 | """ |
| 41 | Given an ast that represents a send call, clear and create our |
| 42 | generic Call object. Some calls have no chance at resolution (e.g. array[2](param)) |
| 43 | so we return nothing instead. |
| 44 | |
| 45 | :param func_el ast: |
| 46 | :rtype: Call|None |
| 47 | """ |
| 48 | owner_el = func_el[1] |
| 49 | token = func_el[2] |
| 50 | owner = resolve_owner(owner_el) |
| 51 | if owner and token == 'new': |
| 52 | # Taking out owner_token for constructors as a little hack to make it work |
| 53 | return Call(token=owner) |
| 54 | return Call(token=token, |
| 55 | owner_token=owner) |
| 56 | |
| 57 | |
| 58 | def walk(tree_el): |
no test coverage detected