File tree 2 files changed +3
-33
lines changed
Sources/SwiftFormatPrettyPrint
2 files changed +3
-33
lines changed Original file line number Diff line number Diff line change @@ -233,15 +233,15 @@ Tokens = [docBlock(" Doc Block comment\n * Second line *")]
233
233
Verbatim tokens are used to print text verbatim without any formatting apart
234
234
from applying a global indentation. They have a length set to the maximum line
235
235
width. They are typically used to handle syntax types that are classed as
236
- "unknown " by SwiftSyntax. In these cases, we don't have access to the
236
+ "unexpected " by SwiftSyntax. In these cases, we don't have access to the
237
237
substructure of the syntax node a manner useful for formatting, so we print them
238
238
verbatim. The indentation for verbatim tokens is applied to the first line of
239
239
the text. The relative indentation of subsequent lines is preserved unless they
240
240
have less indentation than the first line, in which case we set the indentation
241
241
of those lines equal to the first.
242
242
243
243
```
244
- // Consider "ifnt", an unknown syntax structure:
244
+ // Consider "ifnt", an unexpected syntax structure:
245
245
246
246
if someCondition {
247
247
ifnt anotherCondition {
Original file line number Diff line number Diff line change @@ -2357,43 +2357,13 @@ fileprivate final class TokenStreamCreator: SyntaxVisitor {
2357
2357
return . visitChildren
2358
2358
}
2359
2359
2360
- // MARK: - Nodes representing unknown or malformed syntax
2360
+ // MARK: - Nodes representing unexpected or malformed syntax
2361
2361
2362
2362
override func visit( _ node: UnexpectedNodesSyntax ) -> SyntaxVisitorContinueKind {
2363
2363
verbatimToken ( Syntax ( node) )
2364
2364
return . skipChildren
2365
2365
}
2366
2366
2367
- override func visit( _ node: UnknownDeclSyntax ) -> SyntaxVisitorContinueKind {
2368
- verbatimToken ( Syntax ( node) )
2369
- return . skipChildren
2370
- }
2371
-
2372
- override func visit( _ node: UnknownExprSyntax ) -> SyntaxVisitorContinueKind {
2373
- verbatimToken ( Syntax ( node) )
2374
- return . skipChildren
2375
- }
2376
-
2377
- override func visit( _ node: UnknownPatternSyntax ) -> SyntaxVisitorContinueKind {
2378
- verbatimToken ( Syntax ( node) )
2379
- return . skipChildren
2380
- }
2381
-
2382
- override func visit( _ node: UnknownStmtSyntax ) -> SyntaxVisitorContinueKind {
2383
- verbatimToken ( Syntax ( node) )
2384
- return . skipChildren
2385
- }
2386
-
2387
- override func visit( _ node: UnknownSyntax ) -> SyntaxVisitorContinueKind {
2388
- verbatimToken ( Syntax ( node) )
2389
- return . skipChildren
2390
- }
2391
-
2392
- override func visit( _ node: UnknownTypeSyntax ) -> SyntaxVisitorContinueKind {
2393
- verbatimToken ( Syntax ( node) )
2394
- return . skipChildren
2395
- }
2396
-
2397
2367
override func visit( _ node: NonEmptyTokenListSyntax ) -> SyntaxVisitorContinueKind {
2398
2368
verbatimToken ( Syntax ( node) )
2399
2369
return . skipChildren
You can’t perform that action at this time.
0 commit comments