Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ast/compiler: allow retaining parsed modules #4921

Merged

Conversation

srenatus
Copy link
Contributor

The included change resetting c.sorted in (*Compiler).Compile(...) was
necessary to test the repeated compilation without a panic.

Fixes #4910.

@srenatus srenatus force-pushed the sr/ast/expose-parsed-modules branch 2 times, most recently from 5cba436 to 943cb87 Compare July 21, 2022 09:48
ast/compile.go Outdated Show resolved Hide resolved
ast/compile.go Outdated Show resolved Hide resolved
ast/compile.go Outdated Show resolved Hide resolved
@srenatus srenatus marked this pull request as draft July 21, 2022 19:58
@srenatus srenatus force-pushed the sr/ast/expose-parsed-modules branch from 943cb87 to 8b8b632 Compare July 22, 2022 12:50
@srenatus srenatus marked this pull request as ready for review July 22, 2022 12:52
ast/compile.go Outdated Show resolved Hide resolved
@srenatus srenatus force-pushed the sr/ast/expose-parsed-modules branch 2 times, most recently from e6edc4d to d44c601 Compare July 25, 2022 07:35
@srenatus srenatus force-pushed the sr/ast/expose-parsed-modules branch from d44c601 to 27d189c Compare July 25, 2022 12:45
ast/compile.go Outdated Show resolved Hide resolved
@philipaconrad
Copy link
Contributor

I wonder if in the future we may want to have a special callout comment format for functions that return uncopied/mutate-able results. I guess that could become worthwhile if we add several more systems like this one. 🤔

philipaconrad
philipaconrad previously approved these changes Jul 25, 2022
Copy link
Contributor

@philipaconrad philipaconrad left a comment

Choose a reason for hiding this comment

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

Looks good overall to me! 👍

The included change resetting `c.sorted` in `(*Compiler).Compile(...)` was
necessary to test the repeated compilation without a panic.

Fixes open-policy-agent#4910.

Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
@srenatus srenatus force-pushed the sr/ast/expose-parsed-modules branch from 27d189c to c0fdef5 Compare July 25, 2022 18:16
@srenatus srenatus merged commit 81fd742 into open-policy-agent:main Jul 25, 2022
@srenatus srenatus deleted the sr/ast/expose-parsed-modules branch July 25, 2022 18:36
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.

ast/compiler: retain unprocessed parsed modules
3 participants