Skip to content

Instantly share code, notes, and snippets.

@Khady
Created September 9, 2019 06:46
Show Gist options
  • Select an option

  • Save Khady/e7b197e60a5065651815bc7b19c07a24 to your computer and use it in GitHub Desktop.

Select an option

Save Khady/e7b197e60a5065651815bc7b19c07a24 to your computer and use it in GitHub Desktop.

Revisions

  1. Khady created this gist Sep 9, 2019.
    8 changes: 8 additions & 0 deletions ppxed-source
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,8 @@
    #!/usr/bin/env sh

    # A .merlin must be present nearby the file.
    # With dune it can be generated by calling `dune build @check`.

    FILE="$1"

    ocamlmerlin single dump -what ppxed-source -filename "$FILE" < "$FILE" | jq -r '.value' | ocamlformat --name="$FILE" -