Skip to content

Commit 8657d66

Browse files
authored
Merge pull request #477 from fwcd/swift-snippets
Migrate examples to Swift snippets
2 parents 3704b33 + c3ff32e commit 8657d66

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Examples/CodeGenerationUsingSwiftSyntaxBuilder.swift renamed to Snippets/CodeGenerationUsingSwiftSyntaxBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ import SwiftSyntaxBuilder
1313
let source = SourceFile {
1414
ImportDecl(path: "Foundation")
1515
ImportDecl(path: "UIKit")
16-
ClassDecl(classKeyword: .class, identifier: "SomeViewController", membersBuilder: {
16+
ClassDecl(identifier: "SomeViewController") {
1717
VariableDecl(.let, name: "tableView", type: "UITableView")
18-
})
18+
}
1919
}
2020

2121
let syntax = source.buildSyntax(format: Format())

Examples/README.md renamed to Snippets/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
# Examples
1+
# Snippets (Examples)
22

3-
- Command line tool to add one to every integer literal in a source file [AddOneToIntegerLiterals.swift](https://github.com/apple/swift-syntax/blob/main/Examples/AddOneToIntegerLiterals.swift).
4-
- Code-generate a simple source file using SwiftSyntaxBuilder [CodeGenerationUsingSwiftSyntaxBuilder.swift](https://github.com/apple/swift-syntax/blob/95fe6182b755346eee74b499109b4ab9eaf38651/Examples/CodeGenerationUsingSwiftSyntaxBuilder.swift)
3+
- Command line tool to add one to every integer literal in a source file [AddOneToIntegerLiterals.swift](AddOneToIntegerLiterals.swift).
4+
- Code-generate a simple source file using SwiftSyntaxBuilder [CodeGenerationUsingSwiftSyntaxBuilder.swift](CodeGenerationUsingSwiftSyntaxBuilder.swift)
55

66
## Some Example Usages
77

8-
[**Swift AST Explorer**](https://swift-ast-explorer.kishikawakatsumi.com/): a Swift AST visualizer.
8+
[**Swift AST Explorer**](https://swift-ast-explorer.com/): a Swift AST visualizer.
99

1010
[**swift-format**](https://github.com/apple/swift-format): formatting technology for Swift source code.
1111

0 commit comments

Comments
 (0)