21 lines
392 B
Plaintext
21 lines
392 B
Plaintext
// Test MIR control flow and exception handling - Phase 5
|
|
|
|
// Test loop functionality
|
|
local counter
|
|
counter = 0
|
|
|
|
loop(counter < 3) {
|
|
print(counter)
|
|
counter = counter + 1
|
|
}
|
|
|
|
// Test try/catch functionality
|
|
try {
|
|
print("In try block")
|
|
throw "Test exception"
|
|
print("This should not execute")
|
|
} catch (exception) {
|
|
print("Caught exception")
|
|
}
|
|
|
|
print("Program completed") |