File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed
Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -222,6 +222,8 @@ struct LexFloatResult : LexResult {
222222 // The payload if we lexed a nan with payload. We cannot store the payload
223223 // directly in `d` because we do not know at this point whether we are parsing
224224 // an f32 or f64 and therefore we do not know what the allowable payloads are.
225+ // No payload with NaN means to use the default payload for the expected float
226+ // width.
225227 std::optional<uint64_t > nanPayload;
226228 double d;
227229};
@@ -602,6 +604,9 @@ std::optional<LexFloatResult> float_(std::string_view in) {
602604 // TODO: Add error production for malformed NaN payload.
603605 return {};
604606 }
607+ } else {
608+ // No explicit payload necessary; we will inject the default payload
609+ // later.
605610 }
606611 } else {
607612 return {};
Original file line number Diff line number Diff line change @@ -69,6 +69,8 @@ struct FloatTok {
6969 // The payload if we lexed a nan with payload. We cannot store the payload
7070 // directly in `d` because we do not know at this point whether we are parsing
7171 // an f32 or f64 and therefore we do not know what the allowable payloads are.
72+ // No payload with NaN means to use the default payload for the expected float
73+ // width.
7274 std::optional<uint64_t > nanPayload;
7375 double d;
7476
You can’t perform that action at this time.
0 commit comments