add type aliases, rework compiler, remove optimization
This commit is contained in:
parent
94b12f28ab
commit
d54249cffe
12 changed files with 869 additions and 1597 deletions
|
|
@ -1,8 +1,15 @@
|
|||
|
||||
assertEq(type(1), "int")
|
||||
assertEq(type("Hello"), "string")
|
||||
assertEq(type(true), "boolean")
|
||||
assertEq(typeof(1), "int")
|
||||
assertEq(typeof("Hello"), "string")
|
||||
assertEq(typeof(true), "boolean")
|
||||
|
||||
# lists
|
||||
assertEq(type(["Hello", "world"]), "list[string]")
|
||||
assertEq(type([0, 1]), "list[int]")
|
||||
assertEq(typeof(["Hello", "world"]), "[string]")
|
||||
assertEq(typeof([0, 1]), "[int]")
|
||||
assertEq(typeof((0, 1)), "(int, int)")
|
||||
|
||||
type Vec2 = (int, int)
|
||||
|
||||
fn add(a: Vec2, b: Vec2) -> Vec2 {
|
||||
(a[0] + b[0], a[1] + b[1])
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue