1.1 --- a/translator.py Fri Nov 25 22:02:58 2016 +0100
1.2 +++ b/translator.py Sat Nov 26 00:56:00 2016 +0100
1.3 @@ -938,6 +938,7 @@
1.4 expr = self.process_structure_node(n.node)
1.5 objpath = expr.get_origin()
1.6 target = None
1.7 + function = None
1.8 literal_instantiation = False
1.9
1.10 # Obtain details of the callable.
1.11 @@ -963,6 +964,7 @@
1.12 # Only plain functions and bound methods employ function pointers.
1.13
1.14 elif expr.has_kind("<function>"):
1.15 + function = objpath
1.16
1.17 # Test for functions and methods.
1.18
1.19 @@ -1070,10 +1072,13 @@
1.20
1.21 if target:
1.22 stages.append(target)
1.23 + elif function:
1.24 + stages.append("__load_via_object(&%s, %s).fn" % (
1.25 + encode_path(function), encode_symbol("pos", "__fn__")))
1.26
1.27 # With a known target, the function is obtained directly and called.
1.28
1.29 - if target:
1.30 + if target or function:
1.31 output = "(\n%s\n)(%s)" % (",\n".join(stages), argstr)
1.32
1.33 # With unknown targets, the generic invocation function is applied to