From 82eb952fe8fd05e86bb6ea629b4ecbabe1caa83f Mon Sep 17 00:00:00 2001 From: Adrien Guatto Date: Wed, 18 Oct 2023 23:17:29 +0200 Subject: [PATCH] flap : corrections mineures Correction d'explications dans les commentaires. Correction de l'affichage des types abstraits (pas de signe "=" superflu). --- flap/src/hopix/hopixAST.ml | 2 +- flap/src/hopix/hopixPrettyPrinter.ml | 3 ++- flap/src/hopix/hopixTypes.mli | 7 ++----- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/flap/src/hopix/hopixAST.ml b/flap/src/hopix/hopixAST.ml index d3df029..9129e63 100644 --- a/flap/src/hopix/hopixAST.ml +++ b/flap/src/hopix/hopixAST.ml @@ -110,7 +110,7 @@ and branch = | Branch of pattern located * expression located and ty = - (** An instantiated type constructor [t ]. *) + (** An instantiated type constructor [t ]. *) | TyCon of type_constructor * ty located list (** A function type [ty₁ → ty₂]. *) | TyArrow of ty located * ty located diff --git a/flap/src/hopix/hopixPrettyPrinter.ml b/flap/src/hopix/hopixPrettyPrinter.ml index 93b9ebe..d59c79a 100644 --- a/flap/src/hopix/hopixPrettyPrinter.ml +++ b/flap/src/hopix/hopixPrettyPrinter.ml @@ -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 diff --git a/flap/src/hopix/hopixTypes.mli b/flap/src/hopix/hopixTypes.mli index e023f3a..981d471 100644 --- a/flap/src/hopix/hopixTypes.mli +++ b/flap/src/hopix/hopixTypes.mli @@ -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