code: func (r *Rego) Compile(ctx context.Context) (*CompileResult, error) {
  
  	pq, err := r.Partial(ctx)
  	if err != nil {
  		return nil, err
  	}
  
  	if len(pq.Support) > 0 {
  		return nil, fmt.Errorf("modules not supported")
  	}
  
  	policy, err := planner.New().WithQueries(pq.Queries).Plan()
  	if err != nil {
  		return nil, err
  	}
  
  	if r.dump != nil {
  		fmt.Fprintln(r.dump, "PLAN:")
  		fmt.Fprintln(r.dump, "-----")
  		ir.Pretty(r.dump, policy)
  		fmt.Fprintln(r.dump)
  	}
  
  	m, err := wasm.New().WithPolicy(policy).Compile()
  	if err != nil {
  		return nil, err
  	}
  
  	var out bytes.Buffer
  
  	if err := encoding.WriteModule(&out, m); err != nil {
  		return nil, err
  	}
  
  	result := &CompileResult{
  		Bytes: out.Bytes(),
  	}
  
  	return result, nil
  }
docs: // Compile returns a compiled policy query.