Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/value_parsing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
1 change: 1 addition & 0 deletions test/parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,7 @@ tests = [
"```cmd```" => "(macrocall :(Core.var\"@cmd\") \"cmd\")"
# literals
"42" => "42"
"0x123456789abcdefp+0" => "8.19855292164869e16"
# closing tokens
")" => "(error)"
],
Expand Down