Acutis_internals.Compile
Orchestrate the Lexer
, Parser
, Typechecker
, and Matching
to produce the final template.
type data = [
| `Null
| `Int of int
| `Float of float
| `String of string
| `Array of data array
| `Assoc of data map_string
| `Var of string
| `Field of data * string
| `Block of int
To separate the data from the rest of the tree, we take any template blocks and place them into a blocks
. At runtime, the `Block
constructors will get their rendered content based on their indices.
]
A sequence of nodes
, indexed by integers.
type node =
| Text of string
| Echo of (echo_format * echo) list * echo_format * echo * escape
| Match of blocks * data array * nodes Matching.t
| Map_list of blocks * data * nodes Matching.t
| Map_dict of blocks * data * nodes Matching.t
| Component of string * blocks * data map_string
and nodes = node list
val blocks_length : blocks -> int
module Components : sig ... end
val parse : Stdlib.Lexing.lexbuf -> parsed
type 'a t = {
fname : string;
types : Typechecker.Type.interface;
components : (string * nodes) list;
Components are topologically ordered.
*)externals : (string * Typechecker.Type.interface * 'a) list;
nodes : nodes;
}
val make : 'a Components.t -> parsed -> 'a t
val interface : Stdlib.Lexing.lexbuf -> Typechecker.Type.interface
module Ty_repr : sig ... end