diff --git a/examples/scopes.ion b/examples/scopes.ion index dbf8a93da9f85179a57d577306db5116c9957426..4f7d6312c15945f9cd5910dab4df5b74e2ef7625 100644 --- a/examples/scopes.ion +++ b/examples/scopes.ion @@ -1,9 +1,28 @@ -let x = 5 +if test 1 == 1 + let x = 5 + + if test 1 == 1 + let x = 2 + let y = 3 + end + + echo $x + echo $y +end if test 1 == 1 - let x = 2 - let y = 3 + let x = 1 + + fn print + echo $x + echo $y + end + + if test 1 == 1 + let y = 2 + print + end end -echo "$x" -echo "$y" +echo $x +echo $y diff --git a/examples/scopes.out b/examples/scopes.out index 9a7456b54df272ef6e98ab7ba0784c8970b04808..15020d142b9d1f487c1adbd7382b5d219879b334 100644 --- a/examples/scopes.out +++ b/examples/scopes.out @@ -1,2 +1,6 @@ 2 +1 + + +