Scopelang printer: use 'struct'/'enum' rather than 'type'

This commit is contained in:
Louis Gesbert 2022-11-03 15:33:13 +01:00
parent 4d4dac6727
commit f8f1ae283f
3 changed files with 4 additions and 4 deletions

View File

@ -23,7 +23,7 @@ let struc
(fmt : Format.formatter)
(name : StructName.t)
(fields : (StructFieldName.t * typ) list) : unit =
Format.fprintf fmt "%a %a %a %a@\n@[<hov 2> %a@]@\n%a" Print.keyword "type"
Format.fprintf fmt "%a %a %a %a@\n@[<hov 2> %a@]@\n%a" Print.keyword "struct"
StructName.format_t name Print.punctuation "=" Print.punctuation "{"
(Format.pp_print_list
~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n")
@ -37,7 +37,7 @@ let enum
(fmt : Format.formatter)
(name : EnumName.t)
(cases : (EnumConstructor.t * typ) list) : unit =
Format.fprintf fmt "%a %a %a @\n@[<hov 2> %a@]" Print.keyword "type"
Format.fprintf fmt "%a %a %a @\n@[<hov 2> %a@]" Print.keyword "enum"
EnumName.format_t name Print.punctuation "="
(Format.pp_print_list
~pp_sep:(fun fmt () -> Format.fprintf fmt "@\n")

View File

@ -39,7 +39,7 @@ $ catala Interpret -s TestBool
```catala-test-inline
$ catala Scopelang
type TestBool = {
struct TestBool = {
foo: bool
bar: integer
}

View File

@ -33,7 +33,7 @@ scope Foo:
```catala-test-inline
$ catala Scopelang
type Foo = {
struct Foo = {
x: integer
}