stdlib: refactor StringInterpolation.swift.gyb to use SwiftIntTypes instead of

duplicating it


Swift SVN r21065
This commit is contained in:
Dmitri Hrybenko
2014-08-06 09:17:00 +00:00
parent 06ac06667a
commit 20f74214ca
2 changed files with 20 additions and 14 deletions

View File

@@ -10,19 +10,26 @@
//
//===----------------------------------------------------------------------===//
% Types = []
% for IntSize in [8,16,32,64]:
% Types.append('Int'+str(IntSize))
% for UIntSize in [8,16,32,64]:
% Types.append('UInt'+str(UIntSize))
% for FloatSize in [32,64]:
% Types.append('Float'+str(FloatSize))
% Types.append('String')
% Types.append('Bool')
% Types.append('Int')
% Types.append('UInt')
% Types.append('Character')
% Types.append('UnicodeScalar')
%{
from SwiftIntTypes import *
# Number of bits in the Builtin.Word type
word_bits = int(CMAKE_SIZEOF_VOID_P) * 8
Types = [
'String',
'Bool',
'Character',
'UnicodeScalar',
'Float32',
'Float64'
]
for (name, bits, signed) in all_integer_types(word_bits):
Types.append(int_name(name, signed))
}%
extension String : StringInterpolationConvertible {
% for Type in Types: