commit 18308298e40dcd9af6bf2e040fcf73382e347bb5
parent ff5eb03af2e71847d00e598d8bc016e117c02244
Author: Sebastian <sebastian@sebsite.pw>
Date: Thu, 28 Apr 2022 17:30:41 -0400
haredoc: use object allocation in sort_decls
Signed-off-by: Sebastian <sebastian@sebsite.pw>
Diffstat:
1 file changed, 3 insertions(+), 18 deletions(-)
diff --git a/cmd/haredoc/sort.ha b/cmd/haredoc/sort.ha
@@ -39,12 +39,7 @@ fn sort_decls(decls: []ast::decl) summary = {
exported = true,
start = decl.start,
end = decl.end,
- decl = {
- // XXX: Kind of bad
- let new: []ast::decl_type = [];
- append(new, t[j]);
- yield new;
- },
+ decl = alloc([t[j]]),
docs = decl.docs,
});
};
@@ -54,12 +49,7 @@ fn sort_decls(decls: []ast::decl) summary = {
exported = true,
start = decl.start,
end = decl.end,
- decl = {
- // XXX: Kind of bad
- let new: []ast::decl_const = [];
- append(new, c[j]);
- yield new;
- },
+ decl = alloc([c[j]]),
docs = decl.docs,
});
};
@@ -69,12 +59,7 @@ fn sort_decls(decls: []ast::decl) summary = {
exported = true,
start = decl.start,
end = decl.end,
- decl = {
- // XXX: Kind of bad
- let new: []ast::decl_global = [];
- append(new, g[j]);
- yield new;
- },
+ decl = alloc([g[j]]),
docs = decl.docs,
});
};