@@ -9,21 +9,21 @@ struct FmtChr <: FmtType end
99struct FmtStr <: FmtType end
1010struct FmtPtr <: FmtType end
1111
12- struct Fmt_e <: FmtType end
13- struct Fmt_f <: FmtType end
14- struct Fmt_g <: FmtType end
15- struct Fmt_a <: FmtType end
12+ struct FmtFltE <: FmtType end
13+ struct FmtFltF <: FmtType end
14+ struct FmtFltG <: FmtType end
15+ struct FmtFltA <: FmtType end
1616
17- struct Fmt_n <: FmtType end
17+ struct FmtN <: FmtType end
1818
1919const VALID_FMTS = b " duoxefgacsipnDUOXEFGACS"
2020
21- const FMT_TYPES = [FmtDec, FmtDec, FmtOct, FmtHex, Fmt_e, Fmt_f, Fmt_g, Fmt_a , FmtChr, FmtStr,
22- FmtDec, FmtPtr, Fmt_n ]
21+ const FMT_TYPES = [FmtDec, FmtDec, FmtOct, FmtHex, FmtFltE, FmtFltF, FmtFltG, FmtFltA , FmtChr, FmtStr,
22+ FmtDec, FmtPtr, FmtN ]
2323
2424# format specifier categories
2525const FmtInts = Union{FmtDec, FmtOct, FmtHex}
26- const FmtFlts = Union{Fmt_e, Fmt_f, Fmt_g, Fmt_a }
26+ const FmtFlts = Union{FmtFltE, FmtFltF, FmtFltG, FmtFltA }
2727
2828"""
2929Typed representation of a format specifier.
@@ -58,7 +58,7 @@ Base.string(f::FmtSpec; modifier::String="") =
5858Base. show (io:: IO , f:: FmtSpec ) = print (io, string (f))
5959
6060floatfmt (s:: FmtSpec ) =
61- FmtSpec {Fmt_f } (s. char, s. tsep, s. leftalign, s. plus, s. space, s. zero, s. altf, s. width, 0 )
61+ FmtSpec {FmtFltF } (s. char, s. tsep, s. leftalign, s. plus, s. space, s. zero, s. altf, s. width, 0 )
6262ptrfmt (s:: FmtSpec , x) =
6363 FmtSpec {FmtHex} (s. char, s. tsep, s. leftalign, s. plus, s. space, s. zero, true , s. width,
6464 ifelse (sizeof (x) == 8 , 16 , 8 ))
@@ -163,7 +163,7 @@ function FmtSpec(f::AbstractString)
163163 if fmttyp <: FmtInts && prec > 0
164164 zero = false
165165 elseif ! parsedprecdigits
166- if (fmttyp === FmtStr || fmttyp === FmtChr || fmttyp === Fmt_a )
166+ if (fmttyp === FmtStr || fmttyp === FmtChr || fmttyp === FmtFltA )
167167 prec = - 1
168168 elseif fmttyp <: FmtFlts
169169 prec = 6
@@ -172,7 +172,7 @@ function FmtSpec(f::AbstractString)
172172 FmtSpec {fmttyp} (b, tsep, leftalign, plus, space, zero, altf, width, prec)
173173end
174174
175- @inline gethexbase (spec) = spec. char < ' a' ? b " 0123456789ABCDEF" : b " 0123456789abcdef"
175+ @inline gethexbase (spec) = spec. char < UInt8 ( ' a' ) ? b " 0123456789ABCDEF" : b " 0123456789abcdef"
176176
177177@inline upchar (spec, ch) = (spec. char & 0x20 ) | UInt8 (ch)
178178
@@ -462,19 +462,19 @@ function _fmt(buf, pos, spec::FmtSpec{T}, arg) where {T <: FmtFlts}
462462 buflen < needed && resize! (buf, pos + needed)
463463
464464 x = tofloat (arg)
465- if T === Fmt_e
465+ if T === FmtFltE
466466 newpos = Ryu. writeexp (buf, pos, x, spec. prec, spec. plus, spec. space,
467467 spec. altf, upchar (spec, ' E' ), UInt8 (' .' ))
468- elseif T === Fmt_f
469- newpos = Ryu. writefixed (buf, pos, x, spec. prec, prec, spec. plus, spec. space,
470- spec . altf, UInt8 (' .' ))
471- elseif T === Fmt_g
468+ elseif T === FmtFltF
469+ newpos = Ryu. writefixed (buf, pos, x, spec. prec, spec. plus, spec. space, spec . altf ,
470+ UInt8 (' .' ))
471+ elseif T === FmtFltG
472472 prec = spec. prec
473473 prec = prec == 0 ? 1 : prec
474474 x = round (x, sigdigits= prec)
475475 newpos = Ryu. writeshortest (buf, pos, x, spec. plus, spec. space, spec. altf, prec,
476476 upchar (spec, ' E' ), true , UInt8 (' .' ))
477- elseif T === Fmt_a
477+ elseif T === FmtFltA
478478 newpos = output_fmt_a (buf, pos, spec, x < 0 , abs (x))
479479 end
480480 if newpos - pos < width
@@ -486,7 +486,7 @@ function _fmt(buf, pos, spec::FmtSpec{T}, arg) where {T <: FmtFlts}
486486 # right aligned
487487 n = width - (newpos - pos)
488488 if spec. zero
489- ex = (arg < 0 || (spec. plus | spec. space)) + ifelse (T === Fmt_a , 2 , 0 )
489+ ex = (arg < 0 || (spec. plus | spec. space)) + ifelse (T === FmtFltA , 2 , 0 )
490490 so = pos + ex
491491 len = (newpos - pos) - ex
492492 copyto! (buf, so + n, buf, so, len)
0 commit comments