From 412afadbc3b90285242d784d729e91e82d7bde93 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 2 Mar 2013 15:52:55 +0000 Subject: [PATCH] Make gen_my_std.h.py compatible with python 2.5 too. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@176409 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../UseAuto/Inputs/gen_my_std.h.py | 46 +++++++++---------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/test/cpp11-migrate/UseAuto/Inputs/gen_my_std.h.py b/test/cpp11-migrate/UseAuto/Inputs/gen_my_std.h.py index 3f8be58..cf6eaa9 100644 --- a/test/cpp11-migrate/UseAuto/Inputs/gen_my_std.h.py +++ b/test/cpp11-migrate/UseAuto/Inputs/gen_my_std.h.py @@ -77,8 +77,8 @@ def outputClassDef(Definition, ClassName, Import): if Import: print """ -}} // namespace _1 -using _1::{0};""".format(ClassName) +} // namespace _1 +using _1::%s;""" % ClassName # Output preamble and common functionality @@ -142,46 +142,46 @@ namespace std {""".lstrip() # Take off leading newline for c in typedef_containers: Definition = """ template -class {0} {{ +class %(0)s { public: typedef T value_type; - typedef typename internal::iterator_wrapper<{0}, 0> iterator; - typedef typename internal::iterator_wrapper<{0}, 1> const_iterator; - typedef typename internal::iterator_wrapper<{0}, 3> reverse_iterator; - typedef typename internal::iterator_wrapper<{0}, 2> const_reverse_iterator; + typedef typename internal::iterator_wrapper<%(0)s, 0> iterator; + typedef typename internal::iterator_wrapper<%(0)s, 1> const_iterator; + typedef typename internal::iterator_wrapper<%(0)s, 3> reverse_iterator; + typedef typename internal::iterator_wrapper<%(0)s, 2> const_reverse_iterator; - {0}() {{}} - {1}}};""".format(c['name'], iterator_generators) + %(0)s() {} + %(1)s};""" % {'0': c['name'], '1': iterator_generators} outputClassDef(Definition, c['name'], c['using']) for c in subclass_containers: Definition = """ template -class {0} {{ +class %(0)s { public: - class iterator {{}}; - class const_iterator {{}}; - class reverse_iterator {{}}; - class const_reverse_iterator {{}}; + class iterator {}; + class const_iterator {}; + class reverse_iterator {}; + class const_reverse_iterator {}; - {0}() {{}} - {1}}};""".format(c['name'], iterator_generators) + %(0)s() {} + %(1)s};""" % {'0': c['name'], '1': iterator_generators} outputClassDef(Definition, c['name'], c['using']) for c in using_containers: Definition = """ template -class {0} : internal::iterator_provider<{0} > {{ +class %(0)s : internal::iterator_provider<%(0)s > { public: - using typename internal::iterator_provider<{0} >::iterator; - using typename internal::iterator_provider<{0} >::const_iterator; - using typename internal::iterator_provider<{0} >::reverse_iterator; - using typename internal::iterator_provider<{0} >::const_reverse_iterator; + using typename internal::iterator_provider<%(0)s >::iterator; + using typename internal::iterator_provider<%(0)s >::const_iterator; + using typename internal::iterator_provider<%(0)s >::reverse_iterator; + using typename internal::iterator_provider<%(0)s >::const_reverse_iterator; - {0}() {{}} - {1}}};""".format(c['name'], iterator_generators) + %(0)s() {} + %(1)s};""" % {'0': c['name'], '1': iterator_generators} outputClassDef(Definition, c['name'], c['using'])