diff options
Diffstat (limited to 'test/data/globals.yx')
-rw-r--r-- | test/data/globals.yx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/data/globals.yx b/test/data/globals.yx new file mode 100644 index 0000000..c933c6d --- /dev/null +++ b/test/data/globals.yx @@ -0,0 +1,17 @@ +/* Globals without initializers */ +x: int; +y: u16; + +/* Globals with initializers */ +x′ := 42; +y′ := 69; + +/* Globals with initializers and types */ +x″: int = 42; +y″: u16 = 69; + +/* Globals can be shadowed */ +foo :: () int { + x := x + 1; + return x; /* 1 */ +} |