2024-02-04 12:23:59 -08:00
|
|
|
#pragma once
|
|
|
|
|
2024-03-18 09:49:38 -07:00
|
|
|
// Compilation functions
|
|
|
|
|
2024-02-04 12:23:59 -08:00
|
|
|
#include <gc/cord.h>
|
|
|
|
#include <gc.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2024-03-09 21:03:21 -08:00
|
|
|
#include "builtins/util.h"
|
2024-02-13 11:42:33 -08:00
|
|
|
#include "environment.h"
|
2024-02-04 12:23:59 -08:00
|
|
|
|
2024-02-17 23:22:31 -08:00
|
|
|
typedef struct {
|
2024-03-03 12:04:36 -08:00
|
|
|
const char *module_name;
|
2024-04-20 11:55:27 -07:00
|
|
|
env_t *env;
|
2024-05-27 15:02:40 -07:00
|
|
|
CORD header, c_file;
|
2024-02-17 23:22:31 -08:00
|
|
|
} module_code_t;
|
|
|
|
|
2024-03-09 15:32:36 -08:00
|
|
|
CORD expr_as_text(env_t *env, CORD expr, type_t *t, CORD color);
|
2024-02-17 23:22:31 -08:00
|
|
|
module_code_t compile_file(ast_t *ast);
|
2024-03-17 17:40:40 -07:00
|
|
|
CORD compile_type_ast(env_t *env, type_ast_t *t);
|
|
|
|
CORD compile_declaration(env_t *env, type_t *t, const char *name);
|
|
|
|
CORD compile_type(env_t *env, type_t *t);
|
2024-02-13 11:42:33 -08:00
|
|
|
CORD compile(env_t *env, ast_t *ast);
|
2024-03-06 09:41:18 -08:00
|
|
|
void compile_namespace(env_t *env, const char *ns_name, ast_t *block);
|
2024-02-13 11:42:33 -08:00
|
|
|
CORD compile_statement(env_t *env, ast_t *ast);
|
2024-02-17 16:32:30 -08:00
|
|
|
CORD compile_type_info(env_t *env, type_t *t);
|
2024-04-20 11:55:27 -07:00
|
|
|
CORD compile_cli_arg_call(env_t *env, CORD fn_name, type_t *fn_type);
|
2024-02-04 12:23:59 -08:00
|
|
|
|
|
|
|
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0
|