mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Mechanically add "Type" to the end of any protocol names that don't end in "Type," "ible," or "able." Also, drop "Type" from the end of any associated type names, except for those of the *LiteralConvertible protocols. There are obvious improvements to make in some of these names, which can be handled with separate commits. Fixes <rdar://problem/17165920> Protocols `Integer` etc should get uglier names. Swift SVN r19883
36 lines
1.9 KiB
Swift
36 lines
1.9 KiB
Swift
%{
|
|
#//===--- MirrorDecl.gyb --------------------------------------*- swift -*-===//
|
|
#//
|
|
#// This source file is part of the Swift.org open source project
|
|
#//
|
|
#// Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors
|
|
#// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
#//
|
|
#// See http://swift.org/LICENSE.txt for license information
|
|
#// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
#//
|
|
#//===----------------------------------------------------------------------===//
|
|
# This file contains boilerplate that is common among all the Mirrors in the
|
|
# Swift Standard Library. It is meant to be used as a template to be included
|
|
# in other .gyb files to generate actual Mirror implementations, by only typing
|
|
# as little code as necessary
|
|
# Instructions:
|
|
# Load the file as a gyb template
|
|
# When you want to generate a Mirror, execute this template. Locals are as follows:
|
|
# - introspecteeType: the base name of the type to be reflected by your Mirror
|
|
# - genericArgs: a list of names of generic argument types that you need for your Mirror
|
|
# - genericConstraints: a dictionary that contains constraints on generic argument types
|
|
# - disposition: a valid disposition for your Mirror
|
|
# You still need to provide count, subscript, summary and quickLookObject manually when using
|
|
# this template, which is probably reasonable since those are "the meat" of every Mirror
|
|
}%
|
|
|
|
%import inspect,os.path,sys
|
|
%sys.path = [os.path.split(inspect.getframeinfo(inspect.currentframe()).filename)[0] or '.'] + sys.path
|
|
%import MirrorCommon
|
|
%genericConstraintString = MirrorCommon.getGenericConstraintString(\
|
|
% genericArgs if 'genericArgs' in locals() else None,\
|
|
% genericConstraints if 'genericConstraints' in locals() else None)
|
|
|
|
internal struct _${introspecteeType}Mirror${genericConstraintString} : MirrorType
|