summaryrefslogtreecommitdiff
path: root/tests/examplefiles/scala/end.scala
blob: b09bf2dc85b0af1d7af1decc0919d83813ec81b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
new Foo:
  // ...
end new
end extension
end if
end while
end for
end match
class Foo
end Foo
end bar
end `bar`
end // test comment
package p1.p2:
  abstract class C():
    def this(x: Int) =
      this()
      if x > 0 then
        val a :: b =
          x :: Nil
        end val // test comment
        var y =
          x
        end y // test comment
        while y > 0 do
          println(y)
          y -= 1
        end while // test comment
        try
          x match
            case 0 => println("0")
            case _ =>
          end match // test comment
        finally
          println("done")
        end try // test comment
      end if // test comment
    end this // test comment
    def f: String
  end C // test comment
  object C:
    given C =
      new C:
        def f = "!"
        end f // test comment
      end new // test comment
    end given // test comment
  end C // test comment
  extension (x: C)
    def ff: String = x.f ++ x.f
  end extension // test comment
end p2 // test comment