299299 end
300300
301301 # start parsing digits or decimal point; we start digits as UInt64(0) and can _widen type if needed
302- x, code, pos = parsedigits (conf, source, pos, len, b, code, options, decimal, UInt64 (0 ), neg, startpos)
302+ x, code, pos = parsedigits_context (conf, source, pos, len, b, code, options, decimal, UInt64 (0 ), neg, startpos)
303303 if ! isfinite (x)
304304 code |= SPECIAL_VALUE
305305 end
@@ -334,10 +334,18 @@ getx(x, f) = f === nothing ? x : nothing
334334# statically compiled (`juliac --trim`) binary the widened instance doesn't exist, so
335335# parsing a wide-digit float would fail at runtime. The `@noinline` wrappers keep each
336336# ladder step compiling separately, which is what bounds base-case compilation.
337- @noinline _parsedigits (conf:: AbstractConf{T} , source, pos, len, b, code, options, decimal :: UInt8 , digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool , ndigits:: Int , f:: F ) where {T, IntType, F} =
338- parsedigits (conf, source, pos, len, b, code, options, decimal, digits, neg, startpos, overflow_invalid, ndigits, f):: Tuple{rettype(T), ReturnCode, Int}
337+ @noinline _parsedigits (conf:: AbstractConf{T} , source, pos, len, b, code, options, digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool , ndigits:: Int , f:: F ) where {T, IntType, F} =
338+ parsedigits (conf, source, pos, len, b, code, options, digits, neg, startpos, overflow_invalid, ndigits, f):: Tuple{rettype(T), ReturnCode, Int}
339339
340- @inline function parsedigits (conf:: AbstractConf{T} , source, pos, len, b, code, options, decimal:: UInt8 , digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool = false , ndigits:: Int = 0 , f:: F = nothing ) where {T, IntType, F}
340+ @noinline _parsedigits_context (conf:: AbstractConf{T} , source, pos, len, b, code, options, decimal:: UInt8 , digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool , ndigits:: Int , f:: F ) where {T, IntType, F} =
341+ parsedigits_context (conf, source, pos, len, b, code, options, decimal, digits, neg, startpos, overflow_invalid, ndigits, f):: Tuple{rettype(T), ReturnCode, Int}
342+
343+ # Custom AbstractConf implementations use this entry point. Keep its historical
344+ # signature and decimal behavior while built-in parsers pass explicit context.
345+ @inline parsedigits (conf:: AbstractConf{T} , source, pos, len, b, code, options, digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool = false , ndigits:: Int = 0 , f:: F = nothing ) where {T, IntType, F} =
346+ parsedigits_context (conf, source, pos, len, b, code, options, options. decimal, digits, neg, startpos, overflow_invalid, ndigits, f)
347+
348+ @inline function parsedigits_context (conf:: AbstractConf{T} , source, pos, len, b, code, options, decimal:: UInt8 , digits:: IntType , neg:: Bool , startpos, overflow_invalid:: Bool = false , ndigits:: Int = 0 , f:: F = nothing ) where {T, IntType, F}
341349 x = zero (T)
342350 anydigits = false
343351 has_groupmark = _has_groupmark (options, code)
@@ -351,7 +359,7 @@ getx(x, f) = f === nothing ? x : nothing
351359 while true
352360 if b <= 0x09
353361 if overflows (IntType) && digits > overflowval (IntType)
354- return _parsedigits (conf, source, pos, len, b + UInt8 (' 0' ), code, options, decimal, _widen (digits), neg, startpos, overflow_invalid, ndigits, f):: Tuple{rettype(T), ReturnCode, Int}
362+ return _parsedigits_context (conf, source, pos, len, b + UInt8 (' 0' ), code, options, decimal, _widen (digits), neg, startpos, overflow_invalid, ndigits, f):: Tuple{rettype(T), ReturnCode, Int}
355363 elseif ndigits > maxdigits (T)
356364 # if input is way too big, just bail
357365 fastseek! (source, startpos - 1 )
0 commit comments