Skip to content

Commit aba54cb

Browse files
committed
atds: Support top-level lists
That was easy.
1 parent ecf5e39 commit aba54cb

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

atds/TODO

-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
Now:
2-
- update documentation for ArrayList and for variants
3-
4-
Later:
51
- produce an output tree using Atd.Indent rather fprintf
62
(for clarity and atdj performance)
73
- translate atd syntax tree first, then generate code instead of doing
84
everything in the same pass (for clarity and atdj performance)
95
- merge into atdgen
10-
- support top-level lists
116
- add location information to exceptions (need own parser)

atds/src/atds_trans.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ and trans_outer env (Atd.Ast.Type (_, (name, _, annots), atd_ty)) =
138138
trans_sum name env (loc, v, a)
139139
| Record (loc, v, a) ->
140140
trans_record name env (loc, v, a)
141-
| Name _ | Tuple _ ->
141+
| Name _ | Tuple _ | List _ ->
142142
trans_alias name env annots atd_ty
143143
| x -> type_not_supported x
144144

atds/test/test.atd

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
(* Sum (enum) *)
22
type e = [ Alpha | Beta ]
33

4+
type es = e list
5+
46
(* Record with optional field *)
57
type simple_record = {
68
int_field: int;

atds/test/test.expected.scala

+3
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ object E {
5757
}
5858

5959
}
60+
61+
type Es = List[E]
62+
6063
case class SimpleRecord(
6164
int_field : Int,
6265
opt : Option[Boolean],

0 commit comments

Comments
 (0)