@@ -10,7 +10,7 @@ public protocol Comment {
10
10
11
11
extension Comment {
12
12
/// Retreives all children of this comment.
13
- var children : AnySequence < Comment > {
13
+ public var children : AnySequence < Comment > {
14
14
let count = clang_Comment_getNumChildren ( clang)
15
15
var index : UInt32 = 0
16
16
return AnySequence< Comment> {
@@ -24,11 +24,11 @@ extension Comment {
24
24
25
25
/// - parameter index: The index of the child you're getting.
26
26
/// - returns: The specified child of the AST node.
27
- func child( at index: Int ) -> Comment ? {
27
+ public func child( at index: Int ) -> Comment ? {
28
28
return convertComment ( clang_Comment_getChild ( clang, UInt32 ( index) ) )
29
29
}
30
30
31
- var firstChild : Comment ? {
31
+ public var firstChild : Comment ? {
32
32
let count = clang_Comment_getNumChildren ( clang)
33
33
if count == 0 { return nil }
34
34
return convertComment ( clang_Comment_getChild ( clang, 0 ) )
@@ -59,35 +59,35 @@ public struct FullComment: Comment {
59
59
/// names inside template template parameters
60
60
/// - `tparam-name-index-invalid` and `tparam-descr-index-invalid` are used if
61
61
/// parameter position is invalid.
62
- var html : String {
62
+ public var html : String {
63
63
return clang_FullComment_getAsHTML ( clang) . asSwift ( )
64
64
}
65
65
66
66
/// Convert a given full parsed comment to an XML document.
67
67
/// A Relax NG schema for the XML can be found in comment-xml-schema.rng file
68
68
/// inside the clang source tree.
69
- var xml : String {
69
+ public var xml : String {
70
70
return clang_FullComment_getAsXML ( clang) . asSwift ( )
71
71
}
72
72
}
73
73
74
74
/// A plain text comment.
75
- struct TextComment : Comment {
76
- let clang : CXComment
75
+ public struct TextComment : Comment {
76
+ public let clang : CXComment
77
77
78
78
/// Retrieves the text contained in the AST node.
79
- var text : String {
79
+ public var text : String {
80
80
return clang_TextComment_getText ( clang) . asSwift ( )
81
81
}
82
82
}
83
83
84
84
/// A command with word-like arguments that is considered inline content.
85
85
/// For example: `\c command`
86
- struct InlineCommandComment : Comment {
87
- let clang : CXComment
86
+ public struct InlineCommandComment : Comment {
87
+ public let clang : CXComment
88
88
89
89
/// Retrieves all arguments of this inline command.
90
- var arguments : AnySequence < String > {
90
+ public var arguments : AnySequence < String > {
91
91
let count = clang_InlineCommandComment_getNumArgs ( clang)
92
92
var index = 0 as UInt32
93
93
return AnySequence< String> {
@@ -106,12 +106,12 @@ struct InlineCommandComment: Comment {
106
106
/// ```
107
107
/// Would have 1 attribute, with a name `"href"`, and value
108
108
/// `"https://example.org"`
109
- struct HTMLAttribute {
109
+ public struct HTMLAttribute {
110
110
/// The name of the attribute, which comes before the `=`.
111
- let name : String
111
+ public let name : String
112
112
113
113
/// The value in the attribute, which comes after the `=`.
114
- let value : String
114
+ public let value : String
115
115
}
116
116
117
117
/// An HTML start tag with attributes (name-value pairs). Considered inline
@@ -120,11 +120,11 @@ struct HTMLAttribute {
120
120
/// ```
121
121
/// <a href="http://example.org/">
122
122
/// ```
123
- struct HTMLStartTagComment : Comment {
124
- let clang : CXComment
123
+ public struct HTMLStartTagComment : Comment {
124
+ public let clang : CXComment
125
125
126
126
/// Retrieves all attributes of this HTML start tag.
127
- var attributes : AnySequence < HTMLAttribute > {
127
+ public var attributes : AnySequence < HTMLAttribute > {
128
128
let count = clang_HTMLStartTag_getNumAttrs ( clang)
129
129
var index = 0 as UInt32
130
130
return AnySequence< HTMLAttribute> {
@@ -144,13 +144,13 @@ struct HTMLStartTagComment: Comment {
144
144
/// ```
145
145
/// </a>
146
146
/// ```
147
- struct HTMLEndTagComment : Comment {
148
- let clang : CXComment
147
+ public struct HTMLEndTagComment : Comment {
148
+ public let clang : CXComment
149
149
}
150
150
151
151
/// A paragraph, contains inline comment. The paragraph itself is block content.
152
- struct ParagraphComment : Comment {
153
- let clang : CXComment
152
+ public struct ParagraphComment : Comment {
153
+ public let clang : CXComment
154
154
}
155
155
156
156
/// A command that has zero or more word-like arguments (number of word-like
@@ -160,16 +160,16 @@ struct ParagraphComment: Comment {
160
160
/// For example: `\brief` has 0 word-like arguments and a paragraph argument.
161
161
/// AST nodes of special kinds that parser knows about (e. g., the `\param`
162
162
/// command) have their own node kinds.
163
- struct BlockCommandComment : Comment {
164
- let clang : CXComment
163
+ public struct BlockCommandComment : Comment {
164
+ public let clang : CXComment
165
165
166
166
/// Retrieves the name of this block command.
167
- var name : String {
167
+ public var name : String {
168
168
return clang_BlockCommandComment_getCommandName ( clang) . asSwift ( )
169
169
}
170
170
171
171
/// Retrieves all attributes of this HTML start tag.
172
- var arguments : AnySequence < String > {
172
+ public var arguments : AnySequence < String > {
173
173
let count = clang_BlockCommandComment_getNumArgs ( clang)
174
174
var index = 0 as UInt32
175
175
return AnySequence< String> {
@@ -182,7 +182,7 @@ struct BlockCommandComment: Comment {
182
182
}
183
183
184
184
/// Retrieves the paragraph argument of the block command.
185
- var paragraph : ParagraphComment {
185
+ public var paragraph : ParagraphComment {
186
186
return ParagraphComment ( clang: clang_BlockCommandComment_getParagraph ( clang) )
187
187
}
188
188
}
@@ -193,7 +193,7 @@ struct BlockCommandComment: Comment {
193
193
/// caller. An `.out` argument is usually a pointer and is meant to be filled
194
194
/// by the caller, usually to return multiple pieces of data from a function.
195
195
/// An `.inout` argument is meant to be read and written out to by the caller.
196
- enum ParamPassDirection {
196
+ public enum ParamPassDirection {
197
197
/// The parameter is an input parameter.
198
198
case `in`
199
199
@@ -219,33 +219,33 @@ enum ParamPassDirection {
219
219
/// ```
220
220
/// \param [in] ParamName description.
221
221
/// ```
222
- struct ParamCommandComment : Comment {
223
- let clang : CXComment
222
+ public struct ParamCommandComment : Comment {
223
+ public let clang : CXComment
224
224
225
225
/// Retrieves the zero-based parameter index in the function prototype.
226
- var index : Int {
226
+ public var index : Int {
227
227
return Int ( clang_ParamCommandComment_getParamIndex ( clang) )
228
228
}
229
229
230
230
/// The direction this parameter is passed by.
231
- var passDirection : ParamPassDirection {
231
+ public var passDirection : ParamPassDirection {
232
232
return ParamPassDirection ( clang: clang_ParamCommandComment_getDirection ( clang) )
233
233
}
234
234
235
235
/// Retrieves the name of the declared parameter.
236
- var name : String {
236
+ public var name : String {
237
237
return clang_ParamCommandComment_getParamName ( clang) . asSwift ( )
238
238
}
239
239
240
240
/// Determine if this parameter is actually a valid parameter in the declared
241
241
/// function
242
- var isValidIndex : Bool {
242
+ public var isValidIndex : Bool {
243
243
return clang_ParamCommandComment_isParamIndexValid ( clang) != 0
244
244
}
245
245
246
246
/// Determines if the parameter's direction was explicitly stated in the
247
247
/// function prototype.
248
- var isExplicitDirection : Bool {
248
+ public var isExplicitDirection : Bool {
249
249
return clang_ParamCommandComment_isDirectionExplicit ( clang) != 0
250
250
}
251
251
}
@@ -255,8 +255,8 @@ struct ParamCommandComment: Comment {
255
255
/// ```
256
256
/// \tparam T description.
257
257
/// ```
258
- struct TParamCommandComment : Comment {
259
- let clang : CXComment
258
+ public struct TParamCommandComment : Comment {
259
+ public let clang : CXComment
260
260
261
261
/// Determines the zero-based nesting depth of this parameter in the template
262
262
/// parameter list.
@@ -267,7 +267,7 @@ struct TParamCommandComment: Comment {
267
267
/// ```
268
268
/// for `C` and `TT` the nesting depth is 0, and for `T` the nesting
269
269
/// depth is `1`.
270
- var depth : Int {
270
+ public var depth : Int {
271
271
return Int ( clang_TParamCommandComment_getDepth ( clang) )
272
272
}
273
273
}
@@ -281,16 +281,16 @@ struct TParamCommandComment: Comment {
281
281
/// aaa
282
282
/// \endverbatim
283
283
/// ```
284
- struct VerbatimBlockCommandComment : Comment {
285
- let clang : CXComment
284
+ public struct VerbatimBlockCommandComment : Comment {
285
+ public let clang : CXComment
286
286
287
287
/// Retrieves the name of this block command.
288
- var name : String {
288
+ public var name : String {
289
289
return clang_BlockCommandComment_getCommandName ( clang) . asSwift ( )
290
290
}
291
291
292
292
/// Retrieves all attributes of this HTML start tag.
293
- var arguments : AnySequence < String > {
293
+ public var arguments : AnySequence < String > {
294
294
let count = clang_BlockCommandComment_getNumArgs ( clang)
295
295
var index = 0 as UInt32
296
296
return AnySequence< String> {
@@ -303,30 +303,30 @@ struct VerbatimBlockCommandComment: Comment {
303
303
}
304
304
305
305
/// Retrieves the paragraph argument of the block command.
306
- var paragraph : ParagraphComment {
306
+ public var paragraph : ParagraphComment {
307
307
return ParagraphComment ( clang: clang_BlockCommandComment_getParagraph ( clang) )
308
308
}
309
309
}
310
310
311
311
/// A line of text that is contained within a `VerbatimBlockCommand`
312
312
/// node.
313
- struct VerbatimBlockLineComment : Comment {
314
- let clang : CXComment
313
+ public struct VerbatimBlockLineComment : Comment {
314
+ public let clang : CXComment
315
315
316
316
/// The text of this comment.
317
- var text : String {
317
+ public var text : String {
318
318
return clang_VerbatimBlockLineComment_getText ( clang) . asSwift ( )
319
319
}
320
320
}
321
321
322
322
/// A verbatim line command. Verbatim line has an opening command, a single
323
323
/// line of text (up to the newline after the opening command) and has no
324
324
/// closing command.
325
- struct VerbatimLineComment : Comment {
326
- let clang : CXComment
325
+ public struct VerbatimLineComment : Comment {
326
+ public let clang : CXComment
327
327
328
328
/// The text of this comment.
329
- var text : String {
329
+ public var text : String {
330
330
return clang_VerbatimLineComment_getText ( clang) . asSwift ( )
331
331
}
332
332
}
0 commit comments