Skip to content

Commit 24360cc

Browse files
committed
Add a note into atdd's source code
1 parent b4d3c92 commit 24360cc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

atdd/src/lib/Codegen.ml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,18 @@ let run_file src_path =
11551155
let atd_head = module_.Atd.Ast.module_head in
11561156
let atd_module = module_.Atd.Ast.type_defs in
11571157
let head =
1158+
(* The ATD language now has a dedicated 'import' statement that
1159+
allows referencing other ATD types from other ATD files.
1160+
This is different than what these annotations are used for
1161+
(e.g. <dlang import="std.stdint : uint32_t, uint16_t">).
1162+
The ATD parser treats 'import' as a soft keyword to avoid breaking
1163+
things for atdd. It would be nice if the grammar didn't have to
1164+
resort to soft keywords. This would require deprecating
1165+
<dlang import="..."> in favor of another name or syntax, and eventually
1166+
retiring it. Or maybe we could go the other way and generalize
1167+
soft keywords. Feel free to bring up the issue on GitHub if you
1168+
have opinions on this.
1169+
*)
11581170
Dlang_annot.get_dlang_import (snd atd_head)
11591171
|> List.map (sprintf "import %s;")
11601172
in

0 commit comments

Comments
 (0)