Merge branch 'master' into anri

This commit is contained in:
Mylloon 2023-10-20 18:53:21 +02:00
commit aa5009e94c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
4 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

Binary file not shown.