Skip to content

celfmt: remap macro calls when substituting comprehensions in inlineAs - #106

Merged
efd6 merged 1 commit into
masterfrom
comprehension_simplification
Jul 26, 2026
Merged

celfmt: remap macro calls when substituting comprehensions in inlineAs#106
efd6 merged 1 commit into
masterfrom
comprehension_simplification

Conversation

@efd6

@efd6 efd6 commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

When inlineAs substituted a comprehension (e.g. a filter) for a single-use .as() variable, the ident node took on the comprehension's content via SetKindCase but the macro call remained keyed to the original comprehension's ID. The formatter then visited the new node, found ComprehensionKind with no macro call, and errored with "unsupported expression: 2".

Pass SourceInfo to substituteIdent so it can copy the macro call from the replacement's ID to the substitution target's ID.

When inlineAs substituted a comprehension (e.g. a filter) for a
single-use .as() variable, the ident node took on the comprehension's
content via SetKindCase but the macro call remained keyed to the
original comprehension's ID. The formatter then visited the new node,
found ComprehensionKind with no macro call, and errored with
"unsupported expression: 2".

Pass SourceInfo to substituteIdent so it can copy the macro call from
the replacement's ID to the substitution target's ID.
@efd6 efd6 self-assigned this Jul 21, 2026
@efd6
efd6 requested a review from a team as a code owner July 21, 2026 23:12
@efd6 efd6 added bug Something isn't working Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations] labels Jul 21, 2026
@efd6
efd6 merged commit 26a1ac4 into master Jul 26, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Team:Security-Service Integrations Security Service Integrations Team [elastic/security-service-integrations]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants