Compiling again, with double import, main and everything

This commit is contained in:
Krzosa Karol
2022-06-13 21:28:31 +02:00
parent 8260f2cc9a
commit e73820c6f5
4 changed files with 80 additions and 109 deletions

View File

@@ -156,6 +156,9 @@ gen_var(Ast_Decl *decl, B32 emit_value, B32 scope_names){
function void
gen_lambda(Intern_String name, Ast_Lambda *lambda){
bool is_foreign = is_flag_set(lambda->flags, AST_FOREIGN);
if(name == pctx->intern("main"_s)){
is_foreign = true;
}
gen_simple_decl(lambda->type->func.ret, name, lambda->parent_scope, !is_foreign);
gen("(");
For(lambda->args){
@@ -568,7 +571,7 @@ function String
end_compilation(){
generating_time_begin = os_time();
#if 0
#if 1
gen(R"==(
#include <stdint.h>
#include <stdio.h>
@@ -604,10 +607,6 @@ typedef struct String{
}String;
#define LIT(x) (String){.str=(U8 *)x, .len=sizeof(x)-1}
void entry();
int main(){
entry();
}
)==");
#endif