@@ -90,7 +90,7 @@ template <class I>
9090using exposition_only_bidirectional_at_most_t =
9191 decltype (exposition_only_bidirectional_at_most<I>()); // @*exposition only*@
9292
93- enum class transcoding_error {
93+ enum class utf_transcoding_error {
9494 truncated_utf8_sequence,
9595 unpaired_high_surrogate,
9696 unpaired_low_surrogate,
@@ -277,11 +277,11 @@ class exposition_only_to_utf_view_impl
277277 return std::move (*this ).curr ();
278278 }
279279
280- /* PAPER: constexpr expected<void, transcoding_error > success() const; */
280+ /* PAPER: constexpr expected<void, utf_transcoding_error > success() const; */
281281
282282 /* !PAPER */
283283
284- constexpr std::expected<void , transcoding_error > success () const {
284+ constexpr std::expected<void , utf_transcoding_error > success () const {
285285 return success_;
286286 }
287287
@@ -411,7 +411,7 @@ class exposition_only_to_utf_view_impl
411411 struct decode_code_point_result {
412412 char32_t c;
413413 std::uint8_t to_incr;
414- std::expected<void , transcoding_error > success;
414+ std::expected<void , utf_transcoding_error > success;
415415 };
416416
417417 template <class >
@@ -450,28 +450,28 @@ class exposition_only_to_utf_view_impl
450450 ++it;
451451 const std::uint8_t lo_bound = 0x80 , hi_bound = 0xBF ;
452452 std::uint8_t to_incr = 1 ;
453- std::expected<void , transcoding_error > success{};
453+ std::expected<void , utf_transcoding_error > success{};
454454
455- auto const error{[&](transcoding_error const error_enum_in) {
455+ auto const error{[&](utf_transcoding_error const error_enum_in) {
456456 success = std::unexpected{error_enum_in};
457457 c = U' \uFFFD ' ;
458458 }};
459459
460460 if (u <= 0x7F ) [[likely]] // 0x00 to 0x7F
461461 c = u;
462462 else if (u < 0xC0 ) [[unlikely]] {
463- error (transcoding_error ::unexpected_utf8_continuation_byte);
463+ error (utf_transcoding_error ::unexpected_utf8_continuation_byte);
464464 } else if (u < 0xC2 || u > 0xF4 ) [[unlikely]] {
465- error (transcoding_error ::invalid_utf8_leading_byte);
465+ error (utf_transcoding_error ::invalid_utf8_leading_byte);
466466 } else if (it == last) [[unlikely]] {
467- error (transcoding_error ::truncated_utf8_sequence);
467+ error (utf_transcoding_error ::truncated_utf8_sequence);
468468 } else if (u <= 0xDF ) // 0xC2 to 0xDF
469469 {
470470 c = u & 0x1F ;
471471 u = *it;
472472
473473 if (u < lo_bound || u > hi_bound) [[unlikely]]
474- error (transcoding_error ::truncated_utf8_sequence);
474+ error (utf_transcoding_error ::truncated_utf8_sequence);
475475 else {
476476 c = (c << 6 ) | (u & 0x3F );
477477 ++it;
@@ -484,21 +484,21 @@ class exposition_only_to_utf_view_impl
484484 u = *it;
485485
486486 if (orig == 0xE0 && 0x80 <= u && u < 0xA0 ) [[unlikely]]
487- error (transcoding_error ::overlong);
487+ error (utf_transcoding_error ::overlong);
488488 else if (orig == 0xED && 0xA0 <= u && u < 0xC0 ) [[unlikely]]
489- error (transcoding_error ::encoded_surrogate);
489+ error (utf_transcoding_error ::encoded_surrogate);
490490 else if (u < lo_bound || u > hi_bound) [[unlikely]]
491- error (transcoding_error ::truncated_utf8_sequence);
491+ error (utf_transcoding_error ::truncated_utf8_sequence);
492492 else if (++it == last) {
493493 [[unlikely]]++ to_incr;
494- error (transcoding_error ::truncated_utf8_sequence);
494+ error (utf_transcoding_error ::truncated_utf8_sequence);
495495 } else {
496496 ++to_incr;
497497 c = (c << 6 ) | (u & 0x3F );
498498 u = *it;
499499
500500 if (u < lo_bound || u > hi_bound) [[unlikely]]
501- error (transcoding_error ::truncated_utf8_sequence);
501+ error (utf_transcoding_error ::truncated_utf8_sequence);
502502 else {
503503 c = (c << 6 ) | (u & 0x3F );
504504 ++it;
@@ -512,31 +512,31 @@ class exposition_only_to_utf_view_impl
512512 u = *it;
513513
514514 if (orig == 0xF0 && 0x80 <= u && u < 0x90 ) [[unlikely]]
515- error (transcoding_error ::overlong);
515+ error (utf_transcoding_error ::overlong);
516516 else if (orig == 0xF4 && 0x90 <= u && u < 0xC0 ) [[unlikely]]
517- error (transcoding_error ::out_of_range);
517+ error (utf_transcoding_error ::out_of_range);
518518 else if (u < lo_bound || u > hi_bound) [[unlikely]]
519- error (transcoding_error ::truncated_utf8_sequence);
519+ error (utf_transcoding_error ::truncated_utf8_sequence);
520520 else if (++it == last) {
521521 [[unlikely]]++ to_incr;
522- error (transcoding_error ::truncated_utf8_sequence);
522+ error (utf_transcoding_error ::truncated_utf8_sequence);
523523 } else {
524524 ++to_incr;
525525 c = (c << 6 ) | (u & 0x3F );
526526 u = *it;
527527
528528 if (u < lo_bound || u > hi_bound) [[unlikely]]
529- error (transcoding_error ::truncated_utf8_sequence);
529+ error (utf_transcoding_error ::truncated_utf8_sequence);
530530 else if (++it == last) {
531531 [[unlikely]]++ to_incr;
532- error (transcoding_error ::truncated_utf8_sequence);
532+ error (utf_transcoding_error ::truncated_utf8_sequence);
533533 } else {
534534 ++to_incr;
535535 c = (c << 6 ) | (u & 0x3F );
536536 u = *it;
537537
538538 if (u < lo_bound || u > hi_bound) [[unlikely]]
539- error (transcoding_error ::truncated_utf8_sequence);
539+ error (utf_transcoding_error ::truncated_utf8_sequence);
540540 else {
541541 c = (c << 6 ) | (u & 0x3F );
542542 ++it;
@@ -560,9 +560,9 @@ class exposition_only_to_utf_view_impl
560560 std::uint16_t u = *it;
561561 ++it;
562562 std::uint8_t to_incr = 1 ;
563- std::expected<void , transcoding_error > success{};
563+ std::expected<void , utf_transcoding_error > success{};
564564
565- auto const error{[&](transcoding_error const error_enum_in) {
565+ auto const error{[&](utf_transcoding_error const error_enum_in) {
566566 success = std::unexpected{error_enum_in};
567567 c = U' \uFFFD ' ;
568568 }};
@@ -571,11 +571,11 @@ class exposition_only_to_utf_view_impl
571571 c = u;
572572 else if (u < 0xDC00 ) {
573573 if (it == last) [[unlikely]] {
574- error (transcoding_error ::unpaired_high_surrogate);
574+ error (utf_transcoding_error ::unpaired_high_surrogate);
575575 } else {
576576 std::uint16_t u2 = *it;
577577 if (u2 < 0xDC00 || u2 > 0xDFFF ) [[unlikely]]
578- error (transcoding_error ::unpaired_high_surrogate);
578+ error (utf_transcoding_error ::unpaired_high_surrogate);
579579 else {
580580 ++it;
581581 to_incr = 2 ;
@@ -585,7 +585,7 @@ class exposition_only_to_utf_view_impl
585585 }
586586 }
587587 } else
588- error (transcoding_error ::unpaired_low_surrogate);
588+ error (utf_transcoding_error ::unpaired_low_surrogate);
589589
590590 return {.c {c}, .to_incr {to_incr}, .success {success}};
591591 }
@@ -598,18 +598,18 @@ class exposition_only_to_utf_view_impl
598598 static constexpr decode_code_point_result decode_code_point_utf32_impl (
599599 exposition_only_innermost_iter& it) {
600600 char32_t c = *it;
601- std::expected<void , transcoding_error > success{};
601+ std::expected<void , utf_transcoding_error > success{};
602602 ++it;
603- auto const error{[&](transcoding_error const error_enum_in) {
603+ auto const error{[&](utf_transcoding_error const error_enum_in) {
604604 success = std::unexpected{error_enum_in};
605605 c = U' \uFFFD ' ;
606606 }};
607607 if (c >= 0xD800 ) {
608608 if (c < 0xE000 ) {
609- error (transcoding_error ::encoded_surrogate);
609+ error (utf_transcoding_error ::encoded_surrogate);
610610 }
611611 if (c > 0x10FFFF ) {
612- error (transcoding_error ::out_of_range);
612+ error (utf_transcoding_error ::out_of_range);
613613 }
614614 }
615615 return {.c {c}, .to_incr {1 }, .success {success}};
@@ -710,7 +710,7 @@ class exposition_only_to_utf_view_impl
710710 .decode_result {.c {U' \uFFFD ' },
711711 .to_incr {1 },
712712 .success {std::unexpected{
713- transcoding_error ::unexpected_utf8_continuation_byte}}},
713+ utf_transcoding_error ::unexpected_utf8_continuation_byte}}},
714714 .new_curr {new_curr}};
715715 } else if (detail::is_ascii (*it) || detail::lead_code_unit (*it)) {
716716 int const expected_reversed{detail::utf8_code_units (*it)};
@@ -722,15 +722,15 @@ class exposition_only_to_utf_view_impl
722722 .decode_result {.c {U' \uFFFD ' },
723723 .to_incr {1 },
724724 .success {std::unexpected{
725- transcoding_error ::unexpected_utf8_continuation_byte}}},
725+ utf_transcoding_error ::unexpected_utf8_continuation_byte}}},
726726 .new_curr {new_curr}};
727727 } else {
728728 auto lead{it};
729729 decode_code_point_result const decode_result{
730730 decode_code_point_utf8_impl (it, end ())};
731731 if (decode_result.success ||
732732 decode_result.success ==
733- std::unexpected{transcoding_error ::truncated_utf8_sequence}) {
733+ std::unexpected{utf_transcoding_error ::truncated_utf8_sequence}) {
734734 assert (decode_result.to_incr == reversed);
735735 return {.decode_result {decode_result}, .new_curr {lead}};
736736 } else {
@@ -743,7 +743,7 @@ class exposition_only_to_utf_view_impl
743743 .success {
744744 reversed == 1
745745 ? decode_result.success
746- : std::unexpected{transcoding_error ::
746+ : std::unexpected{utf_transcoding_error ::
747747 unexpected_utf8_continuation_byte}}},
748748 .new_curr {new_curr}};
749749 }
@@ -758,8 +758,8 @@ class exposition_only_to_utf_view_impl
758758 .to_incr {1 },
759759 .success {
760760 reversed == 1
761- ? std::unexpected{transcoding_error ::invalid_utf8_leading_byte}
762- : std::unexpected{transcoding_error ::
761+ ? std::unexpected{utf_transcoding_error ::invalid_utf8_leading_byte}
762+ : std::unexpected{utf_transcoding_error ::
763763 unexpected_utf8_continuation_byte}}},
764764 .new_curr {it}};
765765 }
@@ -774,14 +774,14 @@ class exposition_only_to_utf_view_impl
774774 return {.decode_result {.c {U' \uFFFD ' },
775775 .to_incr {1 },
776776 .success {std::unexpected{
777- transcoding_error ::unpaired_high_surrogate}}},
777+ utf_transcoding_error ::unpaired_high_surrogate}}},
778778 .new_curr {it}};
779779 } else if (detail::low_surrogate (*it)) {
780780 if (it == begin ()) {
781781 return {.decode_result {.c {U' \uFFFD ' },
782782 .to_incr {1 },
783783 .success {std::unexpected{
784- transcoding_error ::unpaired_low_surrogate}}},
784+ utf_transcoding_error ::unpaired_low_surrogate}}},
785785 .new_curr {it}};
786786 } else {
787787 --it;
@@ -795,7 +795,7 @@ class exposition_only_to_utf_view_impl
795795 return {.decode_result {.c {U' \uFFFD ' },
796796 .to_incr {1 },
797797 .success {std::unexpected{
798- transcoding_error ::unpaired_low_surrogate}}},
798+ utf_transcoding_error ::unpaired_low_surrogate}}},
799799 .new_curr {new_curr}};
800800 }
801801 }
@@ -866,7 +866,7 @@ class exposition_only_to_utf_view_impl
866866 std::uint8_t to_increment_ = 0 ; // @*exposition only*@
867867
868868 /* !PAPER */
869- std::expected<void , transcoding_error > success_{}; // @*exposition only*@
869+ std::expected<void , utf_transcoding_error > success_{}; // @*exposition only*@
870870 /* PAPER */
871871 };
872872
0 commit comments