package js_of_ocaml-toplevel

  1. Overview
  2. Docs

One can add a ppx rewriter to a toplevel by registering it

open Migrate_parsetree

let init () =
  let module Converter =
    Migrate_parsetree.Versions.Convert
      (Migrate_parsetree.OCaml_405)
      (Migrate_parsetree.OCaml_current)
  in
  let mapper = Converter.copy_mapper Ppx_js.mapper in
  Compiler_libs.Ast_mapper.register "js_of_ocaml" (fun _ -> mapper)

Helpers to embed PPX into the toplevel.

val preprocess_structure : Parsetree.structure -> Parsetree.structure
val preprocess_signature : Parsetree.signature -> Parsetree.signature
OCaml

Innovation. Community. Security.