File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -181,7 +181,7 @@ class AddOneToIntegerLiterals: SyntaxRewriter {
181
181
override func visit (_ token : TokenSyntax) -> Syntax {
182
182
// Only transform integer literals.
183
183
guard case .integerLiteral (let text) = token.tokenKind else {
184
- return token
184
+ return Syntax ( token)
185
185
}
186
186
187
187
// Remove underscores from the original text.
@@ -190,8 +190,11 @@ class AddOneToIntegerLiterals: SyntaxRewriter {
190
190
// Parse out the integer.
191
191
let int = Int (integerText)!
192
192
193
- // Return a new integer literal token with `int + 1` as its text.
194
- return token.withKind (.integerLiteral (" \( int + 1 ) " ))
193
+ // Create a new integer literal token with `int + 1` as its text.
194
+ let newIntegerLiteralToken = token.withKind (.integerLiteral (" \( int + 1 ) " ))
195
+
196
+ // Return the new integer literal.
197
+ return Syntax (newIntegerLiteralToken)
195
198
}
196
199
}
197
200
You can’t perform that action at this time.
0 commit comments