We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d4bba6e + b7f6338 commit 9ecc5e2Copy full SHA for 9ecc5e2
Sources/SwiftFormatRules/GroupNumericLiterals.swift
@@ -59,11 +59,15 @@ public final class GroupNumericLiterals: SyntaxFormatRule {
59
}
60
61
newDigits = isNegative ? "-" + newDigits : newDigits
62
- let result = node.withDigits(
63
- SyntaxFactory.makeIntegerLiteral(
64
- newDigits,
65
- leadingTrivia: node.digits.leadingTrivia,
66
- trailingTrivia: node.digits.trailingTrivia))
+ guard
+ let result = node.withDigits(
+ SyntaxFactory.makeIntegerLiteral(
+ newDigits,
+ leadingTrivia: node.digits.leadingTrivia,
67
+ trailingTrivia: node.digits.trailingTrivia))
68
+ else {
69
+ return ExprSyntax(node)
70
+ }
71
return ExprSyntax(result)
72
73
0 commit comments