Skip to content

Commit 3d12cec

Browse files
committed
added tests for semicolon parsing
1 parent 239c662 commit 3d12cec

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

β€Žtest/Parse/semicolon.swift

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// RUN: %target-parse-verify-swift
2+
3+
let a = 42;
4+
var b = "b";
5+
6+
struct A {
7+
var a1: Int;
8+
let a2: Int ;
9+
var a3: Int;let a4: Int
10+
var a5: Int; let a6: Int;
11+
};
12+
13+
enum B {
14+
case B1;
15+
case B2(value: Int);
16+
case B3
17+
case B4; case B5 ; case B6;
18+
};
19+
20+
class C {
21+
var x: Int;
22+
let y = 3.14159;
23+
init(x: Int) { self.x = x; }
24+
};
25+
26+
typealias C1 = C;
27+
28+
protocol D {
29+
var foo: () -> Int { get };
30+
}
31+
32+
struct D1: D {
33+
let foo = { return 42; };
34+
}
35+
func e() -> Bool {
36+
return false;
37+
}
38+
39+
import Swift;
40+
41+
for i in 1..<1000 {
42+
if i % 2 == 1 {
43+
break;
44+
};
45+
}
46+
47+
let six = (1..<3).reduce(0, combine: +);
48+
49+
func lessThanTwo(input: UInt) -> Bool {
50+
switch input {
51+
case 0: return true;
52+
case 1, 2: return true;
53+
default:
54+
return false;
55+
}
56+
}
57+
58+
enum StarWars {
59+
enum Quality { case πŸ˜€; case πŸ™‚; case 😐; case 😏; case 😞 };
60+
case Ep4; case Ep5; case Ep6
61+
case Ep1, Ep2; case Ep3;
62+
};
63+

0 commit comments

Comments
Β (0)