Files
c3c/test/test_suite/subarrays/slice_syntax.c3
Christoffer Lerno 4da36dfed9 Optimized and improved aggregate initialization. Compound literal updated to Foo({ 1, 2 })-style. ".name = x" style initialization for named arguments and designated initializers. Added runtime messages on panics. subarrays convert implictly to pointers. len/len() functions. Fix taking slice of pointer. Vararg fixes
Consistent length typedef.

First stab at initializers.

Change compound literal to Foo({ 1, 2 }) style.

Fixed up some tests.

Optimize the zero struct codegen.

Optimize union empty initializer.

Fix issues with unions. Added alignment to globals. Added some union tests.

Use puts to emit error messages during runtime. Fixup of int[] -> int* style conversions.

Fix implicit conversion of int[3]* -> int*

Fix int[] size. Use () to invoke the length of a subarray. Fix taking a slice of a pointer. Limit the number of members in a struct.

Fixes to vararg using debug and cleanups to slices.
2020-12-22 21:55:52 +01:00

24 lines
548 B
Plaintext

func void test()
{
int[6] feok2 = { 1, 8, 100, 293, 23982, 34};
int[] feok = &feok2;
int[] flok = feok2[3..5];
int[] flak = flok[1..2];
flok = feok2[..5];
flok = feok2[..^2];
flok = feok2[..];
flok = feok2[^3..];
flok = feok2[^4..5];
flok = feok2[2..^2];
flok = feok2[^3..^1];
flok = feok2[..];
flak = flok[..6];
flak = flok[..^2];
flak = flok[..];
flak = flok[^3..];
flak = flok[^4..5];
flak = flok[2..^2];
flak = flok[^3..^1];
int* p = null;
// TODO p[-1..20];
}