Core: Fix array counting
This commit is contained in:
@@ -3,7 +3,7 @@ call "..\misc\compile_setup.bat"
|
|||||||
|
|
||||||
bld --dont_compile_core
|
bld --dont_compile_core
|
||||||
cd build
|
cd build
|
||||||
core_main.exe rtsgame/main.core
|
rem core_main.exe rtsgame/main.core
|
||||||
bld --dont_compile_core --link=vendor/raylib/windows/raylibdll.lib
|
bld --dont_compile_core --link=vendor/raylib/windows/raylibdll.lib
|
||||||
rem build\generated_main.exe
|
rem build\generated_main.exe
|
||||||
cd ..
|
cd ..
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ Add(&guys, {100, 100})
|
|||||||
|
|
||||||
|
|
||||||
// @reproduction
|
// @reproduction
|
||||||
// MAP: [16*16]int = {0, 1}
|
//
|
||||||
//
|
//
|
||||||
// This generates: int MAP[256] = (int [256]){[0] = 0, [0] = 1}; it doesn't work because of the (int[256]) is this MSVC being retarded here? not supporting C properly?
|
// This generates: int MAP[256] = (int [256]){[0] = 0, [0] = 1}; it doesn't work because of the (int[256]) is this MSVC being retarded here? not supporting C properly?
|
||||||
// Also this ^ ^
|
// Also this ^ ^
|
||||||
@@ -87,6 +87,7 @@ MouseSelectedActors: Array(*MAP.Actor) // @todo: ids
|
|||||||
main :: (): int
|
main :: (): int
|
||||||
MAP.Init()
|
MAP.Init()
|
||||||
|
|
||||||
|
// HERE_IT_IS: [16*16]int = {0, 1}
|
||||||
|
|
||||||
// InitAudioDevice()
|
// InitAudioDevice()
|
||||||
// sound := LoadSound("catune - Pass the town, and to the C.mp3")
|
// sound := LoadSound("catune - Pass the town, and to the C.mp3")
|
||||||
|
|||||||
@@ -1040,7 +1040,7 @@ resolve_compound_array(Ast_Call *node, Ast_Type *type) {
|
|||||||
if (is_array(type) && node->exprs.len > size)
|
if (is_array(type) && node->exprs.len > size)
|
||||||
compiler_error(node->pos, "Too many items in compound expression, expected: %lld got: %lld", size, node->exprs.len);
|
compiler_error(node->pos, "Too many items in compound expression, expected: %lld got: %lld", size, node->exprs.len);
|
||||||
|
|
||||||
S64 default_counter = 0;
|
int default_counter = 0;
|
||||||
For(node->exprs) {
|
For(node->exprs) {
|
||||||
if (is_flag_set(it->call_flags, CALL_NAME))
|
if (is_flag_set(it->call_flags, CALL_NAME))
|
||||||
compiler_error(it->pos, "Arrays can't have named compound expression arguments");
|
compiler_error(it->pos, "Arrays can't have named compound expression arguments");
|
||||||
@@ -1064,6 +1064,7 @@ resolve_compound_array(Ast_Call *node, Ast_Type *type) {
|
|||||||
make_sure_value_is_compatible_with_type(it->pos, &item, item_type, TYPE_AND_EXPR_REQUIRED);
|
make_sure_value_is_compatible_with_type(it->pos, &item, item_type, TYPE_AND_EXPR_REQUIRED);
|
||||||
it->resolved_type = item_type;
|
it->resolved_type = item_type;
|
||||||
try_propagating_resolved_type_to_untyped_literals(it->item, it->resolved_type);
|
try_propagating_resolved_type_to_untyped_literals(it->item, it->resolved_type);
|
||||||
|
default_counter += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user