Using Boost.Hana causes hard compiler errors in some attribute propagation paths
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
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.
Written by the indexing model from the issue text.
Description
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>
- Dominant language
- C++
- Stars
- 185
- Forks
- 28
- Avg merge
- 20h 44m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from boostorg/parser
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Similar issues
-
agent:WSL code-review linux pri:medium refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
kind/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 82/100
psi29a/d2decomped#691 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
CachyOS/packageinstaller#144 ·
Maintainers usually reply within 1 day
-
(S1 - Need confirmation)
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
CleverRaven/Cataclysm-DDA#89715 ·
Maintainers usually reply within 1 day