MCPcopy Create free account
hub / github.com/boostorg/parser / compile_attribute

Function compile_attribute

test/compile_attribute.cpp:986–1560  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984}
985
986void compile_attribute()
987{
988 compile_attribute_non_unicode();
989 compile_attribute_unicode_utf8();
990 compile_attribute_unicode_utf32();
991 compile_attribute_sentinel();
992
993 char const chars[] = "";
994 auto first = std::begin(chars);
995 auto const last = std::end(chars);
996
997 {
998 constexpr auto parser = eps;
999 using attr_t = decltype(prefix_parse(first, last, parser));
1000 static_assert(std::is_same_v<attr_t, bool>);
1001 static_assert(std::is_same_v<
1002 attribute_t<
1003 decltype(BOOST_PARSER_SUBRANGE(first, last)),
1004 decltype(parser)>,
1005 none>);
1006 }
1007 {
1008 constexpr auto parser = eol;
1009 using attr_t = decltype(prefix_parse(first, last, parser));
1010 static_assert(std::is_same_v<attr_t, bool>);
1011 static_assert(std::is_same_v<
1012 attribute_t<
1013 decltype(BOOST_PARSER_SUBRANGE(first, last)),
1014 decltype(parser)>,
1015 none>);
1016 }
1017 {
1018 constexpr auto parser = eoi;
1019 using attr_t = decltype(prefix_parse(first, last, parser));
1020 static_assert(std::is_same_v<attr_t, bool>);
1021 static_assert(std::is_same_v<
1022 attribute_t<
1023 decltype(BOOST_PARSER_SUBRANGE(first, last)),
1024 decltype(parser)>,
1025 none>);
1026 }
1027 {
1028 constexpr auto parser = attr(3.0);
1029 using attr_t = decltype(prefix_parse(first, last, parser));
1030 static_assert(std::is_same_v<attr_t, std::optional<double>>);
1031 static_assert(std::is_same_v<
1032 attribute_t<
1033 decltype(BOOST_PARSER_SUBRANGE(first, last)),
1034 decltype(parser)>,
1035 double>);
1036 }
1037 {
1038 constexpr auto parser = attr('c');
1039 using attr_t = decltype(prefix_parse(first, last, parser));
1040 static_assert(std::is_same_v<attr_t, std::optional<char>>);
1041 static_assert(std::is_same_v<
1042 attribute_t<
1043 decltype(BOOST_PARSER_SUBRANGE(first, last)),

Callers 1

mainFunction · 0.85

Calls 12

prefix_parseFunction · 0.85
attrFunction · 0.85
litFunction · 0.85
if_Function · 0.85
switch_Function · 0.85
beginFunction · 0.50
endFunction · 0.50
stringClass · 0.50

Tested by 1

mainFunction · 0.68