4 Commits

Author SHA1 Message Date
Johan Fylling 7bb6dbe36b Preparing for v1 API
Moving (most) source to v1 root package to prepare for v0/v1 API separation.

Signed-off-by: Johan Fylling <johan.dev@fylling.se>
2024-12-12 15:09:03 +01:00
Stephan Renatus 283b1e11f8 ir: make golang code public (#5141)
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>
2022-09-16 07:56:13 +02:00
Torin Sandall f0fb8c82d1 internal/ir+planner+compiler: add encoding for ir
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>
2022-01-29 06:25:30 -08:00
Torin Sandall 59986f4dfa wasm: Update planner to store vars as a stack
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>
2019-10-21 13:59:31 -04:00