forked from IronLanguages/ironpython3
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPythonOperationKind.cs
More file actions
213 lines (199 loc) · 7.89 KB
/
PythonOperationKind.cs
File metadata and controls
213 lines (199 loc) · 7.89 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
#nullable enable
namespace IronPython.Runtime.Binding {
/// <summary>
/// Custom dynamic site kinds for simple sites that just take a fixed set of parameters.
/// </summary>
internal enum PythonOperationKind {
None,
/// <summary>
/// Unary operator.
///
/// Gets various documentation about the object returned as a string
/// </summary>
Documentation,
/// <summary>
/// Unary operator.
///
/// Gets information about the type of parameters, returned as a string.
/// </summary>
CallSignatures,
/// <summary>
/// Unary operator.
///
/// Checks whether the object is callable or not, returns true if it is.
/// </summary>
IsCallable,
Hash,
/// <summary>
/// Binary operator.
///
/// Checks to see if the instance contains another object. Returns true or false.
/// </summary>
Contains,
/// <summary>
/// Unary operator.
///
/// Returns the number of items stored in the object.
/// </summary>
Length,
/// <summary>
/// Binary operator.
///
/// Compares two instances returning an integer indicating the relationship between them. May
/// throw if the object types are uncomparable.
/// </summary>
Compare,
/// <summary>
/// Binary operator.
///
/// Returns both the dividend and quotioent of x / y.
/// </summary>
DivMod,
/// <summary>
/// Unary operator.
///
/// Get the absolute value of the instance.
/// </summary>
AbsoluteValue,
/// <summary>
/// Unary operator.
///
/// Gets the positive value of the instance.
/// </summary>
Positive,
/// <summary>
/// Unary operator.
///
/// Negates the instance and return the new value.
/// </summary>
Negate,
/// <summary>
/// Unary operator.
///
/// Returns the ones complement of the instance.
/// </summary>
OnesComplement,
GetItem,
SetItem,
DeleteItem,
/// <summary>
/// Unary operator.
///
/// Boolean negation
/// </summary>
IsFalse,
/// <summary>
/// Unary operator.
///
/// Negation, returns object
/// </summary>
Not,
/// <summary>
/// Get enumerator for iteration binder. Returns a KeyValuePair<IEnumerator, IDisposable>
///
/// The IEnumerator is used for iteration. The IDisposable is provided if the object was an
/// IEnumerable or IEnumerable<T> and is a disposable object.
/// </summary>
GetEnumeratorForIteration,
AIter,
ANext,
///<summary>Operator for performing add</summary>
Add,
///<summary>Operator for performing sub</summary>
Subtract,
///<summary>Operator for performing pow</summary>
Power,
///<summary>Operator for performing mul</summary>
Multiply,
///<summary>Operator for performing matmul</summary>
MatMult,
///<summary>Operator for performing floordiv</summary>
FloorDivide,
///<summary>Operator for performing truediv</summary>
TrueDivide,
///<summary>Operator for performing mod</summary>
Mod,
///<summary>Operator for performing lshift</summary>
LeftShift,
///<summary>Operator for performing rshift</summary>
RightShift,
///<summary>Operator for performing and</summary>
BitwiseAnd,
///<summary>Operator for performing or</summary>
BitwiseOr,
///<summary>Operator for performing xor</summary>
ExclusiveOr,
///<summary>Operator for performing lt</summary>
LessThan = ExclusiveOr + 1 | Comparison,
///<summary>Operator for performing gt</summary>
GreaterThan = LessThan + 1 | Comparison,
///<summary>Operator for performing le</summary>
LessThanOrEqual = GreaterThan + 1 | Comparison,
///<summary>Operator for performing ge</summary>
GreaterThanOrEqual = LessThanOrEqual + 1 | Comparison,
///<summary>Operator for performing eq</summary>
Equal = GreaterThanOrEqual + 1 | Comparison,
///<summary>Operator for performing ne</summary>
NotEqual = Equal + 1 | Comparison,
///<summary>Operator for performing in-place add</summary>
InPlaceAdd = Add | InPlace,
///<summary>Operator for performing in-place sub</summary>
InPlaceSubtract = Subtract | InPlace,
///<summary>Operator for performing in-place pow</summary>
InPlacePower = Power | InPlace,
///<summary>Operator for performing in-place mul</summary>
InPlaceMultiply = Multiply | InPlace,
///<summary>Operator for performing in-place matmul</summary>
InPlaceMatMult = MatMult | InPlace,
///<summary>Operator for performing in-place floordiv</summary>
InPlaceFloorDivide = FloorDivide | InPlace,
///<summary>Operator for performing in-place truediv</summary>
InPlaceTrueDivide = TrueDivide | InPlace,
///<summary>Operator for performing in-place mod</summary>
InPlaceMod = Mod | InPlace,
///<summary>Operator for performing in-place lshift</summary>
InPlaceLeftShift = LeftShift | InPlace,
///<summary>Operator for performing in-place rshift</summary>
InPlaceRightShift = RightShift | InPlace,
///<summary>Operator for performing in-place and</summary>
InPlaceBitwiseAnd = BitwiseAnd | InPlace,
///<summary>Operator for performing in-place or</summary>
InPlaceBitwiseOr = BitwiseOr | InPlace,
///<summary>Operator for performing in-place xor</summary>
InPlaceExclusiveOr = ExclusiveOr | InPlace,
///<summary>Operator for performing reverse add</summary>
ReverseAdd = Add | Reversed,
///<summary>Operator for performing reverse sub</summary>
ReverseSubtract = Subtract | Reversed,
///<summary>Operator for performing reverse pow</summary>
ReversePower = Power | Reversed,
///<summary>Operator for performing reverse mul</summary>
ReverseMultiply = Multiply | Reversed,
///<summary>Operator for performing reverse matmul</summary>
ReverseMatMult = MatMult | Reversed,
///<summary>Operator for performing reverse floordiv</summary>
ReverseFloorDivide = FloorDivide | Reversed,
///<summary>Operator for performing reverse truediv</summary>
ReverseTrueDivide = TrueDivide | Reversed,
///<summary>Operator for performing reverse mod</summary>
ReverseMod = Mod | Reversed,
///<summary>Operator for performing reverse lshift</summary>
ReverseLeftShift = LeftShift | Reversed,
///<summary>Operator for performing reverse rshift</summary>
ReverseRightShift = RightShift | Reversed,
///<summary>Operator for performing reverse and</summary>
ReverseBitwiseAnd = BitwiseAnd | Reversed,
///<summary>Operator for performing reverse or</summary>
ReverseBitwiseOr = BitwiseOr | Reversed,
///<summary>Operator for performing reverse xor</summary>
ReverseExclusiveOr = ExclusiveOr | Reversed,
///<summary>Operator for performing reverse divmod</summary>
ReverseDivMod = DivMod | Reversed,
InPlace = 0x20000000,
Reversed = 0x10000000,
Comparison = 0x08000000,
}
}