Skip to content

Commit

Permalink
Print externals in the same way as OCaml.
Browse files Browse the repository at this point in the history
  • Loading branch information
andrejbauer committed Feb 2, 2017
1 parent 406db4d commit 8e755ec
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/runtime/eval.ml
Original file line number Diff line number Diff line change
Expand Up @@ -673,8 +673,10 @@ let rec toplevel ~quiet ~print_annot {Location.thing=c;loc} =
| Some v ->
Runtime.add_topbound v >>= (fun () ->
if not quiet then
Format.printf "@[<hov 2>val %t :@ %t@]@.@."
(Name.print_ident x) (print_annot () sch) ;
Format.printf "@[<hov 2>external %t :@ %t = \"%s\"@]@.@."
(Name.print_ident x)
(print_annot () sch)
s ;
return ())
end

Expand Down
2 changes: 1 addition & 1 deletion tests/everything.m31.ref
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ val g : ∀ β, β → mlstring * β
("f", ("g",
"foo"))

val everything_print : ∀ α, α → mlunit
external everything_print : ∀ α, α → mlunit = "print"

((),
())
Expand Down
4 changes: 2 additions & 2 deletions tests/json.m31.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
val printj : ∀ α, α → mlunit
external printj : ∀ α, α → mlunit = "print_json"

val config : mlstring → mlunit
external config : mlstring → mlunit = "config"

()

Expand Down

0 comments on commit 8e755ec

Please sign in to comment.