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

View file

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

View file

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