-
Notifications
You must be signed in to change notification settings - Fork 382
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
Syntactic macro system #969
Merged
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
b83ae36
Add nodes to describe general macro expansions
DougGregor 300b844
Regenerate syntax nodes
DougGregor f00847d
Parse macro expansion expressions
DougGregor 97adb1e
Parse a macro expansion as a declaration
DougGregor df54256
Add the basic shell of a SwiftSyntaxMacros package.
rxwei d581342
Introduce a macro system with syntactic rewriting capabilities
DougGregor e98bd51
Refactor macro expansion logic to make it easier to extend
DougGregor f1db1b9
Factor out some macro definitions into an example system we can use
DougGregor 4482f08
Add a #colorLiteral-like macro
DougGregor 23a28a6
[swift-parser-cli] Add an expand-macros subcommand to swift-parser-cli
DougGregor d7c3938
Document how to use and experiment with the SwiftSyntaxMacros module
DougGregor cb7b9f3
Have MacroApplication rely entirely on Syntax.evaluateMacro.
DougGregor 3c9d14b
Update a few tests to match expected output
DougGregor 5efd552
Rename "macro expansion" nodes to "pound literal"
DougGregor a868f1d
Regenerate for syntax node name change
DougGregor 22b87b2
Update tests for macro expansion node name change
DougGregor 20ff3b6
[Parser] Stop producing PoundLineExprSyntax nodes.
DougGregor f228056
Rename `#myLine` to `#line` now that it's just a normal macro
DougGregor 0db788c
Stop parsing into PoundColumnExprSyntax, add a macro instead
DougGregor 646870d
Stop parsing into PoundDsohandleExprSyntax.
DougGregor 948fcd9
[Parser] Replace `#function` with a macro.
DougGregor 85af5e9
[Parser] Stop parsing `#colorLiteral`, `#fileLiteral`, and `#imageLit…
DougGregor ba10173
[Parser] Stop creating `PoundFile(ID|Path|)Syntax` nodes.
DougGregor 38d7dfc
Implement macros for #file/#fileID/#filePath
DougGregor 5c02eb5
Underscore _SwiftSyntaxMacros because it is So Very Experimental
DougGregor File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would a macro expansion declaration with a trailing closure look like?