link directive

This commit is contained in:
Krzosa Karol
2022-10-09 14:00:41 +02:00
parent faec89beae
commit 0049b39e17
12 changed files with 42 additions and 14 deletions

View File

@@ -924,13 +924,17 @@ parse_file(Ast_File *file){
pctx->currently_parsed_file = file;
pctx->currently_parsed_scope = file;
lex_restream(pctx, file->filecontent, file->absolute_file_path);
while(token_expect(SAME_SCOPE)){
if(token_match_pound(pctx->intern("load"_s))){
while (token_expect(SAME_SCOPE)) {
if (token_match_pound(intern_load)) {
parse_load(true);
continue;
} else if(token_match_pound(pctx->intern("import"_s))){
} else if (token_match_pound(intern_import)) {
parse_import(true);
continue;
} else if (token_match_pound(intern_link)) {
Token *file = token_expect(TK_StringLit);
add(pctx->perm, &pctx->files_to_link, file);
continue;
}
if(!file->pos){