-
Notifications
You must be signed in to change notification settings - Fork 440
SwiftIfConfig: A library to evaluate #if
conditionals within a Swift syntax tree.
#1816
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
746a64a
[SwiftIfConfig] Add a new library for evaluating `#if` conditions.
DougGregor 719e0da
Add higher-level APIs for querying active code state
DougGregor cb7123f
Add support for evaluating `swift` and `compiler` conditionals
DougGregor 979ebc0
Implement support for archaic `_compiler_version("X.Y.Z.W.V")` check
DougGregor 4987cbc
Add support for `canImport` configuration checks.
DougGregor 89c1f6f
Improve documentation for `#if` configuration functions
DougGregor 5972065
Add `ActiveSyntax(Any)Visitor` visitor classes.
DougGregor c115be6
Add/cleanup some TODO comments
DougGregor 623ffc7
Add an API to rewrite a syntax tree by removing inactive regions.
DougGregor 2d2021f
Implement inactive clause rewriting support for postfix `#if`
DougGregor fc41db4
Add overview documentation for the SwiftIfConfig library
DougGregor f004511
Add CMake build system for SwiftIfConfig
DougGregor 14b6718
Format source
DougGregor 19ed1e8
Improve documentation for BuildConfiguration
DougGregor 15073e8
Improve documentation for internal `IfConfigFunctions`.
DougGregor 431fe8a
Address a number of review comments (thanks, Alex!)
DougGregor f35c9e8
[Build configuration] Drop optionality from protocol requirement resu…
DougGregor b6502e5
Simplify `isActive(in:)` using Alex Hoppen's suggestion
DougGregor a21bb5e
Use preconditionFailure
DougGregor 39961b0
Use editor placeholder for placeholder expression
DougGregor 3ef7aa3
Minor cleanups
DougGregor 83f3824
Minor cleanups to the #if rewriter
DougGregor 7ce4981
Rework use of deprecated APIs
DougGregor f5e3540
Teach active-clause visitors to handle diagnostics
DougGregor 2590ebb
Add SwiftIfConfig to the set of documentation targets
DougGregor 1b0f44a
Fix typo in the release notes
DougGregor 00fb7a0
Adapt to optionality changes on main
DougGregor 5428bbc
Add a method `Error.asDiagnostics(at:)` to unpack errors into diagnos…
DougGregor 65fd3b9
Handle errors while removing inactive regions
DougGregor 7cb5189
Handle diagnostics through #if condition evaluation
DougGregor 96569a7
Teach #if condition evaluation to reason about "versioned" checks
DougGregor e649799
Rework `isActive(in: configuration)` to distinguish inactive vs. unpa…
DougGregor e1e67f1
NFC: Split out IfConfigError and the VersionTuple parsing into their …
DougGregor b7e9a4d
Clarify documentation a little bit
DougGregor d8dcb82
Update CMake build for SwiftIfConfig changes
DougGregor b6c8a1b
Add a new API to compute the "configured regions" of a syntax tree
DougGregor e07f68a
DocC cleanups
DougGregor abe00a8
Test active code regions with postfix #if
DougGregor 0b0ac13
Rename IfConfigState -> ConfiguredRegionState
DougGregor bccddb4
Handle invalid `#if` conditions as "unparsed" regions consistently
DougGregor aa97fbd
Reshuffle and rename some source files in SwiftIfConfig
DougGregor 8779074
Add support for _hasAtomicBitWidth to evaluation
DougGregor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.