1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
/*
This source file is part of the Swift.org open source project
Copyright (c) 2021 Apple Inc. and the Swift project authors
Licensed under Apache License v2.0 with Runtime Library Exception
See https://swift.org/LICENSE.txt for license information
See https://swift.org/CONTRIBUTORS.txt for Swift project authors
*/
import Foundation
extension SymbolGraph.Symbol.DeclarationFragments.Fragment {
/**
The kind of declaration fragment.
*/
public struct Kind: Equatable, Codable, RawRepresentable {
public var rawValue: String
public init?(rawValue: String) {
self.rawValue = rawValue
}
/**
A keyword in the programming language, such as `return` in C or `func` in Swift.
*/
public static let keyword = Kind(rawValue: "keyword")!
/**
An attribute in the programming language.
*/
public static let attribute = Kind(rawValue: "attribute")!
/**
An integer or floating point literal, such as `0`, `1.0f`, or `0xFF`.
*/
public static let numberLiteral = Kind(rawValue: "number")!
/**
A string literal such as `"foo"`.
*/
public static let stringLiteral = Kind(rawValue: "string")!
/**
An identifier such as a parameter name.
*/
public static let identifier = Kind(rawValue: "identifier")!
/**
An identifier for a type.
*/
public static let typeIdentifier = Kind(rawValue: "typeIdentifier")!
/**
A generic parameter, such as the `T` in C++ `template <typename T>`.
*/
public static let genericParameter = Kind(rawValue: "genericParameter")!
/**
A function parameter when viewed externally as a client.
For example, in Swift:
```swift
func foo(ext int: Int) {}
```
`ext` is an external parameter name, whereas `int` is an internal
parameter name.
*/
public static let externalParameter = Kind(rawValue: "externalParam")!
/**
A function parameter when viewed internally from the implementation.
For example, in Swift:
```swift
func foo(ext int: Int) {}
```
`ext` is an external parameter name, whereas `int` is an internal
parameter name.
> Note: Although these are not a part of a function's interface,
> such as in Swift, they have historically been easier to refer
> to in prose.
*/
public static let internalParameter = Kind(rawValue: "internalParam")!
/**
General purpose or unlabeled text.
*/
public static let text = Kind(rawValue: "text")!
}
}
|