Fixing fallout from temporary solution to field access
This commit is contained in:
@@ -11,6 +11,7 @@ pointer_type :: *S64
|
|||||||
// null_pointer: pointer_type = null
|
// null_pointer: pointer_type = null
|
||||||
|
|
||||||
if_stmt :: (cond: S64): type
|
if_stmt :: (cond: S64): type
|
||||||
|
new_types.basic_type_assignment()
|
||||||
CONSTANT :: 10
|
CONSTANT :: 10
|
||||||
thing := 10
|
thing := 10
|
||||||
if i := thing + cond, cond > CONSTANT
|
if i := thing + cond, cond > CONSTANT
|
||||||
|
|||||||
6
main.cpp
6
main.cpp
@@ -207,10 +207,7 @@ int main(int argument_count, char **arguments){
|
|||||||
printf("%s", result.str);
|
printf("%s", result.str);
|
||||||
result = compile_file("enums.kl"_s);
|
result = compile_file("enums.kl"_s);
|
||||||
printf("%s", result.str);
|
printf("%s", result.str);
|
||||||
result = compile_file("order1.kl"_s);
|
|
||||||
printf("%s", result.str);
|
|
||||||
result = compile_file("order2.kl"_s);
|
|
||||||
printf("%s", result.str);
|
|
||||||
|
|
||||||
result = compile_file("new_types.kl"_s);
|
result = compile_file("new_types.kl"_s);
|
||||||
printf("%s", result.str);
|
printf("%s", result.str);
|
||||||
@@ -222,6 +219,7 @@ int main(int argument_count, char **arguments){
|
|||||||
files.add("lambdas.kl"_s);
|
files.add("lambdas.kl"_s);
|
||||||
files.add("order1.kl"_s);
|
files.add("order1.kl"_s);
|
||||||
files.add("order2.kl"_s);
|
files.add("order2.kl"_s);
|
||||||
|
files.add("new_types.kl"_s);
|
||||||
String result = compile_files(files);
|
String result = compile_files(files);
|
||||||
printf("%s", result.str);
|
printf("%s", result.str);
|
||||||
__debugbreak();
|
__debugbreak();
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ binary_test :: (thing: S32 = 442)
|
|||||||
|
|
||||||
|
|
||||||
basic_type_assignment :: ()
|
basic_type_assignment :: ()
|
||||||
custom_data1 := Custom_Data(thing = 23)
|
// custom_data1 := Custom_Data(thing = 23)
|
||||||
custom_data2: Custom_Data
|
// custom_data2: Custom_Data
|
||||||
some_constant :: true
|
some_constant :: true
|
||||||
thing: Bool = some_constant
|
thing: Bool = some_constant
|
||||||
float_val :: 325.42
|
float_val :: 325.42
|
||||||
@@ -80,6 +80,7 @@ for_loops :: ()
|
|||||||
for j:=0, j < 10
|
for j:=0, j < 10
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
/*
|
||||||
Custom_Data :: struct
|
Custom_Data :: struct
|
||||||
thing: S32
|
thing: S32
|
||||||
|
|
||||||
@@ -108,5 +109,5 @@ array_test :: ()
|
|||||||
len := get_slice_len(thing)
|
len := get_slice_len(thing)
|
||||||
|
|
||||||
with_size: [2]Custom_Data
|
with_size: [2]Custom_Data
|
||||||
|
*/
|
||||||
// get_slice_len(with_size)
|
// get_slice_len(with_size)
|
||||||
@@ -662,7 +662,6 @@ resolve_field_access(Ast_Expr *node, Ast_Scope *context){
|
|||||||
if(!new_context){
|
if(!new_context){
|
||||||
field_access_scope = context;
|
field_access_scope = context;
|
||||||
Operand op = resolve_expr(node, AST_CANT_BE_NULL);
|
Operand op = resolve_expr(node, AST_CANT_BE_NULL);
|
||||||
field_access_scope = 0;
|
|
||||||
|
|
||||||
if(current) current->type = op.type;
|
if(current) current->type = op.type;
|
||||||
if(is_pointer(op.type)) op.type = op.type->base;
|
if(is_pointer(op.type)) op.type = op.type->base;
|
||||||
@@ -698,6 +697,7 @@ resolve_expr(Ast_Expr *ast, Resolve_Flag flags){
|
|||||||
scope = field_access_scope;
|
scope = field_access_scope;
|
||||||
}
|
}
|
||||||
Ast_Decl *decl = resolve_name(scope, node->pos, node->intern_val, flags);
|
Ast_Decl *decl = resolve_name(scope, node->pos, node->intern_val, flags);
|
||||||
|
field_access_scope = 0; // @memes
|
||||||
|
|
||||||
node->resolved_decl = decl;
|
node->resolved_decl = decl;
|
||||||
Operand result = operand(decl);
|
Operand result = operand(decl);
|
||||||
|
|||||||
Reference in New Issue
Block a user