This has been semi-public anyways: people depend on the JSON structure to be
kept as-is.
So we might as well make the structs public, and make working with this easier
from golang. No need to copy the struct definitions manually.
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
This commit adds support for serializing/deserializing plans into/from
JSON. This allows us to compile policies out into JSON so that they
can be transpiled or interpreted in other environments.
To support these changes we have implemented custom marshaling on the
Block type and Operand (previously called LocalOrConst) type.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Previously the planner kept a single map for variables to locals and
didn't reset them across multiple blocks in the plan. As a result,
once a variable was assigned it would never get reassigned in
subsequent blocks.
Signed-off-by: Torin Sandall <torinsandall@gmail.com>