implemented the while expression handling. break and continue yet to be implemented

This commit is contained in:
hyunghwan.chung
2017-01-25 13:57:14 +00:00
parent 6209b13410
commit b7a19a3b14
4 changed files with 165 additions and 21 deletions

View File

@ -159,13 +159,21 @@ class MyObject(Object)
a := 5.
##((a < 20) ifTrue: [ 1. if (a < 20) { ^^50 }. 90. ]) dump.
([true] whileTrue: [
[
'aaa' dump.
if (a > 20) { ^^506070 }.
a := a + 1.
'bbb' dump.
] ensure: [('xxxxx' & a asString) dump].
[true] whileTrue: [
[
'aaa' dump.
if (a > 20) { ^^506070 }.
a := a + 1.
'bbb' dump.
] ensure: [('xxxxx' & a asString) dump].
]
]) dump.
a := 5.
while (true) {
System logNl: a asString.
a := a + 100000000000000.
}.
'---------- END ------------' dump.
##Processor sleepFor: 20.