Skip to content

Conversation

@abenea
Copy link
Contributor

@abenea abenea commented Jan 6, 2026

The old implementation outputs the wrong source information for policy files derived from the dummy AST created by RuleComposer.Compose. This change fixes that by preserving the correct source and merging the offset ranges of the rule match expressions inserted by the composer optimizer into the final AST.

@seirl
Copy link
Collaborator

seirl commented Jan 7, 2026

/gcbrun

@abenea abenea force-pushed the sourceinfo branch 5 times, most recently from 2d1165f to 720efc8 Compare January 23, 2026 09:48
The old implementation outputs the wrong source information for policy files derived from the dummy AST created by RuleComposer.Compose. This change fixes that by preserving the correct source and merging the offset ranges of the rule match expressions inserted by the composer optimizer into the final AST.
@TristonianJones
Copy link
Collaborator

/gcbrun

Copy link
Collaborator

@TristonianJones TristonianJones left a comment

Choose a reason for hiding this comment

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

In general, looks good to me, just one question related to offset computations as it could lead to surprising results in change-detector tests.

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.

3 participants