-
Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathemit-syntax.swift
61 lines (56 loc) · 1.5 KB
/
emit-syntax.swift
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
53
54
55
56
57
58
59
60
61
// RUN: %target-swift-frontend -emit-syntax %s | %FileCheck %s
// CHECK: "kind":"kw_struct"
// CHECK: "kind":"identifier",
// CHECK: "text":"Foo"
// CHECK: "kind":"l_brace"
struct Foo {
// CHECK: "kind":"kw_let"
// CHECK: "kind":"colon"
// CHECK: "kind":"identifier"
// CHECK: "text":"Int"
let x: Int
// CHECK: "kind":"r_brace"
}
// CHECK: "kind":"kw_func"
// CHECK: "kind":"identifier"
// CHECK: "text":"Bar"
// CHECK: "kind":"l_paren"
// CHECK: "kind":"FunctionParameterList"
// CHECK: "kind":"FunctionParameter"
// CHECK: "kind":"identifier"
// CHECK: "text":"arg1"
// CHECK: "kind":"colon"
// CHECK: "kind":"identifier"
// CHECK: "text":"String"
// CHECK: null,null
// CHECK: "kind":"comma"
// CHECK: "kind":"identifier"
// CHECK: "text":"arg2"
// CHECK: "kind":"colon"
// CHECK: "kind":"identifier"
// CHECK: "text":"Int"
// CHECK: "kind":"r_paren"
// CHECK: "kind":"l_brace"
func Bar(arg1: String, arg2: Int) {
// CHECK: "kind":"r_brace"
}
// CHECK: "kind":"kw_func"
// CHECK: "text":"CheckParameterList"
// CHECK: "kind":"l_paren"
// CHECK: "text":"arg1"
// CHECK: "text":"String"
// CHECK: "kind":"ellipsis"
// CHECK: "presence":"Present"}
// CHECK: null
// CHECK: "kind":"comma"
// CHECK: "text":"arg2"
// CHECK: "text":"Int"
// CHECK: "kind":"r_paren"
// CHECK: "kind":"l_brace"
func CheckParameterList(arg1: String..., arg2: Int) {
// CHECK: "kind":"r_brace"
}
// CHECK: "leadingTrivia":[
// CHECK: "kind":"LineComment",
// CHECK: "value":"\/\/ Comment at the end of the file"
// Comment at the end of the file