Module FFI.Code

type t = private {
  1. co_name : string;
  2. co_filename : string;
  3. co_flags : int;
  4. co_cellvars : string array;
    (*

    A tuple containing the names of nonlocal variables. These are the local variables of a function accessed by its inner functions.

    *)
  5. co_freevars : string array;
    (*

    A tuple containing the names of free variables. Free variables are the local variables of an outer function which are accessed by its inner function.

    *)
  6. co_names : string array;
    (*

    A tuple containing the names used by the bytecode which can be global variables, functions, and classes or also attributes loaded from objects. There are "global names". Local variables & the like are going in other arrays

    *)
  7. co_varnames : string array;
    (*

    A tuple containing the local names used by the bytecode (arguments first, then the local variables).

    *)
  8. co_nlocals : int;
  9. co_argcount : int;
  10. co_firstlineno : int;
  11. co_posonlyargcount : int;
  12. co_stacksize : int;
  13. co_kwonlyargcount : int;
  14. co_lnotab : char array;
  15. co_consts : Constant.t array;
    (*

    A tuple containing the literals used by the bytecode. By experience, it is only int, string, tuples, None or code objects

    *)
  16. instructions : Instruction.t list;
}
val pp : Ppx_show_runtime.Format.formatter -> t -> unit
val show : t -> string
include Ppx_compare_lib.Comparable.S with type t := t
val compare : t Base__Ppx_compare_lib.compare
val full_show : t -> string
val is_closure : t -> bool
val get_arguments : t -> string array
val get_locals : t -> string array