Something went wrong. Try again.
A component based functional template language
Something went wrong. Try again.
12345678910111213141516171819202122232425262728open Pinc_types
let rec pp fmt = function | Value.Null -> Format.fprintf fmt "<NULL>\n%!" | Value.Int i -> Format.fprintf fmt "%i\n%!" i | Value.Float f -> Format.fprintf fmt "%f\n%!" f | Value.Bool b -> Format.fprintf fmt "%b\n%!" b | Value.Char c -> Format.fprintf fmt "%x\n%!" c | Value.String s -> Format.fprintf fmt "%S\n%!" s | Value.Array _ -> Format.fprintf fmt "<ARRAY>\n%!" | Value.Record r -> Format.fprintf fmt "<RECORD {%a}>\n%!" pp_record r | Value.Closure _ -> Format.fprintf fmt "<CLOSURE>\n%!" | Value.Function _ -> Format.fprintf fmt "<FUNCTION>\n%!" | Value.BuiltinFunction _ -> Format.fprintf fmt "<BUILTIN>\n%!" | Value.HtmlTemplateNode _ -> Format.fprintf fmt "<Html_TEMPLATE>\n%!" | Value.FragmentTemplateNode _ -> Format.fprintf fmt "<FRAGMENT_TEMPLATE>\n%!" | Value.PincTemplateNode _ -> Format.fprintf fmt "<PINC_TEMPLATE>\n%!" | Value.PincTemplateIdentifier (_, id) -> Format.fprintf fmt "<PINC_TEMPLATE_IDENTIFIER %s>\n%!" id | Value.PincPortalNode { portal_name; _ } -> Format.fprintf fmt "<PINC_PORTAL_NODE %s>\n%!" portal_name
and pp_record fmt r = String_map.iter (fun key value -> Format.fprintf fmt "@;@[<v2> %s: %a@]" key pp value) r;;