aboutsummaryrefslogtreecommitdiff
path: root/examples/variables.cup
diff options
context:
space:
mode:
authorMustafa Quraish <[email protected]>2022-01-29 13:52:58 -0500
committerMustafa Quraish <[email protected]>2022-01-29 13:53:57 -0500
commite403475bbf6f70b3e79b6f4503dbadcc3dad504c (patch)
tree40c77638cf96048328358e601c541ab31fb2b23a /examples/variables.cup
parentAdd some tests for local variables (diff)
downloadcup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.tar.xz
cup-e403475bbf6f70b3e79b6f4503dbadcc3dad504c.zip
Allow uninitialized variable declarations
Diffstat (limited to 'examples/variables.cup')
-rw-r--r--examples/variables.cup9
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;
}