Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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"
"0x1.428a2f98d728bp+341" => "5.643803094122362e102"
Comment thread
KristofferC marked this conversation as resolved.
Outdated
# closing tokens
")" => "(error)"
],
Expand Down