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
use super::*;
impl ops::Add for Value {
type Output = Value;
fn add(self, rhs: Value) -> Value { self.consume().add(rhs.consume()).value() }
}
impl<'a> ops::Add<&'a Value> for Value {
type Output = Value;
fn add(self, rhs: &Value) -> Value { self + rhs.split_out() }
}
impl<'a> ops::Add<Value> for &'a Value {
type Output = Value;
fn add(self, rhs: Value) -> Value { self.split_out() + rhs }
}
impl<'a> ops::Add for &'a Value {
type Output = Value;
fn add(self, rhs: &Value) -> Value { self.split_out() + rhs.split_out() }
}
impl ops::Sub for Value {
type Output = Value;
fn sub(self, rhs: Value) -> Value { self.consume().sub(rhs.consume()).value() }
}
impl<'a> ops::Sub<&'a Value> for Value {
type Output = Value;
fn sub(self, rhs: &Value) -> Value { self - rhs.split_out() }
}
impl<'a> ops::Sub<Value> for &'a Value {
type Output = Value;
fn sub(self, rhs: Value) -> Value { self.split_out() - rhs }
}
impl<'a> ops::Sub for &'a Value {
type Output = Value;
fn sub(self, rhs: &Value) -> Value { self.split_out() - rhs.split_out() }
}
impl ops::Mul for Value {
type Output = Value;
fn mul(self, rhs: Value) -> Value { self.consume().mul(rhs.consume()).value() }
}
impl<'a> ops::Mul<&'a Value> for Value {
type Output = Value;
fn mul(self, rhs: &Value) -> Value { self * rhs.split_out() }
}
impl<'a> ops::Mul<Value> for &'a Value {
type Output = Value;
fn mul(self, rhs: Value) -> Value { self.split_out() * rhs }
}
impl<'a> ops::Mul for &'a Value {
type Output = Value;
fn mul(self, rhs: &Value) -> Value { self.split_out() * rhs.split_out() }
}
impl ops::Div for Value {
type Output = Value;
fn div(self, rhs: Value) -> Value { self.consume().div(rhs.consume()).value() }
}
impl<'a> ops::Div<&'a Value> for Value {
type Output = Value;
fn div(self, rhs: &Value) -> Value { self / rhs.split_out() }
}
impl<'a> ops::Div<Value> for &'a Value {
type Output = Value;
fn div(self, rhs: Value) -> Value { self.split_out() / rhs }
}
impl<'a> ops::Div for &'a Value {
type Output = Value;
fn div(self, rhs: &Value) -> Value { self.split_out() / rhs.split_out() }
}
impl ops::Rem for Value {
type Output = Value;
fn rem(self, rhs: Value) -> Value { self.consume().rem(rhs.consume()).value() }
}
impl<'a> ops::Rem<&'a Value> for Value {
type Output = Value;
fn rem(self, rhs: &Value) -> Value { self % rhs.split_out() }
}
impl<'a> ops::Rem<Value> for &'a Value {
type Output = Value;
fn rem(self, rhs: Value) -> Value { self.split_out() % rhs }
}
impl<'a> ops::Rem for &'a Value {
type Output = Value;
fn rem(self, rhs: &Value) -> Value { self.split_out() % rhs.split_out() }
}
impl ops::Neg for Value {
type Output = Value;
fn neg(self) -> Value { self.consume().neg().value() }
}
impl<'a> ops::Neg for &'a Value {
type Output = Value;
fn neg(self) -> Value { -(self.split_out()) }
}
impl ops::Not for Value {
type Output = Value;
fn not(self) -> Value { !(&self) }
}
impl<'a> ops::Not for &'a Value {
type Output = Value;
fn not(self) -> Value {
if self.handle().is_not() {
Handle::tru().value()
} else {
Handle::fals().value()
}
}
}
impl ops::BitAnd for Value {
type Output = Value;
fn bitand(self, rhs: Value) -> Value { self.consume().bitand(rhs.consume()).value() }
}
impl<'a> ops::BitAnd<&'a Value> for Value {
type Output = Value;
fn bitand(self, rhs: &Value) -> Value { self & rhs.split_out() }
}
impl<'a> ops::BitAnd<Value> for &'a Value {
type Output = Value;
fn bitand(self, rhs: Value) -> Value { self.split_out() & rhs }
}
impl<'a> ops::BitAnd for &'a Value {
type Output = Value;
fn bitand(self, rhs: &Value) -> Value { self.split_out() & rhs.split_out() }
}
impl ops::BitOr for Value {
type Output = Value;
fn bitor(self, rhs: Value) -> Value { self.consume().bitor(rhs.consume()).value() }
}
impl<'a> ops::BitOr<&'a Value> for Value {
type Output = Value;
fn bitor(self, rhs: &Value) -> Value { self | rhs.split_out() }
}
impl<'a> ops::BitOr<Value> for &'a Value {
type Output = Value;
fn bitor(self, rhs: Value) -> Value { self.split_out() | rhs }
}
impl<'a> ops::BitOr for &'a Value {
type Output = Value;
fn bitor(self, rhs: &Value) -> Value { self.split_out() | rhs.split_out() }
}
impl ops::BitXor for Value {
type Output = Value;
fn bitxor(self, rhs: Value) -> Value { self.consume().bitxor(rhs.consume()).value() }
}
impl<'a> ops::BitXor<&'a Value> for Value {
type Output = Value;
fn bitxor(self, rhs: &Value) -> Value { self ^ rhs.split_out() }
}
impl<'a> ops::BitXor<Value> for &'a Value {
type Output = Value;
fn bitxor(self, rhs: Value) -> Value { self.split_out() ^ rhs }
}
impl<'a> ops::BitXor for &'a Value {
type Output = Value;
fn bitxor(self, rhs: &Value) -> Value { self.split_out() ^ rhs.split_out() }
}
impl ops::Shl<u32> for Value {
type Output = Value;
fn shl(self, rhs: u32) -> Value { self.consume().shl(rhs).value() }
}
impl<'a> ops::Shl<u32> for &'a Value {
type Output = Value;
fn shl(self, rhs: u32) -> Value { self.split_out() << rhs }
}
impl ops::Shr<u32> for Value {
type Output = Value;
fn shr(self, rhs: u32) -> Value { self.consume().shr(rhs).value() }
}
impl<'a> ops::Shr<u32> for &'a Value {
type Output = Value;
fn shr(self, rhs: u32) -> Value { self.split_out() << rhs }
}