From 63ff7452b3becd313b16c52d7395ad9f8933c9ff Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Sat, 26 Sep 2026 03:44:28 +0900 Subject: [PATCH 1/7] Normalize wrapped types in alternative --- include/iris/x4/operator/alternative.hpp | 33 +++++++++++++++++++++++- test/x4/alternative.cpp | 16 ++++++++++++ 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/include/iris/x4/operator/alternative.hpp b/include/iris/x4/operator/alternative.hpp index f80c31f86..bd9eb1803 100644 --- a/include/iris/x4/operator/alternative.hpp +++ b/include/iris/x4/operator/alternative.hpp @@ -54,6 +54,37 @@ struct to_alternative_attribute_list> // ------------------------------------------------------------- +template +struct alternative_wrapped_entry {}; + +template +struct alternative_entry {}; + +template + requires is_recursive_wrapper_v +struct alternative_entry + : alternative_wrapped_entry, T> +{}; + +template +struct alternative_entries + : alternative_entry... +{}; + +template +Wrapped alternative_wrapped_form(alternative_wrapped_entry, Wrapped>*); + +template +T alternative_wrapped_form(...); + +template +struct unique_alternative_list; + +template +struct unique_alternative_list> + : unique_type_list(static_cast*>(nullptr)))...>> +{}; + template struct canonicalize_alternative_attribute; @@ -87,7 +118,7 @@ struct alternative_layout typename to_alternative_attribute_list::attribute_type>::type, typename to_alternative_attribute_list::attribute_type>::type... >::type; - using unique_attrs = unique_type_list::type; + using unique_attrs = unique_alternative_list::type>::type; using attribute_type = canonicalize_alternative_attribute::type; // All branches share one attribute type and one slot count; the diff --git a/test/x4/alternative.cpp b/test/x4/alternative.cpp index 600373ebe..3b0e1220a 100644 --- a/test/x4/alternative.cpp +++ b/test/x4/alternative.cpp @@ -12,10 +12,12 @@ #include +#include #include #include #include +#include #include #include #include @@ -91,6 +93,20 @@ TEST_CASE("alternative") STATIC_CHECK(std::same_as::attribute_type, rvariant>); STATIC_CHECK(std::same_as::attribute_type, rvariant>); + { + // `T` and `recursive_wrapper` are one alternative; the wrapped form is kept, at the first position + using iris::recursive_wrapper; + using x4::as; + using x4::standard::alpha; + constexpr auto plain = as(+alpha); + constexpr auto wrapped = as>(lit('#') >> +alpha); + + STATIC_CHECK(std::same_as::attribute_type, recursive_wrapper>); + STATIC_CHECK(std::same_as::attribute_type, recursive_wrapper>); + STATIC_CHECK(std::same_as::attribute_type, rvariant, int>>); + STATIC_CHECK(std::same_as::attribute_type, rvariant>>); + } + IRIS_X4_ASSERT_CONSTEXPR_CTORS(char_ | char_); { From 3b87544cd6000fb49e2b3fc98e52bbbd3de28564 Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Sun, 27 Sep 2026 02:04:30 +0900 Subject: [PATCH 2/7] Fix inclusion of global header --- include/iris/x4.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/iris/x4.hpp b/include/iris/x4.hpp index 55dd2fd0d..870dccd09 100644 --- a/include/iris/x4.hpp +++ b/include/iris/x4.hpp @@ -17,12 +17,14 @@ #include #include #include -#include #include #include #include +#include #include #include +#include + #endif From 30bd24edb366df751b4ecfdfe5fc2a11f62ba81e Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Sun, 27 Sep 2026 02:15:09 +0900 Subject: [PATCH 3/7] Update iris for new identity_bases related API --- modules/iris | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/iris b/modules/iris index 6917f1f78..b37f41ee4 160000 --- a/modules/iris +++ b/modules/iris @@ -1 +1 @@ -Subproject commit 6917f1f78dff6ef5f85a12b533418be7b3297ffb +Subproject commit b37f41ee481caffb0264836bf350ca3934394040 From 0bd274e0d404c0dfc4a2382026ae1d0cd3c74013 Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Sun, 27 Sep 2026 03:12:38 +0900 Subject: [PATCH 4/7] Fix alloy::tuple constraint bug --- modules/iris | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/iris b/modules/iris index b37f41ee4..f5cc835b1 160000 --- a/modules/iris +++ b/modules/iris @@ -1 +1 @@ -Subproject commit b37f41ee481caffb0264836bf350ca3934394040 +Subproject commit f5cc835b1557d60caeaee04b450c4dc010e80f1d From 7970d467b712a076da927d5e4dbd82cb65ffb334 Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Tue, 29 Sep 2026 00:26:02 +0900 Subject: [PATCH 5/7] Update iris for stricter narrowing checker --- modules/iris | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/iris b/modules/iris index f5cc835b1..7e282d918 160000 --- a/modules/iris +++ b/modules/iris @@ -1 +1 @@ -Subproject commit f5cc835b1557d60caeaee04b450c4dc010e80f1d +Subproject commit 7e282d918ab9c86264f93c4f95730a80f6c10f84 From 1aef89934d5d19053309721d271d49f45150f20c Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Tue, 29 Sep 2026 03:33:16 +0900 Subject: [PATCH 6/7] Remove global identifiers --- include/iris/x4/char/char_class.hpp | 15 --------------- test/x4/actions.cpp | 4 +++- test/x4/kleene.cpp | 8 ++++---- test/x4/parser.cpp | 2 +- test/x4/plus.cpp | 8 ++++---- 5 files changed, 12 insertions(+), 25 deletions(-) diff --git a/include/iris/x4/char/char_class.hpp b/include/iris/x4/char/char_class.hpp index 8740300e6..4208eeb50 100644 --- a/include/iris/x4/char/char_class.hpp +++ b/include/iris/x4/char/char_class.hpp @@ -131,21 +131,6 @@ IRIS_X4_CHAR_CLASSES(standard_wide) #undef IRIS_X4_CHAR_CLASS #undef IRIS_X4_CHAR_CLASSES -// Don't put these in namespace `parsers`, these are too much - -using x4::standard::alnum; -using x4::standard::alpha; -using x4::standard::digit; -using x4::standard::xdigit; -using x4::standard::cntrl; -using x4::standard::graph; -using x4::standard::lower; -using x4::standard::print; -using x4::standard::punct; -using x4::standard::space; -using x4::standard::blank; -using x4::standard::upper; - namespace detail { diff --git a/test/x4/actions.cpp b/test/x4/actions.cpp index 96fb0fdc1..ca0723101 100644 --- a/test/x4/actions.cpp +++ b/test/x4/actions.cpp @@ -18,6 +18,8 @@ TEST_CASE("action") { using x4::int_; + using x4::standard::digit; + using x4::standard::space; IRIS_X4_ASSERT_CONSTEXPR_CTORS(x4::int_.on_match(std::true_type{})); @@ -35,7 +37,7 @@ TEST_CASE("action") next = x4::_attr(ctx); }; - REQUIRE(parse(input, x4::int_.on_match(fail) | x4::digit.on_match(setnext), x4::space).is_partial_match()); + REQUIRE(parse(input, int_.on_match(fail) | digit.on_match(setnext), space).is_partial_match()); CHECK(next == '1'); } diff --git a/test/x4/kleene.cpp b/test/x4/kleene.cpp index a86e37f0b..8adcf8d64 100644 --- a/test/x4/kleene.cpp +++ b/test/x4/kleene.cpp @@ -22,10 +22,10 @@ TEST_CASE("kleene") { using x4::char_; - using x4::alpha; - using x4::upper; - using x4::space; - using x4::digit; + using x4::standard::alpha; + using x4::standard::upper; + using x4::standard::space; + using x4::standard::digit; using x4::int_; using x4::lexeme; diff --git a/test/x4/parser.cpp b/test/x4/parser.cpp index 0ed6165bf..0b0d86608 100644 --- a/test/x4/parser.cpp +++ b/test/x4/parser.cpp @@ -95,7 +95,7 @@ struct minimal_binary_unused_parser TEST_CASE("parser") { - using x4::blank; + using x4::standard::blank; { using It = std::string_view::const_iterator; diff --git a/test/x4/plus.cpp b/test/x4/plus.cpp index 8b792f198..71796c10c 100644 --- a/test/x4/plus.cpp +++ b/test/x4/plus.cpp @@ -26,10 +26,10 @@ TEST_CASE("plus") { using x4::char_; - using x4::alpha; - using x4::upper; - using x4::space; - using x4::digit; + using x4::standard::alpha; + using x4::standard::upper; + using x4::standard::space; + using x4::standard::digit; using x4::no_case; using x4::int_; using x4::omit; From a9481b2ac6b63e08ac68c3b1e4556b3feedf9892 Mon Sep 17 00:00:00 2001 From: Nana Sakisaka <1901813+saki7@users.noreply.github.com> Date: Wed, 30 Sep 2026 09:53:14 +0900 Subject: [PATCH 7/7] Update iris for preventing eager instantiation in colorizer --- modules/iris | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/iris b/modules/iris index 7e282d918..35ec512bb 160000 --- a/modules/iris +++ b/modules/iris @@ -1 +1 @@ -Subproject commit 7e282d918ab9c86264f93c4f95730a80f6c10f84 +Subproject commit 35ec512bbecb7f6a0fa890386d08bf78a3b41f4b