After I fixed the primitive arrays with Josh's help I wanted to fix initializer lists, they are only broken because of the automatic semicolons, when this is disabled they work. Harri's matrix array initialization is primarily what inspired me.
http://enigma-dev.org/forums/index.php?topic=2397.msg24374#newThis was my attempt here:
https://github.com/enigma-dev/enigma-dev/pull/917But it ultimately fails because we simply don't have sufficient information to do this yet and a number of games are failing to parse after the changes. A better work around for the time being would be to add an option to disable automatic semicolons all together, this means you would have to always put your ';' terminating semicolons where they belong. But it would stop some things like initializer lists from breaking.
This would make the following possible in ENIGMA if you choose to disable it.
int arr[2][3][4] = { { {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} },
{ {1, 2, 3, 4}, {1, 2, 3, 4}, {1, 2, 3, 4} } };
for (int r = 0; r < 2; r++) {
for (int c = 0; c < 3; c++) {
for (int n = 0; n < 4; n++) {
show_message(string(arr[r][c][n]));
}
}
}
I would appreciate feedback on this and whether you guys think a setting for this would be nice. It should be considered an advanced setting as advanced users are more likely to properly terminate statements.