Skip to content

[Cura 13248] Support string membership in chain comparisons#6

Open
HellAholic wants to merge 3 commits into
mainfrom
CURA-13248
Open

[Cura 13248] Support string membership in chain comparisons#6
HellAholic wants to merge 3 commits into
mainfrom
CURA-13248

Conversation

@HellAholic

@HellAholic HellAholic commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

CURA-13248

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.
@HellAholic HellAholic changed the title Cura 13248 [Cura 13248] Support string membership in chain comparisons Jun 29, 2026
@HellAholic HellAholic marked this pull request as ready for review June 29, 2026 12:27

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@casperlamboo

Copy link
Copy Markdown
Contributor

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

oh no never mind, i do think the implementtion is correct

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants