Rewritten field access, lose functionality but I'm fine with it, it's simpler now,
might need to support casting
This commit is contained in:
@@ -184,7 +184,8 @@ gen_expr(Ast_Expr *ast){
|
||||
CASE(BINARY, Binary){
|
||||
if(node->op == TK_Dot){
|
||||
gen_expr(node->left);
|
||||
if(node->type->kind == TYPE_POINTER) gen("->");
|
||||
if(!node->type) gen("__");
|
||||
else if(node->type->kind == TYPE_POINTER) gen("->");
|
||||
else gen(".");
|
||||
gen_expr(node->right);
|
||||
return;
|
||||
@@ -426,7 +427,11 @@ compile_files(Array<String> filename){
|
||||
// by default it's name of the file
|
||||
// but if you add [package name] then it's overwritten
|
||||
Token *token = token_get();
|
||||
String filename_without_ext = string_chop_last_period(token->file.s);
|
||||
String filename_without_ext = {};
|
||||
if(string_find(token->file.s, "."_s, MatchFlag_None, &filename_without_ext.len)){
|
||||
filename_without_ext.str = token->file.str;
|
||||
} else filename_without_ext = token->file.s;
|
||||
|
||||
it.name = pctx->intern(filename_without_ext);
|
||||
|
||||
if(token_is(SAME_SCOPE) && token_is_keyword(keyword_package, 1)){
|
||||
|
||||
Reference in New Issue
Block a user