Add foreign functions
This commit is contained in:
@@ -547,6 +547,11 @@ parse_named(B32 is_global){
|
||||
}
|
||||
}
|
||||
|
||||
Ast_Flag flags = 0;
|
||||
if(token_match(TK_FOREIGN)){
|
||||
flags = set_flag(flags, AST_FOREIGN);
|
||||
}
|
||||
|
||||
Token *tname = token_get();
|
||||
if(token_match(TK_Identifier, TK_DoubleColon)){
|
||||
// @note parse struct binding
|
||||
@@ -581,5 +586,9 @@ parse_named(B32 is_global){
|
||||
parsing_error(tname, "Unexpected token: [%s] when parsing a declaration", name(tname->kind));
|
||||
}
|
||||
|
||||
if(result){
|
||||
result->flags = set_flag(result->flags, flags);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user