Something went wrong. Try again.
static-site-generator blogging hypertext ocaml
Something went wrong. Try again.
1.4 kB · 53 lines
OCaml
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354(* * SPDX-FileCopyrightText: 2024 The Forester Project Contributors * SPDX-FileCopyrightText: 2026 The Forester Project Contributors * * SPDX-License-Identifier: GPL-3.0-or-later *)
open Forester_preludeopen Base
open struct module T = Typesend
module String_map = Map.Make (String)module Symbol_map = Map.Make (Symbol)module Symbol_table = Hashtbl.Make (Symbol)
type t = | Content of T.content | Clo of (t String_map.t[@opaque]) * string option binding list * Syn.t | Dx_prop of (string, T.content T.vertex) Datalog_expr.prop | Dx_sequent of (string, T.content T.vertex) Datalog_expr.sequent | Dx_query of (string, T.content T.vertex) Datalog_expr.query | Dx_var of string | Dx_const of Vertex.t | Sym of Symbol.t | Obj of Symbol.t[@@deriving show]
type obj_method = { body: Syn.t; self: string option; super: string option; env: t String_map.t; [@opaque]}[@@deriving show]
module Method_table = struct include Map.Make (String)
let pp (pp_el : Format.formatter -> 'a -> unit) (fmt : Format.formatter) (map : 'a t) = Format.fprintf fmt "@[<v1>{"; begin let@ k, v = Seq.iter @~ to_seq map in Format.fprintf fmt "@[%s ~> %a@]@;" k pp_el v end; Format.fprintf fmt "}@]"end
type obj = {prototype: Symbol.t option; methods: obj_method Method_table.t}[@@deriving show]