9 This is a [link parser_combinator parser combinator].
13 [[`P`] [[link parser parser]]]
18 It applies `P` on the input string repeatedly as long as the parser accepts the
19 input. The result of parsing is a sequence of the results of the individual
22 When `P` rejects the input for the first time, `repeated1` rejects it as well.
23 At least one successful application of `P` is required for `repeated1` to accept
28 #include <boost/metaparse/repeated1.hpp>
30 [h1 Expression semantics]
32 For any `p` parser the following are equivalent:
36 last_of<look_ahead<p>, repeated<p>>
40 #include <boost/metaparse/repeated1.hpp>
41 #include <boost/metaparse/digit_val.hpp>
42 #include <boost/metaparse/start.hpp>
43 #include <boost/metaparse/string.hpp>
44 #include <boost/metaparse/get_result.hpp>
45 #include <boost/metaparse/is_error.hpp>
47 #include <boost/mpl/equal.hpp>
48 #include <boost/mpl/vector.hpp>
49 #include <boost/mpl/int.hpp>
51 using namespace boost::metaparse;
53 using digits = repeated1<digit_val>;
57 get_result<digits::apply<BOOST_METAPARSE_STRING("1234"), start>>::type,
65 "the result of parsing should be the list of digit values"
69 is_error<digits::apply<BOOST_METAPARSE_STRING("x"), start>>::type::value,
70 "repeated1 should reject the input when it can't parse anything with digit_val"