diff --git a/src/value_parsing.jl b/src/value_parsing.jl index d6d9bc99..e2c1bb69 100644 --- a/src/value_parsing.jl +++ b/src/value_parsing.jl @@ -20,7 +20,7 @@ function julia_string_to_number(str::AbstractString, kind) end return x elseif kind == K"Float" - if !startswith(str,"0x") && 'f' in str + if !startswith(str,"0x") && 'f' in str && !('p' in str) # This is kind of awful. Should we have a separate Float32 literal # type produced by the lexer? The `f` suffix is nonstandard after all. return Base.parse(Float32, replace(str, 'f'=>'e')) diff --git a/test/parser.jl b/test/parser.jl index ec6005da..d40034cc 100644 --- a/test/parser.jl +++ b/test/parser.jl @@ -641,6 +641,7 @@ tests = [ "```cmd```" => "(macrocall :(Core.var\"@cmd\") \"cmd\")" # literals "42" => "42" + "0x123456789abcdefp+0" => "8.19855292164869e16" # closing tokens ")" => "(error)" ],