Created
April 15, 2019 03:12
-
-
Save LucianoPAlmeida/d7d46f24607f4ba639c5d1e8eec66c22 to your computer and use it in GitHub Desktop.
Syntax Rewriter
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
import SwiftSyntax | |
class CatRewriter: SyntaxRewriter { | |
override func visit(_ token: TokenSyntax) -> Syntax { | |
guard case .stringLiteral = token.tokenKind else { return token } | |
return token.withKind(.stringLiteral("\"🐱\"")) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment