/
kotlin.angle
119 lines (94 loc) · 2.12 KB
/
kotlin.angle
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
schema kotlin.1 {
type Unit = {}
predicate File : string
predicate Package : string
type Loc = {
file : File,
offset : nat,
}
# Visibility scope of declaration
type Visibility = enum { Private | Protected | Public | Internal }
type Variance = enum { InVariance | OutVariance | Invariant }
type Modifier = enum {
Data | Value | Sealed | Annotation | Enum |
Public | Internal | Protected | Private |
Interface | Abstract | Open | Final |
Expect | Actual |
Inner |
}
type Nullability = enum { NotNull | Nullable | Unknown }
predicate QName : {
package : Package,
name : string,
}
predicate TypeRef : {
explicitRef: {
class : QName,
typeParameters : [Type],
} |
parameterRef : string |
star : Unit |
}
predicate Type : {
ref : TypeRef,
nullability : Nullability,
}
predicate TypeParameter : {
name : string,
isReified : bool,
bound : [Type],
variance : Variance,
}
predicate ClassDeclaration : {
name : QName,
supertypes : [TypeRef],
typeParams : [TypeParameter],
modifiers : [Modifier],
loc: Loc,
}
predicate FunctionDeclaration : {
name : QName,
argTypes : [Type],
typeParams : [TypeParameter],
returnType : Type,
modifiers : [Modifier],
loc : Loc,
}
predicate PropertyDeclaration : {
name : QName,
typeParams : [TypeParameter],
type : Type,
mutable : bool,
modifiers : [Modifier],
loc : Loc
}
predicate XRefTarget : {
class_ : ClassDeclaration |
function_ : FunctionDeclaration |
property_ : PropertyDeclaration |
}
predicate XRef : {
target : XRefTarget,
loc : Loc,
}
predicate FunctionCall : {
function : FunctionDeclaration,
loc : Loc,
}
}
schema floatLiteralAnalysis.1 {
import kotlin.1
predicate FloatLiteralUsage : {
call : kotlin.FunctionCall,
literal : string,
position : nat,
}
}
schema rangesAnalysis.1 {
import kotlin.1
predicate RangeCall : {
call : kotlin.FunctionCall,
context : enum { FOR | WHILE | IF | WHEN | PROPERTY | FOREACH | MAP | TOLIST | REQUIRE | OTHER },
}
}
schema all.1 : kotlin.1, floatLiteralAnalysis.1, rangesAnalysis.1 {}