commit ce730501c415a513ac097f38378aeeec0a12afd2
parent 2ad93f870f1f9c021b318574923d57f2b0699c0d
Author: Drew DeVault <sir@cmpwn.com>
Date: Wed, 10 Nov 2021 09:23:46 +0100
hare::unparse: export more functions
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/hare/unparse/type.ha b/hare/unparse/type.ha
@@ -4,7 +4,8 @@ use hare::ast;
use hare::lex;
use strio;
-fn builtin_type(b: ast::builtin_type) str = switch (b) {
+// Returns a builtin type as a string.
+export fn builtin_type(b: ast::builtin_type) str = switch (b) {
case ast::builtin_type::FCONST, ast::builtin_type::ICONST =>
abort("ICONST and FCONST have no lexical representation");
case ast::builtin_type::BOOL =>
@@ -51,7 +52,8 @@ case ast::builtin_type::VOID =>
yield "void";
};
-fn prototype(
+// Unparses a prototype.
+export fn prototype(
out: io::handle,
indent: size,
t: ast::func_type,
@@ -79,6 +81,7 @@ fn prototype(
return n;
};
+// Unparses a struct or union type.
fn struct_union_type(
out: io::handle,
indent: size,