Open
Conversation
This reverts commit a192159.
`vector<subrange<...>>` needs special handling
Member
|
@yaito3014 Reassigning due to non-rule-related tests still failing, please check the build log. |
saki7
reviewed
Mar 2, 2026
| // iris::rvariant<int, double> is "broader" than int | ||
| STATIC_CHECK( x4::traits::can_hold_v<iris::rvariant<int, double>, int>); | ||
| STATIC_CHECK(!x4::traits::can_hold_v<int, iris::rvariant<int, double>>); | ||
| } |
Member
|
Removed the label "help wanted". "help wanted" and "good first issue" are special labels that GitHub uses it for advertising the repository issues to potential contributors. When you apply this label, it's recognized by GitHub's recommendation engine to make the issue appear on GitHub's top page feed. Please add this label to a context-free, easy tasks only. |
This was referenced Mar 4, 2026
Member
Author
|
supersedes #50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
partially addresses #25
supersedes and closes #50
including:
is_substitutetocan_holdparse_into_containerwith constexpr ifmove_towithsubrangehandlingTodo
pass_attibute_as_is->pass_attribute_as_isunused_containerandassume_containerif possiblebuild_containertodefault_containerfix-swapped-template-argumentrawdirectiveRemoval of the
rawdirectiveWhat
rawdoesThe
rawdirective wraps an inner parser and produces the iterator range (begin/end pair) of the successfully matched input as its attribute, instead of the semantic value that the inner parser would normally yield.Use cases
A typical use case is extracting the raw matched substring from the input. For example, while
int_produces anintas its attribute,raw[int_]produces the iterator pair corresponding to the matched portion of the input. This can be useful for retaining the original string representation of parsed content or recording source positions for error reporting.The problem
Internally, the library needs to determine whether a parser's attribute is compatible with container types (e.g.,
std::vector) when resolving exposed attributes. Withrawin the picture, the attribute type becomes an iterator pair, which means the iterator type must be known to perform this compatibility check accurately.However, the iterator type depends on the input source and is not available at parser definition time. This fundamentally conflicts with the design goal of determining attribute compatibility statically from the parser definition alone. Supporting
rawcorrectly would require propagating the iterator type as a template parameter throughout the attribute compatibility logic, significantly complicating the library's internals.Rationale for removal
The use cases for
raware relatively niche, and most of them can be addressed by creating a custom parser class that deals with the actual iterator and sentinel positions directly. Note that_where, which is already deprecated in favor ofraw, should also be fully removed as part of this change. Given the disproportionate complexityrawintroduces into the type system, its removal is a reasonable trade-off in favor of a cleaner and more consistent internal design.