Repository navigation
Make match() results conditions - #1578
Merged
Merged
Conversation
`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>
This was
linked to
issues
Oct 7, 2026
trueqbit
marked this pull request as ready for review
October 8, 2026 10:42
fnc12
approved these changes
Oct 11, 2026
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.
Stacked on #1577 (which is stacked on #1564).
What
match_tandmatch_with_table_t(dev/ast/match.h) now derive fromcondition_tandnegatable_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; thematch()factories are unchanged.Consumer-visible change
match(...) || match(...),match(...) && match(...),or_(match(...), match(...))andand_(...)compile and buildOR/AND. This covers the field form as well as the deprecated table formmatch<T>(...).!match(...)compiles and serializes toNOT "name" MATCH '...'. MATCH binds tighter than NOT, so no parentheses are needed.match()is not accepted as an operand ofor_()/and_()/operator||/operator&ا is gone:c(match(...)) || c(match(...))builds a logical OR instead of a string concatenation.Closes #1575, closes #1501.
Tests
tests/statement_serializer_tests/ast/match.cpp: OR via operator, quoted operator andor_(), for the field and the table form; AND via operator andand_(); negation of both forms.tests/static_tests/quoted_operands.cpp:c(match1) || c(match2)is anor_condition_t.🤖 Generated with Claude Code