kai
kai copied to clipboard
An expressive low level programming language
This is due to how automatic semicolon insertion works (or rather doesn't) ``` outer: for _ in arr { ``` > Error: Expected operand, found 'for'
``` fn(func: ($T, T, T, T) -> T, T, T, T, a, b, c, d: T) -> T, T, T, T { /* ... */ } ``` It should be...
``` f :: fn(a: any) -> void { } main :: fn() -> void { a := struct{} f(a) } ``` without the call to `f` the following error is...
``` #import kai("arrays") main :: fn() -> void { buf := []u8{} arrays.Append(&buf, true ? "i" : "u") } ``` > Cannot convert 'true ? "i" : "u"' (type string)...
``` a :: fn(b: any) -> void { } S :: struct{} main :: fn() -> void { a([]u8{}) a(S{}) } ```
FuncLit will now include a FuncType. The parser for func type allows omission of parameter names, as such we should allow the FuncLit to still use the parameters through `$0`...
``` main :: fn() -> void { switch 5 { case 1: break a := 1 } } ```
``` main :: fn() -> void { err := false err := false } ``` Crashes the compiler