Skip to content

Commit 4363ad1

Browse files
chore: Make style of TODOs consistent (#1332)
Co-authored-by: Oscar Spencer <oscar@grain-lang.org>
1 parent 5837df6 commit 4363ad1

File tree

30 files changed

+55
-73
lines changed

30 files changed

+55
-73
lines changed

compiler/graindoc/docblock.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ let to_markdown = (~current_version, docblock) => {
258258
deprecations,
259259
);
260260
};
261-
// TODO: Should we fail if more than one `@since` attribute?
261+
// TODO(#787): Should we fail if more than one `@since` attribute?
262262
let since_attr =
263263
docblock.attributes
264264
|> List.find_opt(Comments.Attribute.is_since)

compiler/graindoc/graindoc.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ let generate_docs =
8686
let module_comment = Comments.Doc.find_module(comments);
8787
switch (module_comment) {
8888
| Some((_, desc, attrs)) =>
89-
// TODO: Should we fail if more than one `@module` attribute?
89+
// TODO(#787): Should we fail if more than one `@module` attribute?
9090
let module_attr = attrs |> List.find(Comments.Attribute.is_module);
9191
switch (module_attr) {
9292
| Module({attr_name, attr_desc}) =>
@@ -100,7 +100,7 @@ let generate_docs =
100100
| _ => failwith("Unreachable: Non-`module` attribute can't exist here.")
101101
};
102102

103-
// TODO: Should we fail if more than one `@since` attribute?
103+
// TODO(#787): Should we fail if more than one `@since` attribute?
104104
let since_attr =
105105
attrs
106106
|> List.find_opt(Comments.Attribute.is_since)

compiler/src/codegen/compcore.re

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ open Comp_wasm_prim;
99

1010
let sources: ref(list((Expression.t, Grain_parsing.Location.t))) = ref([]);
1111

12-
/* [TODO] Should probably be a config variable */
13-
let memory_debugging_enabled = false;
14-
1512
/** Environment */
1613

1714
type codegen_env = {
@@ -1298,7 +1295,7 @@ let compile_array_op = (wasm_mod, env, arr_imm, op) => {
12981295
),
12991296
get_arr(),
13001297
),
1301-
/* [TODO] decref the old item more efficiently (using a swap slot, most likely) */
1298+
// TODO: decref the old item more efficiently (using a swap slot, most likely)
13021299
Expression.Tuple_extract.make(
13031300
wasm_mod,
13041301
Expression.Tuple_make.make(
@@ -2375,7 +2372,7 @@ let compile_prim0 = (wasm_mod, env, p0): Expression.t => {
23752372

23762373
let compile_prim1 = (wasm_mod, env, p1, arg, loc): Expression.t => {
23772374
let compiled_arg = compile_imm(wasm_mod, env, arg);
2378-
/* TODO: Overflow checks? */
2375+
// TODO: Overflow checks?
23792376
switch (p1) {
23802377
| AllocateArray => allocate_uninitialized_array(wasm_mod, env, arg)
23812378
| AllocateTuple => allocate_uninitialized_tuple(wasm_mod, env, arg)
@@ -2482,7 +2479,7 @@ let compile_prim1 = (wasm_mod, env, p1, arg, loc): Expression.t => {
24822479
],
24832480
)
24842481
| Throw =>
2485-
// [TODO] When we have exception handling, revisit whether there is any GC required here (#813)
2482+
// TODO(#813): When we have exception handling, revisit whether there is any GC required here
24862483
Expression.Block.make(
24872484
wasm_mod,
24882485
gensym_label("throw"),

compiler/src/formatting/format.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1483,7 +1483,7 @@ and print_record =
14831483
switch (fields) {
14841484
| [_one] =>
14851485
// TODO: not needed once we annotate with ::
1486-
Doc.comma // append a comma as single argument record look like block {data:val}
1486+
Doc.comma // append a comma as single argument record look like block {data:val}
14871487
| _ => Doc.nil
14881488
},
14891489
),

compiler/src/formatting/res_doc.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ let fits = (w, stack) => {
230230
| (Flat, IfBreaks({no: flatDoc})) => calculate(indent, mode, flatDoc)
231231
| (_, Concat(docs)) => calculateConcat(indent, mode, docs)
232232
| (_, CustomLayout([hd, ..._])) =>
233-
/* TODO: if we have nested custom layouts, what we should do here? */
233+
// TODO: if we have nested custom layouts, what we should do here?
234234
calculate(indent, mode, hd)
235235
| (_, CustomLayout([])) => ()
236236
}

compiler/src/middle_end/anftree.re

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,8 @@ and comp_expression_desc =
360360
| CFloat32(float)
361361
| CFloat64(float)
362362

363-
/** Compound expressions (possibly let-bound)
364-
TODO: better name */
363+
/** Compound expressions (possibly let-bound) */
364+
// TODO: better name
365365

366366
[@deriving sexp]
367367
and anf_expression = {

compiler/src/middle_end/anftree.rei

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,8 @@ and comp_expression_desc =
340340
| CFloat32(float)
341341
| CFloat64(float)
342342

343-
/** Compound expressions (possibly let-bound)
344-
TODO: better name */
343+
/** Compound expressions (possibly let-bound) */
344+
// TODO: better name
345345

346346
[@deriving sexp]
347347
and anf_expression = {

compiler/src/middle_end/matchcomp.re

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,7 @@ let rec compile_matrix = mtx =>
649649
let constants = matrix_head_constants(mtx);
650650
let equality_type = equality_type(List.hd(constants));
651651

652-
// TODO: https://github.com/grain-lang/grain/issues/1185
653-
// Optimize physical equality checks into a switch.
652+
// TODO(#1185): Optimize physical equality checks into a switch.
654653
// We can also do partial switches on Numbers if some of the
655654
// patterns are stack-allocated numbers. Addtionally, since we
656655
// know the types of the non-Number number types, we can make

compiler/src/middle_end/optimize.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ let optimize_program = (prog: Anftree.anf_program): Anftree.anf_program => {
5555
pass(n - 1, opt);
5656
};
5757

58-
/* TODO: Make 4 a config value */
58+
// TODO: Make 4 a config value
5959
pass(4, prog);
6060
};

compiler/src/typed/includemod.re

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ let type_declarations =
130130

131131
let extension_constructors = (~loc, env, ~mark, cxt, subst, id, ext1, ext2) => {
132132
let mark = mark_positive(mark);
133-
// TODO: Enable or remove (#324)
133+
// TODO(#324): Enable or remove
134134
// let ext2 = Subst.extension_constructor(subst, ext2);
135135
if (Includecore.extension_constructors(~loc, env, ~mark, id, ext1, ext2)) {
136136
();

0 commit comments

Comments
 (0)