| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // | ||
| 2 | // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com) | ||
| 3 | // | ||
| 4 | // Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
| 5 | // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
| 6 | // | ||
| 7 | // Official repository: https://github.com/boostorg/url | ||
| 8 | // | ||
| 9 | |||
| 10 | #ifndef BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP | ||
| 11 | #define BOOST_URL_GRAMMAR_IMPL_OPTIONAL_RULE_HPP | ||
| 12 | |||
| 13 | #include <boost/url/grammar/error.hpp> | ||
| 14 | |||
| 15 | namespace boost { | ||
| 16 | namespace urls { | ||
| 17 | namespace grammar { | ||
| 18 | |||
| 19 | template<class R> | ||
| 20 | auto | ||
| 21 | 3954 | optional_rule_t<R>:: | |
| 22 | parse( | ||
| 23 | char const*& it, | ||
| 24 | char const* end) const -> | ||
| 25 | system::result<value_type> | ||
| 26 | { | ||
| 27 |
2/2✓ Branch 0 taken 87 times.
✓ Branch 1 taken 1798 times.
|
3954 | if(it == end) |
| 28 | 255 | return boost::none; | |
| 29 | 3699 | auto const it0 = it; | |
| 30 |
0/2✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
3699 | auto rv = |
| 31 | 3699 | this->get().parse(it, end); | |
| 32 |
2/2✓ Branch 1 taken 383 times.
✓ Branch 2 taken 1415 times.
|
3699 | if(rv) |
| 33 |
1/2✓ Branch 2 taken 383 times.
✗ Branch 3 not taken.
|
1537 | return value_type(*rv); |
| 34 | 2162 | it = it0; | |
| 35 | 2162 | return boost::none; | |
| 36 | } | ||
| 37 | |||
| 38 | } // grammar | ||
| 39 | } // urls | ||
| 40 | } // boost | ||
| 41 | |||
| 42 | #endif | ||
| 43 |