|
|
d750885 |
diff -Naur swift-orig/stdlib/public/core/FloatingPointTypes.swift.gyb swift/stdlib/public/core/FloatingPointTypes.swift.gyb
|
|
|
d750885 |
--- swift-orig/stdlib/public/core/FloatingPointTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/stdlib/public/core/FloatingPointTypes.swift.gyb 2019-07-22 11:22:17.049551459 -0500
|
|
|
d750885 |
@@ -13,8 +13,8 @@
|
|
|
d750885 |
import SwiftShims
|
|
|
d750885 |
|
|
|
d750885 |
%{
|
|
|
d750885 |
-from SwiftIntTypes import all_integer_types
|
|
|
d750885 |
-from SwiftFloatingPointTypes import all_floating_point_types
|
|
|
d750885 |
+import SwiftIntTypes
|
|
|
d750885 |
+import SwiftFloatingPointTypes
|
|
|
d750885 |
|
|
|
d750885 |
#
|
|
|
d750885 |
# Utility code for later in this template
|
|
|
d750885 |
@@ -27,7 +27,7 @@
|
|
|
d750885 |
builtinIntLiteralBits = 2048
|
|
|
d750885 |
}%
|
|
|
d750885 |
|
|
|
d750885 |
-% for self_type in all_floating_point_types():
|
|
|
d750885 |
+% for self_type in SwiftFloatingPointTypes.all_floating_point_types():
|
|
|
d750885 |
%{
|
|
|
d750885 |
Self = self_type.stdlib_name
|
|
|
d750885 |
bits = self_type.bits
|
|
|
d750885 |
@@ -1650,7 +1650,7 @@
|
|
|
d750885 |
}
|
|
|
d750885 |
}
|
|
|
d750885 |
|
|
|
d750885 |
-% for src_type in all_floating_point_types():
|
|
|
d750885 |
+% for src_type in SwiftFloatingPointTypes.all_floating_point_types():
|
|
|
d750885 |
% srcBits = src_type.bits
|
|
|
d750885 |
% That = src_type.stdlib_name
|
|
|
d750885 |
|
|
|
d750885 |
diff -Naur swift-orig/stdlib/public/core/IntegerTypes.swift.gyb swift/stdlib/public/core/IntegerTypes.swift.gyb
|
|
|
d750885 |
--- swift-orig/stdlib/public/core/IntegerTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/stdlib/public/core/IntegerTypes.swift.gyb 2019-07-22 15:30:40.491317722 -0500
|
|
|
d750885 |
@@ -14,10 +14,9 @@
|
|
|
d750885 |
# Utility code for later in this template
|
|
|
d750885 |
#
|
|
|
d750885 |
|
|
|
d750885 |
-from SwiftIntTypes import all_integer_types, int_max_bits, should_define_truncating_bit_pattern_init
|
|
|
d750885 |
-from SwiftFloatingPointTypes import getFtoIBounds
|
|
|
d750885 |
+import SwiftIntTypes
|
|
|
d750885 |
+import SwiftFloatingPointTypes
|
|
|
d750885 |
|
|
|
d750885 |
-from string import maketrans, capitalize
|
|
|
d750885 |
from itertools import chain
|
|
|
d750885 |
|
|
|
d750885 |
# Number of bits in the Builtin.Word type
|
|
|
d750885 |
@@ -1064,7 +1063,7 @@
|
|
|
d750885 |
//===--- Concrete FixedWidthIntegers --------------------------------------===//
|
|
|
d750885 |
//===----------------------------------------------------------------------===//
|
|
|
d750885 |
|
|
|
d750885 |
-% for self_type in all_integer_types(word_bits):
|
|
|
d750885 |
+% for self_type in SwiftIntTypes.all_integer_types(word_bits):
|
|
|
d750885 |
% bits = self_type.bits
|
|
|
d750885 |
% signed = self_type.is_signed
|
|
|
d750885 |
% BuiltinName = self_type.builtin_name
|
|
|
d750885 |
@@ -1125,7 +1124,7 @@
|
|
|
d750885 |
|
|
|
d750885 |
% for (FloatType, FloatBits) in [
|
|
|
d750885 |
% ('Float', 32), ('Double', 64), ('Float80', 80)]:
|
|
|
d750885 |
-% (lower, upper) = getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed)
|
|
|
d750885 |
+% (lower, upper) = SwiftFloatingPointTypes.getFtoIBounds(floatBits=FloatBits, intBits=int(bits), signed=signed)
|
|
|
d750885 |
|
|
|
d750885 |
% if FloatType == 'Float80':
|
|
|
d750885 |
#if !os(Windows) && (arch(i386) || arch(x86_64))
|
|
|
d750885 |
@@ -1651,7 +1650,7 @@
|
|
|
d750885 |
return Hasher._hash(
|
|
|
d750885 |
seed: seed,
|
|
|
d750885 |
bytes: UInt64(truncatingIfNeeded: ${U}${Self}(_value)),
|
|
|
d750885 |
- count: ${bits / 8})
|
|
|
d750885 |
+ count: ${bits // 8})
|
|
|
d750885 |
% end
|
|
|
d750885 |
}
|
|
|
d750885 |
}
|
|
|
d750885 |
diff -Naur swift-orig/stdlib/public/core/Mirrors.swift.gyb swift/stdlib/public/core/Mirrors.swift.gyb
|
|
|
d750885 |
--- swift-orig/stdlib/public/core/Mirrors.swift.gyb 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/stdlib/public/core/Mirrors.swift.gyb 2019-07-23 09:20:38.269152361 -0500
|
|
|
d750885 |
@@ -12,7 +12,7 @@
|
|
|
d750885 |
|
|
|
d750885 |
%{
|
|
|
d750885 |
|
|
|
d750885 |
-from SwiftIntTypes import all_integer_types
|
|
|
d750885 |
+import SwiftIntTypes
|
|
|
d750885 |
|
|
|
d750885 |
# Number of bits in the Builtin.Word type
|
|
|
d750885 |
word_bits = int(CMAKE_SIZEOF_VOID_P) * 8
|
|
|
d750885 |
@@ -26,7 +26,7 @@
|
|
|
d750885 |
('Unicode.Scalar', '.uInt', 'UInt64(self)'),
|
|
|
d750885 |
]
|
|
|
d750885 |
|
|
|
d750885 |
-for self_ty in all_integer_types(word_bits):
|
|
|
d750885 |
+for self_ty in SwiftIntTypes.all_integer_types(word_bits):
|
|
|
d750885 |
Self = self_ty.stdlib_name
|
|
|
d750885 |
if self_ty.is_signed:
|
|
|
d750885 |
Types.append( (Self, '.int', 'Int64(self)') )
|
|
|
d750885 |
diff -Naur swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb swift/stdlib/public/core/SIMDVectorTypes.swift.gyb
|
|
|
d750885 |
--- swift-orig/stdlib/public/core/SIMDVectorTypes.swift.gyb 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/stdlib/public/core/SIMDVectorTypes.swift.gyb 2019-07-22 15:30:52.516752476 -0500
|
|
|
d750885 |
@@ -11,7 +11,7 @@
|
|
|
d750885 |
//===----------------------------------------------------------------------===//
|
|
|
d750885 |
|
|
|
d750885 |
%{
|
|
|
d750885 |
-from SwiftIntTypes import all_integer_types
|
|
|
d750885 |
+import SwiftIntTypes
|
|
|
d750885 |
word_bits = int(CMAKE_SIZEOF_VOID_P) * 8
|
|
|
d750885 |
storagescalarCounts = [2,4,8,16,32,64]
|
|
|
d750885 |
vectorscalarCounts = storagescalarCounts + [3]
|
|
|
d750885 |
@@ -90,17 +90,17 @@
|
|
|
d750885 |
% if n >= 4:
|
|
|
d750885 |
/// Creates a new vector from two half-length vectors.
|
|
|
d750885 |
@_transparent
|
|
|
d750885 |
- public init(lowHalf: SIMD${n/2}<Scalar>, highHalf: SIMD${n/2}<Scalar>) {
|
|
|
d750885 |
+ public init(lowHalf: SIMD${n//2}<Scalar>, highHalf: SIMD${n//2}<Scalar>) {
|
|
|
d750885 |
self.init()
|
|
|
d750885 |
self.lowHalf = lowHalf
|
|
|
d750885 |
self.highHalf = highHalf
|
|
|
d750885 |
}
|
|
|
d750885 |
|
|
|
d750885 |
-% for (half,indx) in [('low','i'), ('high',str(n/2)+'+i'), ('even','2*i'), ('odd','2*i+1')]:
|
|
|
d750885 |
+% for (half,indx) in [('low','i'), ('high',str(n//2)+'+i'), ('even','2*i'), ('odd','2*i+1')]:
|
|
|
d750885 |
/// A half-length vector made up of the ${half} elements of the vector.
|
|
|
d750885 |
- public var ${half}Half: SIMD${n/2}<Scalar> {
|
|
|
d750885 |
+ public var ${half}Half: SIMD${n//2}<Scalar> {
|
|
|
d750885 |
@inlinable get {
|
|
|
d750885 |
- var result = SIMD${n/2}<Scalar>()
|
|
|
d750885 |
+ var result = SIMD${n//2}<Scalar>()
|
|
|
d750885 |
for i in result.indices { result[i] = self[${indx}] }
|
|
|
d750885 |
return result
|
|
|
d750885 |
}
|
|
|
d750885 |
@@ -159,7 +159,7 @@
|
|
|
d750885 |
public var debugDescription: String {
|
|
|
d750885 |
return "SIMD${n}<\(Scalar.self)>(${', '.join(map(lambda c:
|
|
|
d750885 |
'\\(self['+ str(c) + '])',
|
|
|
d750885 |
- xrange(n)))})"
|
|
|
d750885 |
+ range(n)))})"
|
|
|
d750885 |
}
|
|
|
d750885 |
}
|
|
|
d750885 |
|
|
|
d750885 |
@@ -203,7 +203,7 @@
|
|
|
d750885 |
}
|
|
|
d750885 |
}
|
|
|
d750885 |
|
|
|
d750885 |
-%for self_type in all_integer_types(word_bits):
|
|
|
d750885 |
+%for self_type in SwiftIntTypes.all_integer_types(word_bits):
|
|
|
d750885 |
% Self = self_type.stdlib_name
|
|
|
d750885 |
% BuiltinName = self_type.builtin_name
|
|
|
d750885 |
% Mask = Self if self_type.is_signed else self_type.get_opposite_signedness().stdlib_name
|
|
|
d750885 |
@@ -212,7 +212,7 @@
|
|
|
d750885 |
public typealias SIMDMaskScalar = ${Mask}
|
|
|
d750885 |
|
|
|
d750885 |
% for n in storagescalarCounts:
|
|
|
d750885 |
-% bytes = n * self_type.bits / 8
|
|
|
d750885 |
+% bytes = n * self_type.bits // 8
|
|
|
d750885 |
/// Storage for a vector of ${spelledNumbers[n]} integers.
|
|
|
d750885 |
@frozen
|
|
|
d750885 |
@_alignment(${bytes if bytes <= 16 else 16})
|
|
|
d750885 |
@@ -257,7 +257,7 @@
|
|
|
d750885 |
public typealias SIMDMaskScalar = Int${bits}
|
|
|
d750885 |
|
|
|
d750885 |
% for n in storagescalarCounts:
|
|
|
d750885 |
-% bytes = n * bits / 8
|
|
|
d750885 |
+% bytes = n * bits // 8
|
|
|
d750885 |
/// Storage for a vector of ${spelledNumbers[n]} floating-point values.
|
|
|
d750885 |
@frozen
|
|
|
d750885 |
@_alignment(${bytes if bytes <= 16 else 16})
|
|
|
d750885 |
diff -Naur swift-orig/stdlib/public/core/Tuple.swift.gyb swift/stdlib/public/core/Tuple.swift.gyb
|
|
|
d750885 |
--- swift-orig/stdlib/public/core/Tuple.swift.gyb 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/stdlib/public/core/Tuple.swift.gyb 2019-07-17 20:54:45.400558556 -0500
|
|
|
d750885 |
@@ -111,7 +111,7 @@
|
|
|
d750885 |
% equatableTypeParams = ", ".join(["{} : Equatable".format(c) for c in typeParams])
|
|
|
d750885 |
|
|
|
d750885 |
% originalTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity))))
|
|
|
d750885 |
-% greaterTuple = "(\"a\", {})".format(", ".join(map(str, range(1, arity - 1) + [arity])))
|
|
|
d750885 |
+% greaterTuple = "(\"a\", {})".format(", ".join(map(str, list(range(1, arity - 1)) + [arity])))
|
|
|
d750885 |
|
|
|
d750885 |
/// Returns a Boolean value indicating whether the corresponding components of
|
|
|
d750885 |
/// two tuples are equal.
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_sourcekit_support/__init__.py swift/utils/gyb_sourcekit_support/__init__.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_sourcekit_support/__init__.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_sourcekit_support/__init__.py 2019-07-18 14:19:45.668770778 -0500
|
|
|
d750885 |
@@ -14,9 +14,9 @@
|
|
|
d750885 |
# utils/gyb_sourcekit_support/ directory as a module.
|
|
|
d750885 |
#
|
|
|
d750885 |
# ----------------------------------------------------------------------------
|
|
|
d750885 |
-from UIDs import UID_KEYS
|
|
|
d750885 |
-from UIDs import UID_KINDS
|
|
|
d750885 |
-from UIDs import UID_REQUESTS
|
|
|
d750885 |
+from .UIDs import UID_KEYS
|
|
|
d750885 |
+from .UIDs import UID_KINDS
|
|
|
d750885 |
+from .UIDs import UID_REQUESTS
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
def check_uid_duplication():
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/AttributeNodes.py swift/utils/gyb_syntax_support/AttributeNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/AttributeNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/AttributeNodes.py 2019-07-18 12:34:20.708714660 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
ATTRIBUTE_NODES = [
|
|
|
d750885 |
# token-list -> token? token-list?
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py swift/utils/gyb_syntax_support/AvailabilityNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/AvailabilityNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/AvailabilityNodes.py 2019-07-18 12:34:20.711714774 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
AVAILABILITY_NODES = [
|
|
|
d750885 |
# availability-spec-list -> availability-entry availability-spec-list?
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/Child.py swift/utils/gyb_syntax_support/Child.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/Child.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/Child.py 2019-07-18 12:34:20.712714811 -0500
|
|
|
d750885 |
@@ -1,7 +1,7 @@
|
|
|
d750885 |
# flake8: noqa I201
|
|
|
d750885 |
-from Classification import classification_by_name
|
|
|
d750885 |
-from Token import SYNTAX_TOKEN_MAP
|
|
|
d750885 |
-from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
|
|
|
d750885 |
+from .Classification import classification_by_name
|
|
|
d750885 |
+from .Token import SYNTAX_TOKEN_MAP
|
|
|
d750885 |
+from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
class Child(object):
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/Classification.py swift/utils/gyb_syntax_support/Classification.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/Classification.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/Classification.py 2019-07-18 12:34:20.713714849 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Node import error
|
|
|
d750885 |
-from kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
+from .Node import error
|
|
|
d750885 |
+from .kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
class SyntaxClassification(object):
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/CommonNodes.py swift/utils/gyb_syntax_support/CommonNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/CommonNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/CommonNodes.py 2019-07-18 12:34:20.714714887 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
COMMON_NODES = [
|
|
|
d750885 |
Node('Decl', kind='Syntax'),
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/DeclNodes.py swift/utils/gyb_syntax_support/DeclNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/DeclNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/DeclNodes.py 2019-07-18 12:34:20.716714963 -0500
|
|
|
d750885 |
@@ -1,6 +1,6 @@
|
|
|
d750885 |
# flake8: noqa I201
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
DECL_NODES = [
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/ExprNodes.py swift/utils/gyb_syntax_support/ExprNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/ExprNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/ExprNodes.py 2019-07-18 12:34:20.717715000 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
EXPR_NODES = [
|
|
|
d750885 |
# An inout expression.
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/GenericNodes.py swift/utils/gyb_syntax_support/GenericNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/GenericNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/GenericNodes.py 2019-07-18 12:34:20.718715038 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
GENERIC_NODES = [
|
|
|
d750885 |
# generic-where-clause -> 'where' requirement-list
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/__init__.py swift/utils/gyb_syntax_support/__init__.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/__init__.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/__init__.py 2019-07-18 12:34:33.973215999 -0500
|
|
|
d750885 |
@@ -1,19 +1,19 @@
|
|
|
d750885 |
import textwrap
|
|
|
d750885 |
-from AttributeNodes import ATTRIBUTE_NODES # noqa: I201
|
|
|
d750885 |
-from AvailabilityNodes import AVAILABILITY_NODES # noqa: I201
|
|
|
d750885 |
-import Classification # noqa: I201
|
|
|
d750885 |
-from CommonNodes import COMMON_NODES # noqa: I201
|
|
|
d750885 |
-from DeclNodes import DECL_NODES # noqa: I201
|
|
|
d750885 |
-from ExprNodes import EXPR_NODES # noqa: I201
|
|
|
d750885 |
-from GenericNodes import GENERIC_NODES # noqa: I201
|
|
|
d750885 |
-from NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \
|
|
|
d750885 |
+from .AttributeNodes import ATTRIBUTE_NODES # noqa: I201
|
|
|
d750885 |
+from .AvailabilityNodes import AVAILABILITY_NODES # noqa: I201
|
|
|
d750885 |
+from . import Classification # noqa: I201
|
|
|
d750885 |
+from .CommonNodes import COMMON_NODES # noqa: I201
|
|
|
d750885 |
+from .DeclNodes import DECL_NODES # noqa: I201
|
|
|
d750885 |
+from .ExprNodes import EXPR_NODES # noqa: I201
|
|
|
d750885 |
+from .GenericNodes import GENERIC_NODES # noqa: I201
|
|
|
d750885 |
+from .NodeSerializationCodes import SYNTAX_NODE_SERIALIZATION_CODES, \
|
|
|
d750885 |
get_serialization_code, \
|
|
|
d750885 |
verify_syntax_node_serialization_codes
|
|
|
d750885 |
|
|
|
d750885 |
-from PatternNodes import PATTERN_NODES # noqa: I201
|
|
|
d750885 |
-from StmtNodes import STMT_NODES # noqa: I201
|
|
|
d750885 |
-import Token
|
|
|
d750885 |
-from TypeNodes import TYPE_NODES # noqa: I201
|
|
|
d750885 |
+from .PatternNodes import PATTERN_NODES # noqa: I201
|
|
|
d750885 |
+from .StmtNodes import STMT_NODES # noqa: I201
|
|
|
d750885 |
+from . import Token
|
|
|
d750885 |
+from .TypeNodes import TYPE_NODES # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
# Re-export global constants
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/Node.py swift/utils/gyb_syntax_support/Node.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/Node.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/Node.py 2019-07-18 12:34:20.722715189 -0500
|
|
|
d750885 |
@@ -1,6 +1,6 @@
|
|
|
d750885 |
from __future__ import print_function
|
|
|
d750885 |
import sys # noqa: I201
|
|
|
d750885 |
-from kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
|
|
|
d750885 |
+from .kinds import SYNTAX_BASE_KINDS, kind_to_type, lowercase_first_word
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
def error(msg):
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py swift/utils/gyb_syntax_support/NodeSerializationCodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/NodeSerializationCodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/NodeSerializationCodes.py 2019-07-18 12:34:20.723715227 -0500
|
|
|
d750885 |
@@ -1,4 +1,4 @@
|
|
|
d750885 |
-from Node import error
|
|
|
d750885 |
+from .Node import error
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
SYNTAX_NODE_SERIALIZATION_CODES = {
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/PatternNodes.py swift/utils/gyb_syntax_support/PatternNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/PatternNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/PatternNodes.py 2019-07-18 12:34:20.724715265 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
PATTERN_NODES = [
|
|
|
d750885 |
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/StmtNodes.py swift/utils/gyb_syntax_support/StmtNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/StmtNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/StmtNodes.py 2019-07-18 12:34:20.726715341 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
STMT_NODES = [
|
|
|
d750885 |
# continue-stmt -> 'continue' label? ';'?
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/Token.py swift/utils/gyb_syntax_support/Token.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/Token.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/Token.py 2019-07-18 12:34:20.727715378 -0500
|
|
|
d750885 |
@@ -1,6 +1,6 @@
|
|
|
d750885 |
-from Classification import classification_by_name
|
|
|
d750885 |
-from Node import error # noqa: I201
|
|
|
d750885 |
-from kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
+from .Classification import classification_by_name
|
|
|
d750885 |
+from .Node import error # noqa: I201
|
|
|
d750885 |
+from .kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
class Token(object):
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/Trivia.py swift/utils/gyb_syntax_support/Trivia.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/Trivia.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/Trivia.py 2019-07-18 14:22:04.074001913 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Node import error
|
|
|
d750885 |
-from kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
+from .Node import error
|
|
|
d750885 |
+from .kinds import lowercase_first_word # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
|
|
|
d750885 |
class Trivia(object):
|
|
|
d750885 |
diff -Naur swift-orig/utils/gyb_syntax_support/TypeNodes.py swift/utils/gyb_syntax_support/TypeNodes.py
|
|
|
d750885 |
--- swift-orig/utils/gyb_syntax_support/TypeNodes.py 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/gyb_syntax_support/TypeNodes.py 2019-07-18 12:34:20.731715529 -0500
|
|
|
d750885 |
@@ -1,5 +1,5 @@
|
|
|
d750885 |
-from Child import Child
|
|
|
d750885 |
-from Node import Node # noqa: I201
|
|
|
d750885 |
+from .Child import Child
|
|
|
d750885 |
+from .Node import Node # noqa: I201
|
|
|
d750885 |
|
|
|
d750885 |
TYPE_NODES = [
|
|
|
d750885 |
# simple-type-identifier -> identifier generic-argument-clause?
|
|
|
d750885 |
diff -Naur swift-orig/utils/line-directive swift/utils/line-directive
|
|
|
d750885 |
--- swift-orig/utils/line-directive 2019-07-14 15:16:38.000000000 -0500
|
|
|
d750885 |
+++ swift/utils/line-directive 2019-07-19 09:01:35.602482603 -0500
|
|
|
d750885 |
@@ -60,7 +60,7 @@
|
|
|
d750885 |
|
|
|
d750885 |
def _make_line_map(target_filename, stream=None):
|
|
|
d750885 |
"""
|
|
|
d750885 |
- >>> from StringIO import StringIO
|
|
|
d750885 |
+ >>> from io import StringIO
|
|
|
d750885 |
>>> _make_line_map('box',
|
|
|
d750885 |
... StringIO('''// ###sourceLocation(file: "foo.bar", line: 3)
|
|
|
d750885 |
... line 2
|
|
|
d750885 |
@@ -94,7 +94,7 @@
|
|
|
d750885 |
|
|
|
d750885 |
def map_line_to_source_file(target_filename, target_line_num):
|
|
|
d750885 |
"""
|
|
|
d750885 |
- >>> from tempfile import *
|
|
|
d750885 |
+ >>> from .tempfile import *
|
|
|
d750885 |
>>> # On Windows, the name of a NamedTemporaryFile cannot be used to open
|
|
|
d750885 |
>>> # the file for a second time if delete=True. Therefore, we have to
|
|
|
d750885 |
>>> # manually handle closing and deleting this file to allow us to open
|
|
|
d750885 |
@@ -144,7 +144,7 @@
|
|
|
d750885 |
def map_line_from_source_file(source_filename, source_line_num,
|
|
|
d750885 |
target_filename):
|
|
|
d750885 |
"""
|
|
|
d750885 |
- >>> from tempfile import *
|
|
|
d750885 |
+ >>> from .tempfile import *
|
|
|
d750885 |
>>> # On Windows, the name of a NamedTemporaryFile cannot be used to open
|
|
|
d750885 |
>>> # the file for a second time if delete=True. Therefore, we have to
|
|
|
d750885 |
>>> # manually handle closing and deleting this file to allow us to open
|
|
|
d750885 |
@@ -230,7 +230,7 @@
|
|
|
d750885 |
def run():
|
|
|
d750885 |
"""Simulate a couple of gyb-generated files
|
|
|
d750885 |
|
|
|
d750885 |
- >>> from tempfile import *
|
|
|
d750885 |
+ >>> from .tempfile import *
|
|
|
d750885 |
>>> # On Windows, the name of a NamedTemporaryFile cannot be used to open
|
|
|
d750885 |
>>> # the file for a second time if delete=True. Therefore, we have to
|
|
|
d750885 |
>>> # manually handle closing and deleting this file to allow us to open
|