| 618 | bool AllowTrailing_, |
| 619 | bool AllowBadUTF8_*/> |
| 620 | const char* |
| 621 | basic_parser<Handler>:: |
| 622 | parse_value(const char* p, |
| 623 | std::integral_constant<bool, StackEmpty_> stack_empty, |
| 624 | std::integral_constant<bool, AllowComments_> allow_comments, |
| 625 | /*std::integral_constant<bool, AllowTrailing_>*/ bool allow_trailing, |
| 626 | /*std::integral_constant<bool, AllowBadUTF8_>*/ bool allow_bad_utf8, |
| 627 | bool allow_bad_utf16) |
| 628 | { |
| 629 | if(stack_empty || st_.empty()) |
| 630 | { |
| 631 | loop: |
| 632 | switch(*p) |
| 633 | { |
| 634 | case '0': |
| 635 | return mp11::mp_with_index<3>( |
| 636 | static_cast<unsigned char>(opt_.numbers), |
| 637 | parse_number_helper<true, '0'>{ this, p }); |
| 638 | case '-': |
| 639 | return mp11::mp_with_index<3>( |
| 640 | static_cast<unsigned char>(opt_.numbers), |
| 641 | parse_number_helper<true, '-'>{ this, p }); |
| 642 | case '1': case '2': case '3': |
| 643 | case '4': case '5': case '6': |
| 644 | case '7': case '8': case '9': |
| 645 | return mp11::mp_with_index<3>( |
| 646 | static_cast<unsigned char>(opt_.numbers), |
| 647 | parse_number_helper<true, '+'>{ this, p }); |
| 648 | case 'n': |
| 649 | return parse_literal( p, detail::literals_c<detail::literals::null>() ); |
| 650 | case 't': |
| 651 | return parse_literal( p, detail::literals_c<detail::literals::true_>() ); |
| 652 | case 'f': |
| 653 | return parse_literal( p, detail::literals_c<detail::literals::false_>() ); |
| 654 | case 'I': |
| 655 | if( !opt_.allow_infinity_and_nan ) |
| 656 | { |
| 657 | BOOST_STATIC_CONSTEXPR source_location loc |
| 658 | = BOOST_CURRENT_LOCATION; |
| 659 | return fail(p, error::syntax, &loc); |
| 660 | } |
| 661 | return parse_literal( p, detail::literals_c<detail::literals::infinity>() ); |
| 662 | case 'N': |
| 663 | if( !opt_.allow_infinity_and_nan ) |
| 664 | { |
| 665 | BOOST_STATIC_CONSTEXPR source_location loc |
| 666 | = BOOST_CURRENT_LOCATION; |
| 667 | return fail(p, error::syntax, &loc); |
| 668 | } |
| 669 | return parse_literal(p, detail::literals_c<detail::literals::nan>() ); |
| 670 | case '"': |
| 671 | return parse_string(p, std::true_type(), std::false_type(), allow_bad_utf8, allow_bad_utf16); |
| 672 | case '[': |
| 673 | return parse_array(p, std::true_type(), allow_comments, allow_trailing, allow_bad_utf8, allow_bad_utf16); |
| 674 | case '{': |
| 675 | return parse_object(p, std::true_type(), allow_comments, allow_trailing, allow_bad_utf8, allow_bad_utf16); |
| 676 | case '/': |
| 677 | if(! allow_comments) |
nothing calls this directly
no test coverage detected