source:
CIVL/examples/languageFeatures/scoping.cvl@
85d4675
| Last change on this file since 85d4675 was 36b5ada, checked in by , 12 years ago | |
|---|---|
|
|
| File size: 218 bytes | |
| Line | |
|---|---|
| 1 | /* Commandline execution: |
| 2 | * civl verify scoping.cvl |
| 3 | * */ |
| 4 | #include <civlc.h> |
| 5 | |
| 6 | void main() { |
| 7 | int x = 0; |
| 8 | |
| 9 | for (int i = 0; i < 5; i++) { |
| 10 | int x = i + 1; |
| 11 | x++; |
| 12 | $assert x == i + 2; |
| 13 | } |
| 14 | $assert x == 0; |
| 15 | } |
Note:
See TracBrowser
for help on using the repository browser.
