type A = int #type A = byte type B = byte #type C = B type D = struct { int a } type E = struct { int x int y } # FIXME add a proper qualifier for referencing other types # (perhaps "stack", "data", "include", ...? or simply struct/enum/num/... [bool=enum]) type F = var E type G = ref []var H type H = [3]var A type I = enum { a b = 19 c } type J = enum byte { a b = 10 c = 20 } func test1() int func test2(int x) int func test3(int x, int y) int func test4(int x, int y) struct { int x } func testcode1() void { } func testcode2() void { int x int y { int z } } func testcode3() void { int x int y int abc int b int bbb int asdf int a1 int a2 int a3 int b1 int z int d3 int d2 int c1 int c2 int d1 } func testcode4() void { var int r int a = 1 + 2 var bool b r = 1+2 r = 1*2 r = 1 + 2*3 r = 1*2 + 3 r = 1*2 + 3*4 r = (1+2) * 3 r = 3 * (1+2_3) r = 1 + 2 r = 1 + 2 r = (1 + 2) r = (1+2) + 3*4 (r) = 1 (r = 1) ((r = 2)) (r = 3) r = (((1+2))) b = 1==2 b = not 1==2 b = 1==1 and 3==4 b = 1==1 and 2==3 and 3==4 b = 1==1 or 2==3 b = 1==1 or 2==3 or 3==4 #b = 1==2 and 2==3 or 3==4 # not allowed b = (1==2 and 2==3) or 3==4 b = 1==2 and (2==3 or 3==4) b = 1==2 and not 2==3 #b = not 1==2 and 2==3 # not allowed b = not (1==2 and 2==3) b = (not 1==2) and 2==3 # it is possible to write confusing code: # # very_long_line(blabla(1)) and # # check_admin_access() # # - perhaps we should disallow blank lines inside expression (but we could allow comments still)? # - or require a certain indentation scheme? # - or both }