From da1406fbccd2f3326b662396aca29dd98f065d88 Mon Sep 17 00:00:00 2001 From: Benjamin Loison Date: Fri, 9 Dec 2022 23:43:56 +0100 Subject: [PATCH] Precise `varlist` types in the AST --- src/pp.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pp.ml b/src/pp.ml index 035c84e..8cd97ec 100644 --- a/src/pp.ml +++ b/src/pp.ml @@ -9,15 +9,15 @@ let pp_loc fmt (start, stop) = let rec pp_varlist fmt : t_varlist -> unit = function | (FTList [], []) -> () - | (FTList (FTBase TInt :: _), IVar h :: []) -> Format.fprintf fmt "%s" h - | (FTList (FTBase TReal :: _), RVar h :: []) -> Format.fprintf fmt "%s" h - | (FTList (FTBase TBool :: _), BVar h :: []) -> Format.fprintf fmt "%s" h + | (FTList (FTBase TInt :: _), IVar h :: []) -> Format.fprintf fmt "%s: int" h + | (FTList (FTBase TReal :: _), RVar h :: []) -> Format.fprintf fmt "%s: real" h + | (FTList (FTBase TBool :: _), BVar h :: []) -> Format.fprintf fmt "%s: bool" h | (FTList (FTBase TInt :: tl), (IVar h) :: h' :: l) -> - Format.fprintf fmt "%s, %a" h pp_varlist (FTList tl, (h' :: l)) + Format.fprintf fmt "%s: int, %a" h pp_varlist (FTList tl, (h' :: l)) | (FTList (FTBase TBool :: tl), (BVar h) :: h' :: l) -> - Format.fprintf fmt "%s, %a" h pp_varlist (FTList tl, (h' :: l)) + Format.fprintf fmt "%s: bool, %a" h pp_varlist (FTList tl, (h' :: l)) | (FTList (FTBase TReal :: tl), (RVar h) :: h' :: l) -> - Format.fprintf fmt "%s, %a" h pp_varlist (FTList tl, (h' :: l)) + Format.fprintf fmt "%s: real, %a" h pp_varlist (FTList tl, (h' :: l)) | _ -> raise (MyTypeError "This exception should not have beed be raised.") let pp_expression =