diff options
Diffstat (limited to 'boot/transpile.c')
| -rw-r--r-- | boot/transpile.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/boot/transpile.c b/boot/transpile.c index bebcbbc..25a3d79 100644 --- a/boot/transpile.c +++ b/boot/transpile.c @@ -65,13 +65,19 @@ transpiler_visit_type_node(struct Visit* visit, struct Type_Node* node) case TYPE_NODE_NAME: { struct String name = node->value.name.name; if (strcmp(name.data, "int") == 0) { - fprintf(transpiler->output, "int64_t"); + fprintf(transpiler->output, "integer"); } else if (strcmp(name.data, "string") == 0) { - fprintf(transpiler->output, "const char*"); + fprintf(transpiler->output, "struct String"); } else if (strcmp(name.data, "bool") == 0) { fprintf(transpiler->output, "bool"); } else if (strcmp(name.data, "float") == 0) { - fprintf(transpiler->output, "double"); + fprintf(transpiler->output, "real"); + } else if (strcmp(name.data, "uint") == 0) { + fprintf(transpiler->output, "uint"); + } else if (strcmp(name.data, "byte") == 0) { + fprintf(transpiler->output, "byte"); + } else if (strcmp(name.data, "ascii") == 0) { + fprintf(transpiler->output, "ascii"); } else { fprintf(transpiler->output, "%.*s", (int)name.length, name.data); } @@ -369,10 +375,9 @@ transpiler_visit_tree(struct Visit* visit, struct Tree* tree) { TRANSPILER_PREAMBLE - // include some standard c headers - // catskill should have it's own standard library, - // but until bootstrapping is complete, we will just use a - // normal libc (preferably musl). + // include the catskill runtime core library + // which provides all the necessary types and functions + // for transpiled catskill programs. // other headers can be included by the user // with the pragma `| c-header "header.h"`. fprintf(transpiler->output, "#include <stdio.h>\n"); |
