Skip to content

Commit

Permalink
fix #845 (#846)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimikage authored Jun 16, 2024
1 parent f2ed8cd commit ecc9981
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/styles/default/pretty.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ function p_literal(ds::DefaultStyle, cst::CSTParser.EXPR, s::State; from_docstri
if !is_str_or_cmd(cst)
(val = cst.val) === nothing && return FST(LITERAL, loc[2], loc[1], loc[1], "")

if cst.head === :FLOAT
if cst.head === :FLOAT && !startswith(val, "0x")
if (fidx = findlast(==('f'), val)) === nothing
float_suffix = ""
else
Expand Down
2 changes: 2 additions & 0 deletions test/options.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2322,10 +2322,12 @@
@test fmt("1e-2", trailing_zero = true) == "1e-2"
@test fmt("1f0", trailing_zero = true) == "1.0f0"
@test fmt("1.", trailing_zero = true) == "1.0"
@test fmt("0x1.fp0", trailing_zero = true) == "0x1.fp0"

@test fmt("1e-2", trailing_zero = false) == "1e-2"
@test fmt("1f0", trailing_zero = false) == "1f0"
@test fmt("1.", trailing_zero = false) == "1."
@test fmt("0x1.fp0", trailing_zero = false) == "0x1.fp0"
end

@testset "noindent blocks" begin
Expand Down

0 comments on commit ecc9981

Please sign in to comment.