You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CodeGeneration/README.md
+1-13Lines changed: 1 addition & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,6 @@
2
2
3
3
This directory contains file to generate source code that is part of the SwiftSyntax package. If you are looking to generate Swift code yourself, you might be interested in [SwiftSyntaxBuilder](../Sources/SwiftSyntaxBuilder).
4
4
5
-
SwiftSyntax currently uses two mechanisms to generate source code: gyb and SwiftSyntaxBuilder. Both can be run using
Files generated using `gyb` have a `.gyb` suffix. [ChangingSwiftSyntax.md](../Sources/SwiftSyntax/Documentation.docc/ChangingSwiftSyntax.md) contains documentation how `gyb` works. This directory contains the definitions that back most of gyb-generation in `gyb_syntax_support`.
14
-
15
-
## `SwiftSyntaxBuilder`
16
-
17
5
Some source code inside SwiftSyntax is generated using [SwiftSyntaxBuilder](../Sources/SwiftSyntaxBuilder), a Swift library whose purpose is to generate Swift code using Swift itself. This kind of code generation is performed by the Swift package defined in this directory.
18
6
19
-
This directory is a standalone package that uses a pinned version of SwiftSyntaxBuilder. It is thus NOT using SwiftSyntaxBuilder of the parent directory. This guarantees that when `generate-swiftsyntaxbuilder` is run, it can't break its own build.
7
+
This directory is a standalone package that uses a pinned version of SwiftSyntaxBuilder. It is thus NOT using SwiftSyntaxBuilder of the parent directory. This guarantees that when `generate-swiftsyntaxbuilder` is run, it can't break its own build.
*[ ] Render diagnostics to a terminal with color, highlights, etc.
44
-
*[ ] Fix-Its to add/remove/replace syntax
45
-
*[ ] Emit diagnostics in the same binary format that the Swift compiler/driver do
46
-
*[x] Syntax visitor to emit diagnostics for all missing and unexpected syntax
47
-
*[ ] Tooling and automation
48
-
*[ ] Improve test harness to easily check the expected parse trees + diagnostics
49
-
*[ ] Migrate [attribute definitions](https://github.com/apple/swift/blob/main/include/swift/AST/Attr.def) from C++ to Swift
50
-
*[x] Migrate [grammar definition](https://github.com/apple/swift/tree/main/utils/gyb_syntax_support) to the swift-syntax repository
51
-
*[ ] Migrate grammar definition from Python to Swift
52
-
*[ ] Replace uses of gyb with SwiftSyntax-based generation
53
-
*[ ] Auditing the grammar to ensure that it accurately represents the Swift grammar
54
-
*[ ] Attributes
55
-
*[ ] Declarations
56
-
*[ ] Statements
57
-
*[ ] Expressions
58
-
*[ ] AST generation within the Swift compiler itself
59
-
60
-
### Testing methodology
61
-
62
-
We'll employ a number of different techniques to help test the new parser at each phase, including:
63
-
64
-
*[x] Unit tests for specific parser behaviors, added as we implement pieces and uncover bugs.
65
-
66
-
*[ ] Self-parse test to ensure that all Swift files in the package can be parsed, that the syntax tree is well-formed, and that it always reproduces the input source.
67
-
68
-
*[ ] Parsing tests from the Swift compiler repository to check that the parsers accept the same code.
69
-
70
-
*[ ] Fuzzing tests that ensure that the parser does not crash, and always reproduces the input source.
0 commit comments