Skip to content

Refactor SyntaxRewriter #157

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 1 commit into from
Oct 17, 2019
Merged

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Oct 15, 2019

Refactoring of SyntaxRewriter to make it more similar to SyntaxVisitor. This is motivated by three things:
a) It increases the rewriter performance by 1.9x
b) It gets SyntaxRewriter ready for upcoming performance improvements (switch Syntax's representation to be struct-based)
c) It makes the two codebases more similar, allowing easier maintenance.

@ahoppen
Copy link
Member Author

ahoppen commented Oct 15, 2019

@swift-ci Please test

Make the implementation of SyntaxRewriter more similar to that of
SyntaxVisitor, improve performance and make SyntaxRewriter ready for
future performance improvements.
@ahoppen ahoppen force-pushed the rewriter-refactoring branch from b23eb43 to 1d5126f Compare October 15, 2019 00:57
open func visit(_ token: TokenSyntax) -> Syntax {
return token
}

/// Visit a `UnknownSyntax`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: an

@ahoppen
Copy link
Member Author

ahoppen commented Oct 16, 2019

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - b23eb43

@ahoppen ahoppen merged commit 4c66cf6 into swiftlang:master Oct 17, 2019
@ahoppen ahoppen deleted the rewriter-refactoring branch October 17, 2019 00:08
adevress pushed a commit to adevress/swift-syntax that referenced this pull request Jan 14, 2024
minor sp: continution --> continuation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants