---
cases:
  - note: withkeyword/with stack
    query: data.generated.p = x
    modules:
      - |
        package generated

        r := __local0__ if {
        	true
        	__local0__ = input
        }

        q := x if {
        	data.generated.r = x with input.a.c as 2
        }

        p := x if {
        	data.generated.q = x with input.a.b as 1
        }
    data: {}
    input_term: '{"a": {"d": 3}, "e": 4}'
    want_result:
      - x:
          a:
            b: 1
            c: 2
            d: 3
          e: 4
