[Cura 13248] Support string membership in chain comparisons#6
Open
HellAholic wants to merge 3 commits into
Open
[Cura 13248] Support string membership in chain comparisons#6HellAholic wants to merge 3 commits into
HellAholic wants to merge 3 commits into
Conversation
Updates `Member`/`NotMember` evaluation in `comp_chain_expr` to handle both list membership and string substring checks. The logic now validates operand types explicitly, uses `std::ranges::any_of` for vector lookup, and computes the final boolean result from a unified `found` flag.
Expand `tests/parser.cpp` with coverage for `in` and `not in` on strings, including substring checks and string-in-list cases. The new cases verify both AST construction (`Member`/`NotMember` operators) and evaluated boolean results for found and not-found scenarios.
Casper Lamboo (casperlamboo)
left a comment
Contributor
There was a problem hiding this comment.
I believe the proposed implementation will not correctly work when chaining operators. For instance
'a' in 'ab' not in 'def'Should produce True, but I believe to resolve to False in the current implementation
Contributor
oh no never mind, i do think the implementtion is correct |
Casper Lamboo (casperlamboo)
approved these changes
Jun 29, 2026
The changes introduce a significant difference between the versions to warrant a version bump.
HellAholic
added a commit
to Ultimaker/CuraEngine
that referenced
this pull request
Jul 3, 2026
The 1.2.1 package provides "str" in "str" check. see: Ultimaker/CuraFormulaeEngine#6
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.
CURA-13248