Skip to content

Commit

Permalink
COMPILER: fix pretty variable
Browse files Browse the repository at this point in the history
  • Loading branch information
hhugo committed Oct 4, 2013
1 parent 0841e45 commit e4e3f83
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 3 additions & 1 deletion compiler/code.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ module Var : sig
val propagate_name : t -> t -> unit

val reset : unit -> unit
val set_pretty : bool -> unit

val dummy : t
end = struct

open Util
type t = int

let printer = VarPrinter.create ~pretty:(Option.Optim.pretty ()) ()
let printer = VarPrinter.create ()

let last_var = ref 0

Expand All @@ -68,6 +69,7 @@ end = struct

let name i nm = VarPrinter.name printer i nm
let propagate_name i j = VarPrinter.propagate_name printer i j
let set_pretty b = VarPrinter.set_pretty printer b

let dummy = -1
end
Expand Down
1 change: 1 addition & 0 deletions compiler/code.mli
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module Var : sig
val name : t -> string -> unit
val propagate_name : t -> t -> unit
val reset : unit -> unit
val set_pretty : bool -> unit
end


Expand Down
4 changes: 3 additions & 1 deletion compiler/driver.ml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ let output formatter d (js,to_string) =


let configure formatter p =
Pretty_print.set_compact formatter (not (Option.Optim.pretty ()));
let pretty = Option.Optim.pretty () in
Pretty_print.set_compact formatter (not pretty);
Code.Var.set_pretty pretty;
p

let f ?(standalone=true) ?linkall formatter d =
Expand Down

0 comments on commit e4e3f83

Please sign in to comment.