@@ -18,50 +18,42 @@ func (*RatioLiteral) literal() {}
18
18
func (* NumberLiteral ) literal () {}
19
19
func (* StringLiteral ) literal () {}
20
20
21
- func (l * AssetLiteral ) GetRange () Range { return l .Range }
22
- func (l * MonetaryLiteral ) GetRange () Range { return l .Range }
23
- func (l * AccountLiteral ) GetRange () Range { return l .Range }
24
- func (l * VariableLiteral ) GetRange () Range { return l .Range }
25
- func (l * RatioLiteral ) GetRange () Range { return l .Range }
26
- func (l * NumberLiteral ) GetRange () Range { return l .Range }
27
- func (l * StringLiteral ) GetRange () Range { return l .Range }
28
-
29
21
type (
30
22
AssetLiteral struct {
31
- Range Range
23
+ Range
32
24
Asset string
33
25
}
34
26
35
27
NumberLiteral struct {
36
- Range Range
28
+ Range
37
29
Number int
38
30
}
39
31
40
32
StringLiteral struct {
41
- Range Range
33
+ Range
42
34
String string
43
35
}
44
36
45
37
MonetaryLiteral struct {
46
- Range Range
38
+ Range
47
39
Asset Literal
48
40
Amount Literal
49
41
}
50
42
51
43
AccountLiteral struct {
52
- Range Range
53
- Name string
44
+ Range
45
+ Name string
54
46
}
55
47
56
48
RatioLiteral struct {
57
- Range Range
49
+ Range
58
50
Numerator * big.Int
59
51
Denominator * big.Int
60
52
}
61
53
62
54
VariableLiteral struct {
63
- Range Range
64
- Name string
55
+ Range
56
+ Name string
65
57
}
66
58
)
67
59
@@ -70,7 +62,7 @@ func (r RatioLiteral) ToRatio() *big.Rat {
70
62
}
71
63
72
64
type RemainingAllotment struct {
73
- Range Range
65
+ Range
74
66
}
75
67
76
68
func (a * AccountLiteral ) IsWorld () bool {
@@ -90,34 +82,28 @@ func (*SourceAccount) source() {}
90
82
func (* SourceCapped ) source () {}
91
83
func (* SourceOverdraft ) source () {}
92
84
93
- func (s * SourceAccount ) GetRange () Range { return s .Literal .GetRange () }
94
- func (s * SourceInorder ) GetRange () Range { return s .Range }
95
- func (s * SourceAllotment ) GetRange () Range { return s .Range }
96
- func (s * SourceCapped ) GetRange () Range { return s .Range }
97
- func (s * SourceOverdraft ) GetRange () Range { return s .Range }
98
-
99
85
type (
100
86
SourceAccount struct {
101
- Literal Literal
87
+ Literal
102
88
}
103
89
104
90
SourceInorder struct {
105
- Range Range
91
+ Range
106
92
Sources []Source
107
93
}
108
94
SourceAllotment struct {
109
- Range Range
95
+ Range
110
96
Items []SourceAllotmentItem
111
97
}
112
98
113
99
SourceCapped struct {
114
- Range Range
115
- From Source
116
- Cap Literal
100
+ Range
101
+ From Source
102
+ Cap Literal
117
103
}
118
104
119
105
SourceOverdraft struct {
120
- Range Range
106
+ Range
121
107
Address Literal
122
108
Bounded * Literal
123
109
}
@@ -130,48 +116,44 @@ func (*RatioLiteral) allotmentValue() {}
130
116
func (* VariableLiteral ) allotmentValue () {}
131
117
132
118
type SourceAllotmentItem struct {
133
- Range Range
119
+ Range
134
120
Allotment AllotmentValue
135
121
From Source
136
122
}
137
123
138
124
// Destination exprs
139
125
type Destination interface {
140
126
destination ()
141
- GetRange () Range
127
+ Ranged
142
128
}
143
129
144
130
func (* DestinationInorder ) destination () {}
145
131
func (* DestinationAccount ) destination () {}
146
132
func (* DestinationAllotment ) destination () {}
147
133
148
- func (d * DestinationAccount ) GetRange () Range { return d .Literal .GetRange () }
149
- func (d * DestinationInorder ) GetRange () Range { return d .Range }
150
- func (d * DestinationAllotment ) GetRange () Range { return d .Range }
151
-
152
134
type (
153
135
DestinationAccount struct {
154
- Literal Literal
136
+ Literal
155
137
}
156
138
157
139
DestinationInorder struct {
158
- Range Range
140
+ Range
159
141
Clauses []DestinationInorderClause
160
142
Remaining KeptOrDestination
161
143
}
162
144
163
145
DestinationInorderClause struct {
164
- Range Range
165
- Cap Literal
166
- To KeptOrDestination
146
+ Range
147
+ Cap Literal
148
+ To KeptOrDestination
167
149
}
168
150
)
169
151
170
152
type KeptOrDestination interface {
171
153
keptOrDestination ()
172
154
}
173
155
type DestinationKept struct {
174
- Range Range
156
+ Range
175
157
}
176
158
type DestinationTo struct {
177
159
Destination Destination
@@ -181,12 +163,12 @@ func (*DestinationKept) keptOrDestination() {}
181
163
func (* DestinationTo ) keptOrDestination () {}
182
164
183
165
type DestinationAllotment struct {
184
- Range Range
166
+ Range
185
167
Items []DestinationAllotmentItem
186
168
}
187
169
188
170
type DestinationAllotmentItem struct {
189
- Range Range
171
+ Range
190
172
Allotment AllotmentValue
191
173
To KeptOrDestination
192
174
}
@@ -195,22 +177,19 @@ type DestinationAllotmentItem struct {
195
177
196
178
type Statement interface {
197
179
statement ()
198
- GetRange () Range
180
+ Ranged
199
181
}
200
182
201
183
func (* FnCall ) statement () {}
202
184
func (* SendStatement ) statement () {}
203
185
204
- func (s * FnCall ) GetRange () Range { return s .Range }
205
- func (s * SendStatement ) GetRange () Range { return s .Range }
206
-
207
186
type FnCallIdentifier struct {
208
- Range Range
209
- Name string
187
+ Range
188
+ Name string
210
189
}
211
190
212
191
type FnCall struct {
213
- Range Range
192
+ Range
214
193
Caller * FnCallIdentifier
215
194
Args []Literal
216
195
}
@@ -220,27 +199,27 @@ type SentValueLiteral struct {
220
199
Monetary Literal
221
200
}
222
201
type SentValueAll struct {
223
- Range Range
202
+ Range
224
203
Asset Literal
225
204
}
226
205
227
206
func (* SentValueLiteral ) sentValue () {}
228
207
func (* SentValueAll ) sentValue () {}
229
208
230
209
type SendStatement struct {
231
- Range Range
210
+ Range
232
211
SentValue SentValue
233
212
Source Source
234
213
Destination Destination
235
214
}
236
215
237
216
type TypeDecl struct {
238
- Range Range
239
- Name string
217
+ Range
218
+ Name string
240
219
}
241
220
242
221
type VarDeclaration struct {
243
- Range Range
222
+ Range
244
223
Name * VariableLiteral
245
224
Type * TypeDecl
246
225
Origin * FnCall
0 commit comments