This program:
Structure First Consists Of
Nothing;
EndStructure
Structure Second Consists Of
Nothing;
EndStructure
Function main(Integer32 a, Integer32 b) Which Returns Nothing Does
InstantiateStructure First firstStructure;
InstantiateStructure Second secondStructure;
InstantiateStructure Second thirdStructure := (a > b) ? firstStructure : secondStructure; // This line contains the error.
EndFunction
makes the compiler crash with the following message:
Running the tests...
All the tests passed in 4 milliseconds.
Reading the file "debug.aec"...
All characters read in 0 milliseconds.
Tokenizing the program...
Finished tokenizing the program in 0 milliseconds.
I have made a forum thread about how to speed up the tokenizer,
in case you are interested:
https://www.forum.hr/showthread.php?t=1243509
Parsing the program...
Finished parsing the program in 0 milliseconds.
Compiling the program...
Line 10, Column 29, Internal compiler error: Some part of the compiler attempted to compile an array with size less than 1, which doesn't make sense. Throwing an exception!
Internal compiler error: Uncaught exception in the compiler: St13runtime_error: Compiling an array of negative size!
If you have time, please report this to me on GitHub as an issue:
https://github.com/FlatAssembler/AECforWebAssembly/issues
Thanks to the StackExchange user kaya3 for warning me of this (that this is a common pitfall in compilers when dealing with the ?: operator).
This program:
makes the compiler crash with the following message:
Thanks to the StackExchange user kaya3 for warning me of this (that this is a common pitfall in compilers when dealing with the
?:operator).