Lichen

Changeset

1058:5c82d4e83af9
5 months ago Paul Boddie raw files shortlog changelog graph Merged changes from the value-replacement branch. value-replacement-generic
translator.py (file)
     1.1 --- a/translator.py	Sat May 25 15:52:31 2024 +0200
     1.2 +++ b/translator.py	Sat May 25 17:56:19 2024 +0200
     1.3 @@ -1151,7 +1151,7 @@
     1.4          # Literals may be instantiated specially.
     1.5  
     1.6          if expr.is_name() and expr.name.startswith("$L") and objpath:
     1.7 -            instantiation = literal_instantiation = objpath
     1.8 +            instantiation = literal_instantiation = expr
     1.9              target = encode_literal_instantiator(objpath)
    1.10              context_required = False
    1.11  
    1.12 @@ -1166,7 +1166,7 @@
    1.13              # Class invocation involves instantiators.
    1.14  
    1.15              if expr.has_kind("<class>"):
    1.16 -                instantiation = objpath
    1.17 +                instantiation = expr
    1.18                  target = encode_instantiator_pointer(objpath)
    1.19                  init_ref = self.importer.all_class_attrs[objpath]["__init__"]
    1.20                  target_structure = "&%s" % encode_path(init_ref)