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 | 3976 | 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 88 times.
✓ Branch 1 taken 1819 times.
|
3976 | if(it == end) |
28 | 256 | return boost::none; | |
29 | 3720 | auto const it0 = it; | |
30 | auto rv = | ||
31 |
0/2✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
3720 | this->get().parse(it, end); |
32 |
2/2✓ Branch 1 taken 384 times.
✓ Branch 2 taken 1435 times.
|
3720 | if(rv) |
33 |
1/2✓ Branch 2 taken 384 times.
✗ Branch 3 not taken.
|
1538 | return value_type(*rv); |
34 | 2182 | it = it0; | |
35 | 2182 | return boost::none; | |
36 | } | ||
37 | |||
38 | } // grammar | ||
39 | } // urls | ||
40 | } // boost | ||
41 | |||
42 | #endif | ||
43 |