Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_with.nit
1 # This file is part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import kernel
16
17 class A
18 fun start do 1.output
19 fun work do 2.output
20 fun finish do 3.output
21 end
22
23 fun escape do
24 with a = new A do
25 a.work
26 if true then return
27 a.work
28 end
29 end
30
31 with new A do
32 2.output
33 2.output
34 end
35
36 with a = new A do
37 a.work
38 a.work
39 end
40
41 with a = new A do
42 a.work
43 if true then break
44 a.work
45 end
46
47 #alt1#escape