You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would sometimes be handy -- when using OPA via Go -- to be able to retrieve the modules that the compiler has worked on in pristine state. So far, the code flow goes like this:
c.Modules is a map[string]*Module of parsed ast.Module structs, as per the ast package's ParseModule(string, string) (*Module, error)
c.Compile() is run
c.Modules now contains the modules that have been rewritten by the various compiler stages
The enhancement here would be to add a new compiler options, e.g.
The included change resetting `c.sorted` in `(*Compiler).Compile(...)` was
necessary to test the repeated compilation without a panic.
Fixesopen-policy-agent#4910.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
The included change resetting `c.sorted` in `(*Compiler).Compile(...)` was
necessary to test the repeated compilation without a panic.
Fixes#4910.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
It would sometimes be handy -- when using OPA via Go -- to be able to retrieve the modules that the compiler has worked on in pristine state. So far, the code flow goes like this:
c.Modules
is amap[string]*Module
of parsedast.Module
structs, as per theast
package'sParseModule(string, string) (*Module, error)
c.Compile()
is runc.Modules
now contains the modules that have been rewritten by the various compiler stagesThe enhancement here would be to add a new compiler options, e.g.
and if it was provided during compiler setup, we'd copy the modules into
c.ParsedModules
, amap[string]*Module
to add to the compiler struct.The text was updated successfully, but these errors were encountered: