-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Capitalizes the primitive types (#46)
Closes #33
- Loading branch information
1 parent
c0b9bd1
commit 2856d73
Showing
65 changed files
with
394 additions
and
326 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
fn func(x : i32) -> i32 { | ||
fn func(x : I32) -> I32 { | ||
x | ||
} | ||
|
||
fn main() -> i32 { | ||
fn main() -> I32 { | ||
func(1, 2, 3); | ||
i32_rem_s(1, 2, 3); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
fn main() -> i32 { | ||
fn main() -> I32 { | ||
let clos = \(z) { z }; | ||
clos(1) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
struct F { | ||
x : i32 | ||
x : I32 | ||
} | ||
|
||
fn main() { | ||
F { x = true } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
struct F { | ||
x : i32 | ||
x : I32 | ||
} | ||
|
||
fn main() -> F { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
import internal : i32 from external | ||
import internal : I32 from external |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
fn main() -> i32 { | ||
fn main() -> I32 { | ||
1 + 2.0 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ fn main() { | |
return 1 | ||
} | ||
|
||
fn func() -> i32 { | ||
fn func() -> I32 { | ||
return {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
global x : i32 = 10.0 | ||
global my_fn : fn (i32) -> i32 = \(x : f32) -> f32 { x } | ||
global x : I32 = 10.0 | ||
global my_fn : fn (I32) -> I32 = \(x : F32) -> F32 { x } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
struct F { | ||
x : i32 | ||
x : I32 | ||
} | ||
|
||
fn main() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import log : fn (i32) -> unit from log | ||
import log : fn (I32) -> Unit from log | ||
|
||
fn main() { | ||
let empty: [i32] = []; | ||
let empty: [I32] = []; | ||
let single = [1]; | ||
let double = [1, 2]; | ||
let double_trailing = [1, 2,]; | ||
|
||
let nested : [[i32]] = [[], [42]]; | ||
let nested : [[I32]] = [[], [42]]; | ||
log(nested[1][0]); | ||
log([1][0]); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
import log : fn (i32) -> unit from log | ||
import log : fn (I32) -> Unit from log | ||
|
||
fn main() { | ||
let x = { 1 }; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import log : fn (i32) -> unit from log | ||
import log : fn (I32) -> Unit from log | ||
|
||
fn inferred() -> i32 { | ||
let f : fn (i32, f32) -> i32 = \(x, y) { x + 2 }; | ||
fn inferred() -> I32 { | ||
let f : fn (I32, F32) -> I32 = \(x, y) { x + 2 }; | ||
f(1, 2.0) | ||
} | ||
|
||
fn main() { | ||
let x = (\(x : i32) -> i32 { x + 1 })(10); | ||
let x = (\(x : I32) -> I32 { x + 1 })(10); | ||
log(x); | ||
|
||
let twice = \(f : fn (i32) -> i32) -> fn(i32) -> i32 { | ||
\(x : i32) -> i32 { | ||
let twice = \(f : fn (I32) -> I32) -> fn(I32) -> I32 { | ||
\(x : I32) -> I32 { | ||
f(f(x)) | ||
} | ||
}; | ||
let add1 = \(x : i32) -> i32 { x + 1 }; | ||
let add1 = \(x : I32) -> I32 { x + 1 }; | ||
log(twice(add1)(3)); | ||
log(inferred()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
module dep | ||
exports (S, V, f, log) | ||
|
||
import log : fn (i32) -> unit from log | ||
import log : fn (I32) -> Unit from log | ||
|
||
struct S { | ||
x : i32, | ||
x : I32, | ||
} | ||
|
||
variant V { | ||
struct S { y : i32 }, | ||
struct S { y : I32 }, | ||
} | ||
|
||
fn f(s : S, x : i32) { | ||
fn f(s : S, x : I32) { | ||
set s.x = s.x + x; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
fn poly[a, b](a : a, other : b) { | ||
poly#[i32, bool](1, true) | ||
poly#[I32, Bool](1, true) | ||
} | ||
|
||
struct Box[a] { | ||
content : a | ||
} | ||
|
||
fn main() -> Box[i32] { | ||
Box #[i32] { content = 42 } | ||
fn main() -> Box[I32] { | ||
Box #[I32] { content = 42 } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.