Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. {
  2. var x, y, z : Integer
  3.  
  4. % Simple variable shadowing test
  5. x := 0
  6. if true {
  7. var x : Boolean
  8. x := false
  9. }
  10. x := 1
  11.  
  12. % Test shadowing for deeper scoping
  13. y := 0
  14. z := 1
  15. while z = 1 and y + 1 = 1 do {
  16. var y : Boolean
  17. y := true
  18.  
  19. if y {
  20. var y : Integer
  21. y := 0
  22. }
  23. y := false
  24. z := 0
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement