Skip to content

Make match() results conditions - #1578

Merged
trueqbit merged 2 commits into
devfrom
feature/match-as-condition
Oct 11, 2026
Merged

trueqbit merged 2 commits into
devfrom
feature/match-as-condition

Conversation

@trueqbit

@trueqbit trueqbit commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #1577 (which is stacked on #1564).

What

match_t and match_with_table_t (dev/ast/match.h) now derive from condition_t and negatable_t, like every other condition node (like_t, glob_t, between_t, is_null_t, ...). Since the nodes are no longer aggregates, each gets a constructor; the match() factories are unchanged.

Consumer-visible change

Closes #1575, closes #1501.

Tests

  • tests/statement_serializer_tests/ast/match.cpp: OR via operator, quoted operator and or_(), for the field and the table form; AND via operator and and_(); negation of both forms.
  • tests/static_tests/quoted_operands.cpp: c(match1) || c(match2) is an or_condition_t.

🤖 Generated with Claude Code

`match_t` and `match_with_table_t` now derive from `condition_t` and
`negatable_t`, like every other condition node. A MATCH can therefore be
combined with `||`/`&&` and `or_()`/`and_()`, and negated with `!`.
Together with the quoted-condition classification, `c(match(...)) ||
c(match(...))` now builds a logical OR instead of a string concatenation.

Closes #1575, closes #1501.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from feature/quoted-conditions-in-or to dev October 11, 2026 11:49
@trueqbit
trueqbit requested a review from fnc12 October 11, 2026 11:50
@trueqbit
trueqbit merged commit 639b155 into dev Oct 11, 2026
39 checks passed
@trueqbit
trueqbit deleted the feature/match-as-condition branch October 11, 2026 11:54
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.

match_t is not negatable: operator! rejects match() match() is not accepted as an operand of or_() / and_() / operator|| / operator&&

2 participants