1.1 --- a/generator.py Tue Jun 29 22:40:43 2021 +0200
1.2 +++ b/generator.py Tue Jun 29 23:57:03 2021 +0200
1.3 @@ -48,7 +48,7 @@
1.4 int_type = "__builtins__.int.int"
1.5 list_type = "__builtins__.list.list"
1.6 none_type = "__builtins__.none.NoneType"
1.7 - string_type = "__builtins__.str.string"
1.8 + string_type = "__builtins__.str.str"
1.9 tuple_type = "__builtins__.tuple.tuple"
1.10 type_type = "__builtins__.core.type"
1.11 unicode_type = "__builtins__.unicode.unicode"
1.12 @@ -1266,7 +1266,7 @@
1.13 # Special-case the integer type.
1.14
1.15 # Here, the __builtins__.int.new_int function is called with the
1.16 - # initialiser's parameter.
1.17 + # initialiser's parameters.
1.18
1.19 if path == self.int_type:
1.20 print >>f_code, """\
1.21 @@ -1278,6 +1278,21 @@
1.22 encode_instantiator_pointer(path),
1.23 )
1.24
1.25 + # Special-case the string types.
1.26 +
1.27 + # Here, the __builtins__.str.new_str function is called with the
1.28 + # initialiser's parameter.
1.29 +
1.30 + elif path == self.string_type:
1.31 + print >>f_code, """\
1.32 +__attr %s(__attr __self, __attr obj)
1.33 +{
1.34 + return __fn___builtins___str_new_str(__NULL, obj);
1.35 +}
1.36 +""" % (
1.37 + encode_instantiator_pointer(path),
1.38 + )
1.39 +
1.40 # Generic instantiation support.
1.41
1.42 else:
1.43 @@ -1350,6 +1365,6 @@
1.44
1.45 return 0;
1.46 }
1.47 -""" % encode_function_pointer("__builtins__.str.str")
1.48 +""" % encode_instantiator_pointer("__builtins__.str.str")
1.49
1.50 # vim: tabstop=4 expandtab shiftwidth=4