mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
Scopelang printer: use 'struct'/'enum' rather than 'type'
This commit is contained in:
parent
4d4dac6727
commit
f8f1ae283f
@ -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")
|
||||
|
@ -39,7 +39,7 @@ $ catala Interpret -s TestBool
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Scopelang
|
||||
type TestBool = {
|
||||
struct TestBool = {
|
||||
foo: bool
|
||||
bar: integer
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ scope Foo:
|
||||
|
||||
```catala-test-inline
|
||||
$ catala Scopelang
|
||||
type Foo = {
|
||||
struct Foo = {
|
||||
x: integer
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user