Skip to content
Permalink
Browse files

First attempt at replacing OCaml prettyprinters with a single one

using ocaml-migrate-parsetree
  • Loading branch information
victor-dumitrescu committed Feb 20, 2018
1 parent 1bf9836 commit 9616ac7f52c9fdef7424d75d350a7126bbe9e675
@@ -6,6 +6,7 @@ PKG yojson
PKG zarith
PKG menhirLib
PKG ulex
PKG ocaml-migrate-parsetree

S src/basic/ml
S src/extraction/ml
3 _tags
@@ -24,7 +24,8 @@ true: \
package(pprint), \
package(ulex), \
package(stdint), \
package(yojson)
package(yojson), \
package(ocaml-migrate-parsetree)

# This ensures that main.native bundles its dependencies, which dynlinked tactics might need.
"src/fstar/ml/main.native": \
@@ -1,4 +1,4 @@
name="fstar-compiler-lib"
version="0.9.6.0~alpha1"
description="FStar compiler"
requires="batteries,compiler-libs,compiler-libs.common,dynlink,pprint,stdint,yojson,zarith"
requires="batteries,compiler-libs,compiler-libs.common,dynlink,pprint,stdint,yojson,zarith,ocaml-migrate-parsetree"

This file was deleted.

@@ -1,6 +1,8 @@
open List
open Lexing
open Parsetree
open Migrate_parsetree
open Migrate_parsetree.Ast_404
open Migrate_parsetree.Ast_404.Parsetree
open Location
open Pprintast
open Ast_helper
@@ -442,8 +444,10 @@ let build_ast (out_dir: string option) (ext: string) (ml: mllib) =

(* printing the AST to the correct path *)
let print_module ((path, m): string * structure) =
let migration =
Versions.migrate Versions.ocaml_404 Versions.ocaml_current in
Format.set_formatter_out_channel (open_out_bin path);
structure Format.std_formatter m;
structure Format.std_formatter (migration.copy_structure m);
Format.pp_print_flush Format.std_formatter ()

let print (out_dir: string option) (ext: string) (ml: mllib) =

0 comments on commit 9616ac7

Please sign in to comment.
You can’t perform that action at this time.