Using Boost.Hana causes hard compiler errors in some attribute propagation paths
还没有人认领这个 Issue。
评估
调研方向
Start in parser.hpp at the semantic action dispatch and attribute assembling paths around the two locations shown in the issue. Check how tuple operations follow BOOST_PARSER_USE_HANA_TUPLE elsewhere, then build the Mutable Symbol Tables tutorial example with Hana tuples. Done means the example builds and the existing std::tuple path still works.
由索引模型根据 Issue 内容生成。
描述
It seems semantic action dispatch and attribute "assembling" is hardcoded to use std::tuple ignoring BOOST_PARSER_USE_HANA_TUPLE flag.
Tutorial's example for Mutable Symbol Tables fails during build if uses Hana tuples (as current version of tutorial does).
Here is brief patch, which most likely don't follow library conventions but should make this issue visible:
diff --git a/parser.hpp b/parser.hpp
index 6a32dfb..18e8f51 100644
--- a/parser.hpp
+++ b/parser.hpp
@@ -3548,9 +3548,17 @@ namespace boost { namespace parser {
};
detail::skip(first, last, skip, flags);
+#if defined(BOOST_PARSER_USE_HANA_TUPLE)
+ boost::hana::unpack(parsers_, [&try_parser](auto&&... args) {
+#else
std::apply([&try_parser](auto&&... args) {
+#endif
((try_parser(args)), ...);
+#if defined(BOOST_PARSER_USE_HANA_TUPLE)
+ });
+#else
}, parsers_);
+#endif
if (!done)
success = false;
@@ -4608,9 +4616,18 @@ namespace boost { namespace parser {
auto const parsers_and_indices =
detail::hl::zip(parsers_, indices, merged, backtracking{});
+#if defined(BOOST_PARSER_USE_HANA_TUPLE)
+ boost::hana::unpack(
+ parsers_and_indices, [&use_parser](auto&&... args) {
+#else
std::apply([&use_parser](auto&&... args) {
+#endif
((use_parser(args)), ...);
+#if defined(BOOST_PARSER_USE_HANA_TUPLE)
+ });
+#else
}, parsers_and_indices);
+#endif
}
template<bool AllowBacktracking, typename Parser>
- 主要语言
- C++
- 星标
- 185
- 派生
- 28
- 平均合并
- 20 小时 44 分钟
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
boostorg/parser 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 35/100
-
难度 5/5 一周以上 新手友好度 20/100
-
难度 5/5 一周以上 新手友好度 25/100
-
难度 3/5 1-2 天 新手友好度 35/100
相似的 Issue
-
kind/enhancement
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1-3 小时 新手友好度 82/100
psi29a/d2decomped#691 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
CachyOS/packageinstaller#144 ·
维护者通常 1 天内回复
-
(S1 - Need confirmation)
难度 2/5 1-3 小时 新手友好度 62/100
CleverRaven/Cataclysm-DDA#89715 ·
维护者通常 1 天内回复
-
prio:low type:bug
难度 2/5 1-3 小时 新手友好度 72/100
NatronGitHub/Natron#1638 ·
维护者通常 1 天内回复