flap : corrections mineures

Correction d'explications dans les commentaires.

Correction de l'affichage des types abstraits (pas de signe "="
superflu).
This commit is contained in:
Adrien Guatto 2023-10-18 23:17:29 +02:00
parent ac53e8865a
commit 82eb952fe8
3 changed files with 5 additions and 7 deletions

View file

@ -110,7 +110,7 @@ and branch =
| Branch of pattern located * expression located
and ty =
(** An instantiated type constructor [t <ty₁, .., tyₙ>]. *)
(** An instantiated type constructor [t <ty₁, ..., tyₙ>]. *)
| TyCon of type_constructor * ty located list
(** A function type [ty₁ → ty₂]. *)
| TyArrow of ty located * ty located

View file

@ -32,11 +32,12 @@ let rec program p =
and definition = function
| DefineType (t, ts, tdef) ->
let eq = match tdef with Abstract -> empty | _ -> string "=" in
nest 2 (
group (group (string "type"
++ located type_constructor t
^^ group (type_parameters_angles ts))
++ string "=")
++ eq)
++ type_definition tdef)
| DeclareExtern (x, t) ->
group (string "extern" ++ located identifier x

View file

@ -2,11 +2,8 @@ open HopixAST
(** Abstract syntax for types.
The following internal syntax for types is the same as the one for
the types [ty] defined in {!HopixAST} except that all positions
have been erased.
*)
The following internal syntax for types is the same as the one for the types
[ty] defined in {!HopixAST} except that all positions have been erased. *)
type aty =
| ATyVar of type_variable
| ATyCon of type_constructor * aty list