8 This is a [link parser parser].
12 Parser accepting one character in the range `a-z` or `A-Z`. The result of the
13 parser is the accepted character.
17 #include <boost/metaparse/letter.hpp>
19 [h1 Expression semantics]
21 The following are equivalent:
25 accept_when<one_char, util::is_letter<>, error::letter_expected>
29 #include <boost/metaparse/letter.hpp>
30 #include <boost/metaparse/start.hpp>
31 #include <boost/metaparse/string.hpp>
32 #include <boost/metaparse/is_error.hpp>
33 #include <boost/metaparse/get_result.hpp>
35 using namespace boost::metaparse;
38 !is_error<letter::apply<BOOST_METAPARSE_STRING("a"), start>>::type::value,
39 "letter should accept a letter"
43 is_error<letter::apply<BOOST_METAPARSE_STRING("0"), start>>::type::value,
44 "letter should reject a digit"
49 letter::apply<BOOST_METAPARSE_STRING("z"), start>
50 >::type::value == 'z',
51 "the result of parsing should be the character value"