diff options
| author | Mustafa Quraish <[email protected]> | 2022-01-29 13:52:58 -0500 |
|---|---|---|
| committer | Mustafa Quraish <[email protected]> | 2022-01-29 13:53:57 -0500 |
| commit | e403475bbf6f70b3e79b6f4503dbadcc3dad504c (patch) | |
| tree | 40c77638cf96048328358e601c541ab31fb2b23a /examples/variables.cup | |
| parent | Add some tests for local variables (diff) | |
| download | cup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.tar.xz cup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.zip | |
Allow uninitialized variable declarations
Diffstat (limited to 'examples/variables.cup')
| -rw-r--r-- | examples/variables.cup | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/variables.cup b/examples/variables.cup index 3ee8ed2..60a7d6a 100644 --- a/examples/variables.cup +++ b/examples/variables.cup @@ -1,8 +1,7 @@ -fn main() { - let x: int = 5 * 10; - let y: int = x + x; - let z: int = y - x / 2; - return z; +fn main(): int { + let x: int; + let y: int; + return x; } |