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

Function compile_attribute_unicode_utf32

test/compile_attribute.cpp:360–460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

358}
359
360void compile_attribute_unicode_utf32()
361{
362 {
363 char32_t const chars[] = {0};
364 auto first = std::begin(chars);
365 auto const last = std::end(chars);
366
367 {
368 constexpr auto parser = char_;
369 using attr_t = decltype(prefix_parse(first, last, parser));
370 static_assert(std::is_same_v<attr_t, std::optional<char32_t>>);
371 static_assert(std::is_same_v<
372 attribute_t<
373 decltype(BOOST_PARSER_SUBRANGE(first, last)),
374 decltype(parser)>,
375 char32_t>);
376 }
377 {
378 constexpr auto parser = *char_;
379 using attr_t = decltype(prefix_parse(first, last, parser));
380 static_assert(std::is_same_v<attr_t, std::optional<std::string>>);
381 static_assert(std::is_same_v<
382 attribute_t<
383 decltype(BOOST_PARSER_SUBRANGE(first, last)),
384 decltype(parser)>,
385 std::string>);
386 }
387 {
388 constexpr auto parser = string("foo");
389 using attr_t = decltype(prefix_parse(first, last, parser));
390 static_assert(std::is_same_v<attr_t, std::optional<std::string>>);
391 static_assert(std::is_same_v<
392 attribute_t<
393 decltype(BOOST_PARSER_SUBRANGE(first, last)),
394 decltype(parser)>,
395 std::string>);
396 }
397 {
398 constexpr auto parser = char_ >> string("foo");
399 using attr_t = decltype(prefix_parse(first, last, parser));
400 static_assert(std::is_same_v<attr_t, std::optional<std::string>>);
401 static_assert(std::is_same_v<
402 attribute_t<
403 decltype(BOOST_PARSER_SUBRANGE(first, last)),
404 decltype(parser)>,
405 std::string>);
406 }
407 {
408 constexpr auto parser = string("foo") >> char_;
409 using attr_t = decltype(prefix_parse(first, last, parser));
410 static_assert(std::is_same_v<attr_t, std::optional<std::string>>);
411 static_assert(std::is_same_v<
412 attribute_t<
413 decltype(BOOST_PARSER_SUBRANGE(first, last)),
414 decltype(parser)>,
415 std::string>);
416 }
417 }

Callers 1

compile_attributeFunction · 0.85

Calls 5

prefix_parseFunction · 0.85
beginFunction · 0.50
endFunction · 0.50
stringClass · 0.50
parseFunction · 0.50

Tested by

no test coverage detected