Apply suggestion from @Copilot

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
ringabout
2026-01-20 19:40:39 +08:00
committed by GitHub
parent 74f710ad9f
commit 93df03c2ab

View File

@@ -508,7 +508,9 @@ proc getNumber(L: var Lexer, result: var Token) =
# Maximum digits = ceil(bitWidth / bitsPerDigit) = (bitWidth + bitsPerDigit - 1) div bitsPerDigit
let maxDigits = (bitWidth + bitsPerDigit - 1) div bitsPerDigit
if numDigits > maxDigits:
lexMessageLitNum(L, "number has $1 digits but type only supports $2 digits: '$3'" % [$numDigits, $maxDigits, result.literal], startpos, warnLongLiterals)
lexMessageLitNum(L,
"number has " & $numDigits & " digits but type only supports " &
$maxDigits & " digits: '$1'", startpos, warnLongLiterals)
# Bounds checks. Non decimal literals are allowed to overflow the range of
# the datatype as long as their pattern don't overflow _bitwise_, hence