@@ -268,7 +268,7 @@ template <typename UC> struct parsed_number_string_t {
268
268
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
269
269
bool negative{false };
270
270
#endif
271
- bool valid {false };
271
+ bool invalid {false };
272
272
bool too_many_digits{false };
273
273
// contains the range of the significant digits
274
274
span<UC const > integer{}; // non-nullable
@@ -283,7 +283,7 @@ template <typename UC>
283
283
fastfloat_really_inline FASTFLOAT_CONSTEXPR20 parsed_number_string_t <UC>
284
284
report_parse_error (UC const *p, parse_error error) noexcept {
285
285
parsed_number_string_t <UC> answer;
286
- answer.valid = false ;
286
+ answer.invalid = true ;
287
287
answer.lastmatch = p;
288
288
answer.error = error;
289
289
return answer;
@@ -299,7 +299,8 @@ parse_number_string(UC const *p, UC const *pend,
299
299
// Consider refactoring the 'parse_number_string' function.
300
300
// FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN fix this.
301
301
parsed_number_string_t <UC> answer;
302
- FASTFLOAT_ASSUME (p < pend); // so dereference without checks;
302
+ // so dereference without checks
303
+ FASTFLOAT_ASSUME (p < pend);
303
304
#ifndef FASTFLOAT_ONLY_POSITIVE_C_NUMBER_WO_INF_NAN
304
305
answer.negative = (*p == UC (' -' ));
305
306
if (answer.negative ||
@@ -312,15 +313,15 @@ parse_number_string(UC const *p, UC const *pend,
312
313
p, parse_error::missing_integer_or_dot_after_sign);
313
314
}
314
315
FASTFLOAT_IF_CONSTEXPR17 (basic_json_fmt) {
315
- if (!is_integer (*p)) { // a sign must be followed by an integer
316
+ // a sign must be followed by an integer
317
+ if (!is_integer (*p)) {
316
318
return report_parse_error<UC>(p,
317
319
parse_error::missing_integer_after_sign);
318
320
}
319
321
}
320
322
else {
321
- if (!is_integer (*p) &&
322
- (*p != options.decimal_point )) { // a sign must be followed by an
323
- // integer or the dot
323
+ // a sign must be followed by an integer or the dot
324
+ if (!is_integer (*p) && (*p != options.decimal_point )) {
324
325
return report_parse_error<UC>(
325
326
p, parse_error::missing_integer_or_dot_after_sign);
326
327
}
@@ -459,7 +460,6 @@ parse_number_string(UC const *p, UC const *pend,
459
460
460
461
// We parsed all parts of the number, let's save progress.
461
462
answer.lastmatch = p;
462
- answer.valid = true ;
463
463
464
464
// Now we can check for errors.
465
465
0 commit comments