Skip to content

Commit 8b3cf22

Browse files
committed
Add support for zero-tuple
1 parent 9c20dc0 commit 8b3cf22

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

atd_parser.mly

+1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@ cartesian_product:
136136
| x = annot_expr STAR l = cartesian_product { x :: l }
137137
| x = annot_expr STAR y = annot_expr { [ x; y ] }
138138
| x = annot_expr { [ x ] }
139+
| { [] }
139140
;
140141

141142
annot_expr:

manual/atd-body.mlx

+1-1
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ discarding white\rval{space} and \rval{comment}s.
380380
381381
\lval{expr-body} & ::= & \rval{args}? \rval{lident} & \\
382382
& | & \str{(}
383-
\rval{cell} (\str{*} \rval{cell})*
383+
(\rval{cell} (\str{*} \rval{cell})*)?
384384
\str{)} & \com{tuple type} \\
385385
& | & \str{\{}
386386
((\rval{field} (\str{;} \rval{field})*) \str{;}?)?

test.atd

+3
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ type tuple = (z * z * tuple option * kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
5656

5757
type tuple2 = (int * float)
5858

59+
type singleton = (int)
60+
type zero_tuple = ()
61+
5962
type 'a i1 =
6063
[ inherit 'a j2
6164
| I1 ]

0 commit comments

Comments
 (0)