Fixed multi line error reporting for tokens. Handle infinite empty for loops. Changed cast syntax to "cast(foo as Foo)". Completed enum casts. Added more tests.

This commit is contained in:
Christoffer Lerno
2020-07-25 17:54:10 +02:00
committed by Christoffer Lerno
parent e3566ba838
commit 34c7df9ee1
43 changed files with 398 additions and 152 deletions

View File

@@ -10,8 +10,8 @@ func int main()
func string bin(int x)
{
int bits = (x == 0) ? 1 : log10(cast(x, double)) / log10(2);
string ret = str.make_repeat('0', bits);
int bits = (x == 0) ? 1 : log10(cast(x as double)) / log10(2);
string ret = str.make_repeat('0' as bits);
for (int i = 0; i < bits; i++)
{
ret[bits - i - 1] = x & 1 ? '1' : '0';