resin 0.3.1 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/amber/bin/amberc +10 -350
- data/amber/js/Benchfib.deploy.js +80 -89
- data/amber/js/Benchfib.js +80 -89
- data/amber/js/Canvas.deploy.js +558 -545
- data/amber/js/Canvas.js +563 -545
- data/amber/js/Compiler-AST.deploy.js +431 -243
- data/amber/js/Compiler-AST.js +487 -244
- data/amber/js/Compiler-Core.deploy.js +201 -1045
- data/amber/js/Compiler-Core.js +208 -1207
- data/amber/js/Compiler-Exceptions.deploy.js +37 -18
- data/amber/js/Compiler-Exceptions.js +42 -18
- data/amber/js/Compiler-IR.deploy.js +1071 -774
- data/amber/js/Compiler-IR.js +1194 -848
- data/amber/js/Compiler-Inlining.deploy.js +395 -373
- data/amber/js/Compiler-Inlining.js +395 -373
- data/amber/js/Compiler-Interpreter.deploy.js +1202 -0
- data/amber/js/Compiler-Interpreter.js +1631 -0
- data/amber/js/Compiler-Semantic.deploy.js +695 -600
- data/amber/js/Compiler-Semantic.js +721 -611
- data/amber/js/Compiler-Tests.deploy.js +699 -376
- data/amber/js/Compiler-Tests.js +834 -381
- data/amber/js/Compiler.deploy.js +8563 -1805
- data/amber/js/Compiler.js +11476 -2633
- data/amber/js/Examples.deploy.js +29 -29
- data/amber/js/Examples.js +29 -29
- data/amber/js/IDE.deploy.js +3292 -2649
- data/amber/js/IDE.js +3318 -2710
- data/amber/js/Importer-Exporter.deploy.js +393 -349
- data/amber/js/Importer-Exporter.js +398 -354
- data/amber/js/Kernel-Announcements.deploy.js +53 -44
- data/amber/js/Kernel-Announcements.js +55 -44
- data/amber/js/Kernel-Classes.deploy.js +566 -368
- data/amber/js/Kernel-Classes.js +660 -402
- data/amber/js/Kernel-Collections.deploy.js +1149 -1098
- data/amber/js/Kernel-Collections.js +1183 -1116
- data/amber/js/Kernel-Exceptions.deploy.js +173 -75
- data/amber/js/Kernel-Exceptions.js +215 -77
- data/amber/js/Kernel-Methods.deploy.js +530 -313
- data/amber/js/Kernel-Methods.js +632 -338
- data/amber/js/Kernel-Objects.deploy.js +1734 -1577
- data/amber/js/Kernel-Objects.js +1867 -1654
- data/amber/js/Kernel-Tests.deploy.js +1416 -973
- data/amber/js/Kernel-Tests.js +1495 -981
- data/amber/js/Kernel-Transcript.deploy.js +23 -24
- data/amber/js/Kernel-Transcript.js +25 -26
- data/amber/js/SUnit-Tests.deploy.js +402 -0
- data/amber/js/SUnit-Tests.js +518 -0
- data/amber/js/SUnit.deploy.js +535 -237
- data/amber/js/SUnit.js +634 -246
- data/amber/js/amber.js +90 -53
- data/amber/js/boot.js +441 -255
- data/amber/js/init.js +1 -3
- data/amber/js/lib/CodeMirror/codemirror.css +3 -0
- data/amber/js/lib/CodeMirror/codemirror.js +104 -55
- data/amber/js/lib/peg-0.7.0.min.js +9 -0
- data/amber/js/parser.js +1504 -802
- data/amber/js/parser.pegjs +170 -165
- data/amber/st/Canvas.st +6 -0
- data/amber/st/Compiler-AST.st +54 -3
- data/amber/st/Compiler-Core.st +6 -551
- data/amber/st/Compiler-Exceptions.st +4 -0
- data/amber/st/Compiler-IR.st +205 -87
- data/amber/st/Compiler-Interpreter.st +597 -0
- data/amber/st/Compiler-Semantic.st +46 -21
- data/amber/st/Compiler-Tests.st +254 -7
- data/amber/st/Compiler.st +3172 -1541
- data/amber/st/IDE.st +57 -93
- data/amber/st/Importer-Exporter.st +4 -7
- data/amber/st/Kernel-Announcements.st +8 -0
- data/amber/st/Kernel-Classes.st +149 -40
- data/amber/st/Kernel-Collections.st +43 -32
- data/amber/st/Kernel-Exceptions.st +70 -1
- data/amber/st/Kernel-Methods.st +165 -27
- data/amber/st/Kernel-Objects.st +215 -140
- data/amber/st/Kernel-Tests.st +195 -10
- data/amber/st/Kernel-Transcript.st +1 -3
- data/amber/st/SUnit-Tests.st +186 -0
- data/amber/st/SUnit.st +186 -14
- data/bin/resin +6 -0
- data/lib/resin/cli.rb +19 -0
- metadata +41 -25
- data/amber/js/lib/peg-0.6.2.min.js +0 -2
- data/bin/resin-compile +0 -6
- data/bin/runresin +0 -12
@@ -1,13 +1,336 @@
|
|
1
1
|
smalltalk.addPackage('Compiler-Tests', {});
|
2
|
+
smalltalk.addClass('AbstractASTInterpreterTest', smalltalk.TestCase, [], 'Compiler-Tests');
|
3
|
+
smalltalk.addMethod(
|
4
|
+
"_analyze_forClass_",
|
5
|
+
smalltalk.method({
|
6
|
+
selector: "analyze:forClass:",
|
7
|
+
fn: function (aNode,aClass){
|
8
|
+
var self=this;
|
9
|
+
return smalltalk.withContext(function($ctx1) {
|
10
|
+
_st(_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._on_(aClass))._visit_(aNode);
|
11
|
+
$1=aNode;
|
12
|
+
return $1;
|
13
|
+
}, function($ctx1) {$ctx1.fill(self,"analyze:forClass:",{aNode:aNode,aClass:aClass}, smalltalk.AbstractASTInterpreterTest)})}
|
14
|
+
}),
|
15
|
+
smalltalk.AbstractASTInterpreterTest);
|
16
|
+
|
17
|
+
smalltalk.addMethod(
|
18
|
+
"_interpret_",
|
19
|
+
smalltalk.method({
|
20
|
+
selector: "interpret:",
|
21
|
+
fn: function (aString){
|
22
|
+
var self=this;
|
23
|
+
return smalltalk.withContext(function($ctx1) {
|
24
|
+
$1=_st(self)._interpret_withArguments_(aString,_st((smalltalk.Dictionary || Dictionary))._new());
|
25
|
+
return $1;
|
26
|
+
}, function($ctx1) {$ctx1.fill(self,"interpret:",{aString:aString}, smalltalk.AbstractASTInterpreterTest)})}
|
27
|
+
}),
|
28
|
+
smalltalk.AbstractASTInterpreterTest);
|
29
|
+
|
30
|
+
smalltalk.addMethod(
|
31
|
+
"_interpret_receiver_withArguments_",
|
32
|
+
smalltalk.method({
|
33
|
+
selector: "interpret:receiver:withArguments:",
|
34
|
+
fn: function (aString,anObject,aDictionary){
|
35
|
+
var self=this;
|
36
|
+
var ctx;
|
37
|
+
return smalltalk.withContext(function($ctx1) {
|
38
|
+
ctx=_st((smalltalk.AIContext || AIContext))._new();
|
39
|
+
_st(ctx)._receiver_(anObject);
|
40
|
+
_st(aDictionary)._keysAndValuesDo_((function(key,value){
|
41
|
+
return smalltalk.withContext(function($ctx2) {
|
42
|
+
}, function($ctx2) {$ctx2.fillBlock({key:key,value:value},$ctx1)})}));
|
43
|
+
$2=_st(self)._interpreter();
|
44
|
+
_st($2)._context_(ctx);
|
45
|
+
_st($2)._interpret_(_st(_st(_st(self)._parse_forClass_(aString,_st(anObject)._class()))._nodes())._first());
|
46
|
+
$3=_st($2)._result();
|
47
|
+
$1=$3;
|
48
|
+
return $1;
|
49
|
+
}, function($ctx1) {$ctx1.fill(self,"interpret:receiver:withArguments:",{aString:aString,anObject:anObject,aDictionary:aDictionary,ctx:ctx}, smalltalk.AbstractASTInterpreterTest)})}
|
50
|
+
}),
|
51
|
+
smalltalk.AbstractASTInterpreterTest);
|
52
|
+
|
53
|
+
smalltalk.addMethod(
|
54
|
+
"_interpret_withArguments_",
|
55
|
+
smalltalk.method({
|
56
|
+
selector: "interpret:withArguments:",
|
57
|
+
fn: function (aString,aDictionary){
|
58
|
+
var self=this;
|
59
|
+
return smalltalk.withContext(function($ctx1) {
|
60
|
+
$1=_st(self)._interpret_receiver_withArguments_(aString,_st((smalltalk.Object || Object))._new(),aDictionary);
|
61
|
+
return $1;
|
62
|
+
}, function($ctx1) {$ctx1.fill(self,"interpret:withArguments:",{aString:aString,aDictionary:aDictionary}, smalltalk.AbstractASTInterpreterTest)})}
|
63
|
+
}),
|
64
|
+
smalltalk.AbstractASTInterpreterTest);
|
65
|
+
|
66
|
+
smalltalk.addMethod(
|
67
|
+
"_interpreter",
|
68
|
+
smalltalk.method({
|
69
|
+
selector: "interpreter",
|
70
|
+
fn: function (){
|
71
|
+
var self=this;
|
72
|
+
return smalltalk.withContext(function($ctx1) {
|
73
|
+
$1=_st(self)._subclassResponsibility();
|
74
|
+
return $1;
|
75
|
+
}, function($ctx1) {$ctx1.fill(self,"interpreter",{}, smalltalk.AbstractASTInterpreterTest)})}
|
76
|
+
}),
|
77
|
+
smalltalk.AbstractASTInterpreterTest);
|
78
|
+
|
79
|
+
smalltalk.addMethod(
|
80
|
+
"_parse_",
|
81
|
+
smalltalk.method({
|
82
|
+
selector: "parse:",
|
83
|
+
fn: function (aString){
|
84
|
+
var self=this;
|
85
|
+
return smalltalk.withContext(function($ctx1) {
|
86
|
+
$1=_st(_st((smalltalk.Smalltalk || Smalltalk))._current())._parse_(aString);
|
87
|
+
return $1;
|
88
|
+
}, function($ctx1) {$ctx1.fill(self,"parse:",{aString:aString}, smalltalk.AbstractASTInterpreterTest)})}
|
89
|
+
}),
|
90
|
+
smalltalk.AbstractASTInterpreterTest);
|
91
|
+
|
92
|
+
smalltalk.addMethod(
|
93
|
+
"_parse_forClass_",
|
94
|
+
smalltalk.method({
|
95
|
+
selector: "parse:forClass:",
|
96
|
+
fn: function (aString,aClass){
|
97
|
+
var self=this;
|
98
|
+
return smalltalk.withContext(function($ctx1) {
|
99
|
+
$1=_st(self)._analyze_forClass_(_st(self)._parse_(aString),aClass);
|
100
|
+
return $1;
|
101
|
+
}, function($ctx1) {$ctx1.fill(self,"parse:forClass:",{aString:aString,aClass:aClass}, smalltalk.AbstractASTInterpreterTest)})}
|
102
|
+
}),
|
103
|
+
smalltalk.AbstractASTInterpreterTest);
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
smalltalk.addClass('ASTInterpreterTest', smalltalk.AbstractASTInterpreterTest, [], 'Compiler-Tests');
|
108
|
+
smalltalk.addMethod(
|
109
|
+
"_interpreter",
|
110
|
+
smalltalk.method({
|
111
|
+
selector: "interpreter",
|
112
|
+
fn: function (){
|
113
|
+
var self=this;
|
114
|
+
return smalltalk.withContext(function($ctx1) {
|
115
|
+
$1=_st((smalltalk.ASTInterpreter || ASTInterpreter))._new();
|
116
|
+
return $1;
|
117
|
+
}, function($ctx1) {$ctx1.fill(self,"interpreter",{}, smalltalk.ASTInterpreterTest)})}
|
118
|
+
}),
|
119
|
+
smalltalk.ASTInterpreterTest);
|
120
|
+
|
121
|
+
smalltalk.addMethod(
|
122
|
+
"_testBinarySend",
|
123
|
+
smalltalk.method({
|
124
|
+
selector: "testBinarySend",
|
125
|
+
fn: function (){
|
126
|
+
var self=this;
|
127
|
+
return smalltalk.withContext(function($ctx1) {
|
128
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testBinarySend",{}, smalltalk.ASTInterpreterTest)})}
|
129
|
+
}),
|
130
|
+
smalltalk.ASTInterpreterTest);
|
131
|
+
|
132
|
+
smalltalk.addMethod(
|
133
|
+
"_testBlockLiteral",
|
134
|
+
smalltalk.method({
|
135
|
+
selector: "testBlockLiteral",
|
136
|
+
fn: function (){
|
137
|
+
var self=this;
|
138
|
+
return smalltalk.withContext(function($ctx1) {
|
139
|
+
_st(self)._assert_equals_(_st(self)._interpret_("foo true ifTrue: [ ^ 1 ] ifFalse: [ 2 ]"),(1));
|
140
|
+
_st(self)._assert_equals_(_st(self)._interpret_("foo ^ false ifTrue: [ 1 ] ifFalse: [ 2 ]"),(2));
|
141
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testBlockLiteral",{}, smalltalk.ASTInterpreterTest)})}
|
142
|
+
}),
|
143
|
+
smalltalk.ASTInterpreterTest);
|
144
|
+
|
145
|
+
smalltalk.addMethod(
|
146
|
+
"_testCascade",
|
147
|
+
smalltalk.method({
|
148
|
+
selector: "testCascade",
|
149
|
+
fn: function (){
|
150
|
+
var self=this;
|
151
|
+
return smalltalk.withContext(function($ctx1) {
|
152
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCascade",{}, smalltalk.ASTInterpreterTest)})}
|
153
|
+
}),
|
154
|
+
smalltalk.ASTInterpreterTest);
|
155
|
+
|
156
|
+
smalltalk.addMethod(
|
157
|
+
"_testDynamicArray",
|
158
|
+
smalltalk.method({
|
159
|
+
selector: "testDynamicArray",
|
160
|
+
fn: function (){
|
161
|
+
var self=this;
|
162
|
+
return smalltalk.withContext(function($ctx1) {
|
163
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicArray",{}, smalltalk.ASTInterpreterTest)})}
|
164
|
+
}),
|
165
|
+
smalltalk.ASTInterpreterTest);
|
166
|
+
|
167
|
+
smalltalk.addMethod(
|
168
|
+
"_testDynamicDictionary",
|
169
|
+
smalltalk.method({
|
170
|
+
selector: "testDynamicDictionary",
|
171
|
+
fn: function (){
|
172
|
+
var self=this;
|
173
|
+
return smalltalk.withContext(function($ctx1) {
|
174
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionary",{}, smalltalk.ASTInterpreterTest)})}
|
175
|
+
}),
|
176
|
+
smalltalk.ASTInterpreterTest);
|
177
|
+
|
178
|
+
smalltalk.addMethod(
|
179
|
+
"_testInlinedJSStatement",
|
180
|
+
smalltalk.method({
|
181
|
+
selector: "testInlinedJSStatement",
|
182
|
+
fn: function (){
|
183
|
+
var self=this;
|
184
|
+
return smalltalk.withContext(function($ctx1) {
|
185
|
+
_st(self)._assert_equals_(_st(self)._interpret_withArguments_("foo: anInteger <return 2 + anInteger>",smalltalk.HashedCollection._fromPairs_([_st("anInteger").__minus_gt((3))])),(5));
|
186
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInlinedJSStatement",{}, smalltalk.ASTInterpreterTest)})}
|
187
|
+
}),
|
188
|
+
smalltalk.ASTInterpreterTest);
|
189
|
+
|
190
|
+
smalltalk.addMethod(
|
191
|
+
"_testInstVarAccess",
|
192
|
+
smalltalk.method({
|
193
|
+
selector: "testInstVarAccess",
|
194
|
+
fn: function (){
|
195
|
+
var self=this;
|
196
|
+
return smalltalk.withContext(function($ctx1) {
|
197
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInstVarAccess",{}, smalltalk.ASTInterpreterTest)})}
|
198
|
+
}),
|
199
|
+
smalltalk.ASTInterpreterTest);
|
200
|
+
|
201
|
+
smalltalk.addMethod(
|
202
|
+
"_testInstVarAssignment",
|
203
|
+
smalltalk.method({
|
204
|
+
selector: "testInstVarAssignment",
|
205
|
+
fn: function (){
|
206
|
+
var self=this;
|
207
|
+
return smalltalk.withContext(function($ctx1) {
|
208
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInstVarAssignment",{}, smalltalk.ASTInterpreterTest)})}
|
209
|
+
}),
|
210
|
+
smalltalk.ASTInterpreterTest);
|
211
|
+
|
212
|
+
smalltalk.addMethod(
|
213
|
+
"_testNonlocalReturn",
|
214
|
+
smalltalk.method({
|
215
|
+
selector: "testNonlocalReturn",
|
216
|
+
fn: function (){
|
217
|
+
var self=this;
|
218
|
+
return smalltalk.withContext(function($ctx1) {
|
219
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNonlocalReturn",{}, smalltalk.ASTInterpreterTest)})}
|
220
|
+
}),
|
221
|
+
smalltalk.ASTInterpreterTest);
|
222
|
+
|
223
|
+
smalltalk.addMethod(
|
224
|
+
"_testReceiver",
|
225
|
+
smalltalk.method({
|
226
|
+
selector: "testReceiver",
|
227
|
+
fn: function (){
|
228
|
+
var self=this;
|
229
|
+
return smalltalk.withContext(function($ctx1) {
|
230
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testReceiver",{}, smalltalk.ASTInterpreterTest)})}
|
231
|
+
}),
|
232
|
+
smalltalk.ASTInterpreterTest);
|
233
|
+
|
234
|
+
smalltalk.addMethod(
|
235
|
+
"_testTempAssignment",
|
236
|
+
smalltalk.method({
|
237
|
+
selector: "testTempAssignment",
|
238
|
+
fn: function (){
|
239
|
+
var self=this;
|
240
|
+
return smalltalk.withContext(function($ctx1) {
|
241
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTempAssignment",{}, smalltalk.ASTInterpreterTest)})}
|
242
|
+
}),
|
243
|
+
smalltalk.ASTInterpreterTest);
|
244
|
+
|
245
|
+
|
246
|
+
|
247
|
+
smalltalk.addClass('ASTSteppingInterpreterTest', smalltalk.AbstractASTInterpreterTest, ['interpreter'], 'Compiler-Tests');
|
248
|
+
smalltalk.addMethod(
|
249
|
+
"_interpreter",
|
250
|
+
smalltalk.method({
|
251
|
+
selector: "interpreter",
|
252
|
+
fn: function (){
|
253
|
+
var self=this;
|
254
|
+
return smalltalk.withContext(function($ctx1) {
|
255
|
+
$2=self["@interpreter"];
|
256
|
+
if(($receiver = $2) == nil || $receiver == undefined){
|
257
|
+
self["@interpreter"]=_st((smalltalk.ASTSteppingInterpreter || ASTSteppingInterpreter))._new();
|
258
|
+
$1=self["@interpreter"];
|
259
|
+
} else {
|
260
|
+
$1=$2;
|
261
|
+
};
|
262
|
+
return $1;
|
263
|
+
}, function($ctx1) {$ctx1.fill(self,"interpreter",{}, smalltalk.ASTSteppingInterpreterTest)})}
|
264
|
+
}),
|
265
|
+
smalltalk.ASTSteppingInterpreterTest);
|
266
|
+
|
267
|
+
smalltalk.addMethod(
|
268
|
+
"_testAtEnd",
|
269
|
+
smalltalk.method({
|
270
|
+
selector: "testAtEnd",
|
271
|
+
fn: function (){
|
272
|
+
var self=this;
|
273
|
+
return smalltalk.withContext(function($ctx1) {
|
274
|
+
_st(self)._deny_(_st(_st(self)._interpreter())._atEnd());
|
275
|
+
_st(_st(self)._interpreter())._step();
|
276
|
+
_st(self)._deny_(_st(_st(self)._interpreter())._atEnd());
|
277
|
+
_st(_st(self)._interpreter())._step();
|
278
|
+
_st(self)._deny_(_st(_st(self)._interpreter())._atEnd());
|
279
|
+
_st(_st(self)._interpreter())._step();
|
280
|
+
_st(self)._deny_(_st(_st(self)._interpreter())._atEnd());
|
281
|
+
_st(_st(self)._interpreter())._step();
|
282
|
+
_st(self)._assert_(_st(_st(self)._interpreter())._atEnd());
|
283
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAtEnd",{}, smalltalk.ASTSteppingInterpreterTest)})}
|
284
|
+
}),
|
285
|
+
smalltalk.ASTSteppingInterpreterTest);
|
286
|
+
|
287
|
+
smalltalk.addMethod(
|
288
|
+
"_testMessageSend",
|
289
|
+
smalltalk.method({
|
290
|
+
selector: "testMessageSend",
|
291
|
+
fn: function (){
|
292
|
+
var self=this;
|
293
|
+
return smalltalk.withContext(function($ctx1) {
|
294
|
+
_st(_st(self)._interpreter())._step();
|
295
|
+
_st(_st(self)._interpreter())._step();
|
296
|
+
_st(_st(self)._interpreter())._step();
|
297
|
+
_st(self)._assert_equals_(_st(_st(_st(self)._interpreter())._currentNode())._value(),(1));
|
298
|
+
_st(_st(self)._interpreter())._step();
|
299
|
+
_st(self)._assert_equals_(_st(_st(_st(self)._interpreter())._currentNode())._value(),(2));
|
300
|
+
_st(_st(self)._interpreter())._step();
|
301
|
+
_st(self)._assert_equals_(_st(_st(self)._interpreter())._result(),(3));
|
302
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testMessageSend",{}, smalltalk.ASTSteppingInterpreterTest)})}
|
303
|
+
}),
|
304
|
+
smalltalk.ASTSteppingInterpreterTest);
|
305
|
+
|
306
|
+
smalltalk.addMethod(
|
307
|
+
"_testSimpleStepping",
|
308
|
+
smalltalk.method({
|
309
|
+
selector: "testSimpleStepping",
|
310
|
+
fn: function (){
|
311
|
+
var self=this;
|
312
|
+
return smalltalk.withContext(function($ctx1) {
|
313
|
+
_st(_st(self)._interpreter())._step();
|
314
|
+
_st(self)._assert_(_st(_st(_st(self)._interpreter())._result())._isNil());
|
315
|
+
_st(_st(self)._interpreter())._step();
|
316
|
+
_st(self)._assert_equals_(_st(_st(self)._interpreter())._result(),(1));
|
317
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSimpleStepping",{}, smalltalk.ASTSteppingInterpreterTest)})}
|
318
|
+
}),
|
319
|
+
smalltalk.ASTSteppingInterpreterTest);
|
320
|
+
|
321
|
+
|
322
|
+
|
2
323
|
smalltalk.addClass('CodeGeneratorTest', smalltalk.TestCase, ['receiver'], 'Compiler-Tests');
|
3
324
|
smalltalk.addMethod(
|
4
325
|
"_codeGeneratorClass",
|
5
326
|
smalltalk.method({
|
6
327
|
selector: "codeGeneratorClass",
|
7
|
-
fn: function ()
|
8
|
-
|
9
|
-
|
10
|
-
|
328
|
+
fn: function (){
|
329
|
+
var self=this;
|
330
|
+
return smalltalk.withContext(function($ctx1) {
|
331
|
+
$1=(smalltalk.CodeGenerator || CodeGenerator);
|
332
|
+
return $1;
|
333
|
+
}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{}, smalltalk.CodeGeneratorTest)})}
|
11
334
|
}),
|
12
335
|
smalltalk.CodeGeneratorTest);
|
13
336
|
|
@@ -15,15 +338,15 @@ smalltalk.addMethod(
|
|
15
338
|
"_compiler",
|
16
339
|
smalltalk.method({
|
17
340
|
selector: "compiler",
|
18
|
-
fn: function ()
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
}
|
341
|
+
fn: function (){
|
342
|
+
var self=this;
|
343
|
+
return smalltalk.withContext(function($ctx1) {
|
344
|
+
$2=_st((smalltalk.Compiler || Compiler))._new();
|
345
|
+
_st($2)._codeGeneratorClass_(_st(self)._codeGeneratorClass());
|
346
|
+
$3=_st($2)._yourself();
|
347
|
+
$1=$3;
|
348
|
+
return $1;
|
349
|
+
}, function($ctx1) {$ctx1.fill(self,"compiler",{}, smalltalk.CodeGeneratorTest)})}
|
27
350
|
}),
|
28
351
|
smalltalk.CodeGeneratorTest);
|
29
352
|
|
@@ -31,11 +354,10 @@ smalltalk.addMethod(
|
|
31
354
|
"_setUp",
|
32
355
|
smalltalk.method({
|
33
356
|
selector: "setUp",
|
34
|
-
fn: function ()
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
}
|
357
|
+
fn: function (){
|
358
|
+
var self=this;
|
359
|
+
return smalltalk.withContext(function($ctx1) {
|
360
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.CodeGeneratorTest)})}
|
39
361
|
}),
|
40
362
|
smalltalk.CodeGeneratorTest);
|
41
363
|
|
@@ -43,16 +365,14 @@ smalltalk.addMethod(
|
|
43
365
|
"_should_return_",
|
44
366
|
smalltalk.method({
|
45
367
|
selector: "should:return:",
|
46
|
-
fn: function (aString,
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
return self;
|
55
|
-
}
|
368
|
+
fn: function (aString,anObject){
|
369
|
+
var self=this;
|
370
|
+
var method,result;
|
371
|
+
return smalltalk.withContext(function($ctx1) {
|
372
|
+
result=_st(self["@receiver"])._perform_(_st(method)._selector());
|
373
|
+
_st(_st(self)._targetClass())._removeCompiledMethod_(method);
|
374
|
+
_st(self)._assert_equals_(anObject,result);
|
375
|
+
return self}, function($ctx1) {$ctx1.fill(self,"should:return:",{aString:aString,anObject:anObject,method:method,result:result}, smalltalk.CodeGeneratorTest)})}
|
56
376
|
}),
|
57
377
|
smalltalk.CodeGeneratorTest);
|
58
378
|
|
@@ -60,10 +380,12 @@ smalltalk.addMethod(
|
|
60
380
|
"_targetClass",
|
61
381
|
smalltalk.method({
|
62
382
|
selector: "targetClass",
|
63
|
-
fn: function ()
|
64
|
-
|
65
|
-
|
66
|
-
|
383
|
+
fn: function (){
|
384
|
+
var self=this;
|
385
|
+
return smalltalk.withContext(function($ctx1) {
|
386
|
+
$1=(smalltalk.DoIt || DoIt);
|
387
|
+
return $1;
|
388
|
+
}, function($ctx1) {$ctx1.fill(self,"targetClass",{}, smalltalk.CodeGeneratorTest)})}
|
67
389
|
}),
|
68
390
|
smalltalk.CodeGeneratorTest);
|
69
391
|
|
@@ -71,10 +393,9 @@ smalltalk.addMethod(
|
|
71
393
|
"_tearDown",
|
72
394
|
smalltalk.method({
|
73
395
|
selector: "tearDown",
|
74
|
-
fn: function ()
|
75
|
-
|
76
|
-
|
77
|
-
}
|
396
|
+
fn: function (){
|
397
|
+
var self=this;
|
398
|
+
return smalltalk.withContext(function($ctx1) {
|
78
399
|
}),
|
79
400
|
smalltalk.CodeGeneratorTest);
|
80
401
|
|
@@ -82,13 +403,12 @@ smalltalk.addMethod(
|
|
82
403
|
"_testAssignment",
|
83
404
|
smalltalk.method({
|
84
405
|
selector: "testAssignment",
|
85
|
-
fn: function ()
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
}
|
406
|
+
fn: function (){
|
407
|
+
var self=this;
|
408
|
+
return smalltalk.withContext(function($ctx1) {
|
409
|
+
_st(self)._should_return_("foo | a | a := false ifTrue: [ 1 ]. ^ a",nil);
|
410
|
+
_st(self)._should_return_("foo | a | ^ a := true ifTrue: [ 1 ]",(1));
|
411
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAssignment",{}, smalltalk.CodeGeneratorTest)})}
|
92
412
|
}),
|
93
413
|
smalltalk.CodeGeneratorTest);
|
94
414
|
|
@@ -96,13 +416,12 @@ smalltalk.addMethod(
|
|
96
416
|
"_testBlockReturn",
|
97
417
|
smalltalk.method({
|
98
418
|
selector: "testBlockReturn",
|
99
|
-
fn: function ()
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
}
|
419
|
+
fn: function (){
|
420
|
+
var self=this;
|
421
|
+
return smalltalk.withContext(function($ctx1) {
|
422
|
+
_st(self)._should_return_("foo ^ #(1 2 3) collect: [ :each | false ifFalse: [ each + 1 ] ]",[(2), (3), (4)]);
|
423
|
+
_st(self)._should_return_("foo ^ #(1 2 3) collect: [ :each | each odd ifTrue: [ each + 1 ] ifFalse: [ each - 1 ] ]",[(2), (1), (4)]);
|
424
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testBlockReturn",{}, smalltalk.CodeGeneratorTest)})}
|
106
425
|
}),
|
107
426
|
smalltalk.CodeGeneratorTest);
|
108
427
|
|
@@ -110,11 +429,46 @@ smalltalk.addMethod(
|
|
110
429
|
"_testCascades",
|
111
430
|
smalltalk.method({
|
112
431
|
selector: "testCascades",
|
113
|
-
fn: function ()
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
}
|
432
|
+
fn: function (){
|
433
|
+
var self=this;
|
434
|
+
return smalltalk.withContext(function($ctx1) {
|
435
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testCascades",{}, smalltalk.CodeGeneratorTest)})}
|
436
|
+
}),
|
437
|
+
smalltalk.CodeGeneratorTest);
|
438
|
+
|
439
|
+
smalltalk.addMethod(
|
440
|
+
"_testDynamicArrayElementsOrdered",
|
441
|
+
smalltalk.method({
|
442
|
+
selector: "testDynamicArrayElementsOrdered",
|
443
|
+
fn: function (){
|
444
|
+
var self=this;
|
445
|
+
return smalltalk.withContext(function($ctx1) {
|
446
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicArrayElementsOrdered",{}, smalltalk.CodeGeneratorTest)})}
|
447
|
+
}),
|
448
|
+
smalltalk.CodeGeneratorTest);
|
449
|
+
|
450
|
+
smalltalk.addMethod(
|
451
|
+
"_testDynamicDictionaryElementsOrdered",
|
452
|
+
smalltalk.method({
|
453
|
+
selector: "testDynamicDictionaryElementsOrdered",
|
454
|
+
fn: function (){
|
455
|
+
var self=this;
|
456
|
+
return smalltalk.withContext(function($ctx1) {
|
457
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testDynamicDictionaryElementsOrdered",{}, smalltalk.CodeGeneratorTest)})}
|
458
|
+
}),
|
459
|
+
smalltalk.CodeGeneratorTest);
|
460
|
+
|
461
|
+
smalltalk.addMethod(
|
462
|
+
"_testInnerTemporalDependentElementsOrdered",
|
463
|
+
smalltalk.method({
|
464
|
+
selector: "testInnerTemporalDependentElementsOrdered",
|
465
|
+
fn: function (){
|
466
|
+
var self=this;
|
467
|
+
return smalltalk.withContext(function($ctx1) {
|
468
|
+
_st(self)._should_return_("foo\x0a | x |\x0a x := 1.\x0a ^ Array with: 'foo'->x with: 'bar'->(true ifTrue: [ x := 2 ])\x0a",[_st("foo").__minus_gt((1)),_st("bar").__minus_gt((2))]);
|
469
|
+
_st(self)._should_return_("foo\x0a | x |\x0a x := 1.\x0a ^ { 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",[_st("foo").__minus_gt((1)),_st("bar").__minus_gt((2))]);
|
470
|
+
_st(self)._should_return_("foo\x0a | x |\x0a x := 1.\x0a ^ #{ 'foo'->x. 'bar'->(true ifTrue: [ x := 2 ]) }\x0a",smalltalk.HashedCollection._fromPairs_([_st("foo").__minus_gt((1)),_st("bar").__minus_gt((2))]));
|
471
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInnerTemporalDependentElementsOrdered",{}, smalltalk.CodeGeneratorTest)})}
|
118
472
|
}),
|
119
473
|
smalltalk.CodeGeneratorTest);
|
120
474
|
|
@@ -122,19 +476,18 @@ smalltalk.addMethod(
|
|
122
476
|
"_testLiterals",
|
123
477
|
smalltalk.method({
|
124
478
|
selector: "testLiterals",
|
125
|
-
fn: function ()
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
}
|
479
|
+
fn: function (){
|
480
|
+
var self=this;
|
481
|
+
return smalltalk.withContext(function($ctx1) {
|
482
|
+
_st(self)._should_return_("foo ^ 'hello'","hello");
|
483
|
+
_st(self)._should_return_("foo ^ #(1 2 3 4)",[(1), (2), (3), (4)]);
|
484
|
+
_st(self)._should_return_("foo ^ {1. [:x | x ] value: 2. 3. [4] value}",[(1), (2), (3), (4)]);
|
485
|
+
_st(self)._should_return_("foo ^ true",true);
|
486
|
+
_st(self)._should_return_("foo ^ false",false);
|
487
|
+
_st(self)._should_return_("foo ^ #{1->2. 3->4}",smalltalk.HashedCollection._fromPairs_([_st((1)).__minus_gt((2)),_st((3)).__minus_gt((4))]));
|
488
|
+
_st(self)._should_return_("foo ^ #hello",smalltalk.symbolFor("hello"));
|
489
|
+
_st(self)._should_return_("foo ^ -123.456",(-123.456));
|
490
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testLiterals",{}, smalltalk.CodeGeneratorTest)})}
|
138
491
|
}),
|
139
492
|
smalltalk.CodeGeneratorTest);
|
140
493
|
|
@@ -142,15 +495,14 @@ smalltalk.addMethod(
|
|
142
495
|
"_testLocalReturn",
|
143
496
|
smalltalk.method({
|
144
497
|
selector: "testLocalReturn",
|
145
|
-
fn: function ()
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
}
|
498
|
+
fn: function (){
|
499
|
+
var self=this;
|
500
|
+
return smalltalk.withContext(function($ctx1) {
|
501
|
+
_st(self)._should_return_("foo ^ 1 + 1",(2));
|
502
|
+
_st(self)._should_return_("foo ",self["@receiver"]);
|
503
|
+
_st(self)._should_return_("foo self asString",self["@receiver"]);
|
504
|
+
_st(self)._should_return_("foo | a b | a := 1. b := 2. ^ a + b",(3));
|
505
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testLocalReturn",{}, smalltalk.CodeGeneratorTest)})}
|
154
506
|
}),
|
155
507
|
smalltalk.CodeGeneratorTest);
|
156
508
|
|
@@ -158,15 +510,14 @@ smalltalk.addMethod(
|
|
158
510
|
"_testMessageSends",
|
159
511
|
smalltalk.method({
|
160
512
|
selector: "testMessageSends",
|
161
|
-
fn: function ()
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
}
|
513
|
+
fn: function (){
|
514
|
+
var self=this;
|
515
|
+
return smalltalk.withContext(function($ctx1) {
|
516
|
+
_st(self)._should_return_("foo ^ 1 + 1",(2));
|
517
|
+
_st(self)._should_return_("foo ^ 1 + 2 * 3",(9));
|
518
|
+
_st(self)._should_return_("foo ^ 1 to: 3",[(1), (2), (3)]);
|
519
|
+
_st(self)._should_return_("foo ^ 1 to: 5 by: 2",[(1), (3), (5)]);
|
520
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testMessageSends",{}, smalltalk.CodeGeneratorTest)})}
|
170
521
|
}),
|
171
522
|
smalltalk.CodeGeneratorTest);
|
172
523
|
|
@@ -174,14 +525,13 @@ smalltalk.addMethod(
|
|
174
525
|
"_testNestedIfTrue",
|
175
526
|
smalltalk.method({
|
176
527
|
selector: "testNestedIfTrue",
|
177
|
-
fn: function ()
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
}
|
528
|
+
fn: function (){
|
529
|
+
var self=this;
|
530
|
+
return smalltalk.withContext(function($ctx1) {
|
531
|
+
_st(self)._should_return_("foo ^ true ifTrue: [ false ifTrue: [ 1 ] ]",nil);
|
532
|
+
_st(self)._should_return_("foo true ifTrue: [ false ifFalse: [ ^ 1 ] ]",(1));
|
533
|
+
_st(self)._should_return_("foo true ifTrue: [ false ifTrue: [ ^ 1 ] ]",self["@receiver"]);
|
534
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNestedIfTrue",{}, smalltalk.CodeGeneratorTest)})}
|
185
535
|
}),
|
186
536
|
smalltalk.CodeGeneratorTest);
|
187
537
|
|
@@ -189,14 +539,25 @@ smalltalk.addMethod(
|
|
189
539
|
"_testNonLocalReturn",
|
190
540
|
smalltalk.method({
|
191
541
|
selector: "testNonLocalReturn",
|
192
|
-
fn: function ()
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
}
|
542
|
+
fn: function (){
|
543
|
+
var self=this;
|
544
|
+
return smalltalk.withContext(function($ctx1) {
|
545
|
+
_st(self)._should_return_("foo [ ^ 1 + 1 ] value",(2));
|
546
|
+
_st(self)._should_return_("foo | a b | a := 1. b := 2. [ ^ a + b ] value. self halt",(3));
|
547
|
+
_st(self)._should_return_("foo [ :x | ^ x + x ] value: 4. ^ 2",(8));
|
548
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn",{}, smalltalk.CodeGeneratorTest)})}
|
549
|
+
}),
|
550
|
+
smalltalk.CodeGeneratorTest);
|
551
|
+
|
552
|
+
smalltalk.addMethod(
|
553
|
+
"_testSendReceiverAndArgumentsOrdered",
|
554
|
+
smalltalk.method({
|
555
|
+
selector: "testSendReceiverAndArgumentsOrdered",
|
556
|
+
fn: function (){
|
557
|
+
var self=this;
|
558
|
+
return smalltalk.withContext(function($ctx1) {
|
559
|
+
_st(self)._should_return_("foo\x0a | x |\x0a x := Array.\x0a ^ x with: x with: (true ifTrue: [ x := 2 ])\x0a",[(smalltalk.Array || Array),(2)]);
|
560
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testSendReceiverAndArgumentsOrdered",{}, smalltalk.CodeGeneratorTest)})}
|
200
561
|
}),
|
201
562
|
smalltalk.CodeGeneratorTest);
|
202
563
|
|
@@ -204,14 +565,13 @@ smalltalk.addMethod(
|
|
204
565
|
"_testifFalse",
|
205
566
|
smalltalk.method({
|
206
567
|
selector: "testifFalse",
|
207
|
-
fn: function ()
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
}
|
568
|
+
fn: function (){
|
569
|
+
var self=this;
|
570
|
+
return smalltalk.withContext(function($ctx1) {
|
571
|
+
_st(self)._should_return_("foo false ifFalse: [ ^ 2 ]",(2));
|
572
|
+
_st(self)._should_return_("foo ^ true ifFalse: [ 1 ]",nil);
|
573
|
+
_st(self)._should_return_("foo ^ false ifFalse: [ 2 ]",(2));
|
574
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifFalse",{}, smalltalk.CodeGeneratorTest)})}
|
215
575
|
}),
|
216
576
|
smalltalk.CodeGeneratorTest);
|
217
577
|
|
@@ -219,14 +579,13 @@ smalltalk.addMethod(
|
|
219
579
|
"_testifFalseIfTrue",
|
220
580
|
smalltalk.method({
|
221
581
|
selector: "testifFalseIfTrue",
|
222
|
-
fn: function ()
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
}
|
582
|
+
fn: function (){
|
583
|
+
var self=this;
|
584
|
+
return smalltalk.withContext(function($ctx1) {
|
585
|
+
_st(self)._should_return_("foo false ifFalse: [ ^ 2 ] ifTrue: [ ^1 ]",(2));
|
586
|
+
_st(self)._should_return_("foo ^ true ifFalse: [ 1 ] ifTrue: [ 2 ]",(2));
|
587
|
+
_st(self)._should_return_("foo ^ false ifFalse: [ 2 ] ifTrue: [ 1 ]",(2));
|
588
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifFalseIfTrue",{}, smalltalk.CodeGeneratorTest)})}
|
230
589
|
}),
|
231
590
|
smalltalk.CodeGeneratorTest);
|
232
591
|
|
@@ -234,14 +593,13 @@ smalltalk.addMethod(
|
|
234
593
|
"_testifNil",
|
235
594
|
smalltalk.method({
|
236
595
|
selector: "testifNil",
|
237
|
-
fn: function ()
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
}
|
596
|
+
fn: function (){
|
597
|
+
var self=this;
|
598
|
+
return smalltalk.withContext(function($ctx1) {
|
599
|
+
_st(self)._should_return_("foo ^ nil ifNil: [ 2 ]",(2));
|
600
|
+
_st(self)._should_return_("foo 1 ifNil: [ ^ 2 ]",self["@receiver"]);
|
601
|
+
_st(self)._should_return_("foo nil ifNil: [ ^ 2 ]",(2));
|
602
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifNil",{}, smalltalk.CodeGeneratorTest)})}
|
245
603
|
}),
|
246
604
|
smalltalk.CodeGeneratorTest);
|
247
605
|
|
@@ -249,14 +607,13 @@ smalltalk.addMethod(
|
|
249
607
|
"_testifNilIfNotNil",
|
250
608
|
smalltalk.method({
|
251
609
|
selector: "testifNilIfNotNil",
|
252
|
-
fn: function ()
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
}
|
610
|
+
fn: function (){
|
611
|
+
var self=this;
|
612
|
+
return smalltalk.withContext(function($ctx1) {
|
613
|
+
_st(self)._should_return_("foo ^ nil ifNil: [ 2 ] ifNotNil: [ 3 ]",(2));
|
614
|
+
_st(self)._should_return_("foo 1 ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(3));
|
615
|
+
_st(self)._should_return_("foo nil ifNil: [ ^ 2 ] ifNotNil: [ ^3 ]",(2));
|
616
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifNilIfNotNil",{}, smalltalk.CodeGeneratorTest)})}
|
260
617
|
}),
|
261
618
|
smalltalk.CodeGeneratorTest);
|
262
619
|
|
@@ -264,14 +621,13 @@ smalltalk.addMethod(
|
|
264
621
|
"_testifNotNil",
|
265
622
|
smalltalk.method({
|
266
623
|
selector: "testifNotNil",
|
267
|
-
fn: function ()
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
}
|
624
|
+
fn: function (){
|
625
|
+
var self=this;
|
626
|
+
return smalltalk.withContext(function($ctx1) {
|
627
|
+
_st(self)._should_return_("foo ^ nil ifNotNil: [ 2 ]",nil);
|
628
|
+
_st(self)._should_return_("foo 1 ifNotNil: [ ^ 2 ]",(2));
|
629
|
+
_st(self)._should_return_("foo nil ifNotNil: [ ^ 2 ]",self["@receiver"]);
|
630
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifNotNil",{}, smalltalk.CodeGeneratorTest)})}
|
275
631
|
}),
|
276
632
|
smalltalk.CodeGeneratorTest);
|
277
633
|
|
@@ -279,14 +635,13 @@ smalltalk.addMethod(
|
|
279
635
|
"_testifTrue",
|
280
636
|
smalltalk.method({
|
281
637
|
selector: "testifTrue",
|
282
|
-
fn: function ()
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
}
|
638
|
+
fn: function (){
|
639
|
+
var self=this;
|
640
|
+
return smalltalk.withContext(function($ctx1) {
|
641
|
+
_st(self)._should_return_("foo true ifTrue: [ ^ 2 ]",(2));
|
642
|
+
_st(self)._should_return_("foo ^ false ifTrue: [ 1 ]",nil);
|
643
|
+
_st(self)._should_return_("foo ^ true ifTrue: [ 2 ]",(2));
|
644
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifTrue",{}, smalltalk.CodeGeneratorTest)})}
|
290
645
|
}),
|
291
646
|
smalltalk.CodeGeneratorTest);
|
292
647
|
|
@@ -294,14 +649,13 @@ smalltalk.addMethod(
|
|
294
649
|
"_testifTrueIfFalse",
|
295
650
|
smalltalk.method({
|
296
651
|
selector: "testifTrueIfFalse",
|
297
|
-
fn: function ()
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
}
|
652
|
+
fn: function (){
|
653
|
+
var self=this;
|
654
|
+
return smalltalk.withContext(function($ctx1) {
|
655
|
+
_st(self)._should_return_("foo true ifTrue: [ ^ 1 ] ifFalse: [ ^ 2 ]",(1));
|
656
|
+
_st(self)._should_return_("foo ^ false ifTrue: [ 2 ] ifFalse: [ 1 ]",(1));
|
657
|
+
_st(self)._should_return_("foo ^ true ifTrue: [ 2 ] ifFalse: [ 1 ]",(2));
|
658
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testifTrueIfFalse",{}, smalltalk.CodeGeneratorTest)})}
|
305
659
|
}),
|
306
660
|
smalltalk.CodeGeneratorTest);
|
307
661
|
|
@@ -312,10 +666,12 @@ smalltalk.addMethod(
|
|
312
666
|
"_codeGeneratorClass",
|
313
667
|
smalltalk.method({
|
314
668
|
selector: "codeGeneratorClass",
|
315
|
-
fn: function ()
|
316
|
-
|
317
|
-
|
318
|
-
|
669
|
+
fn: function (){
|
670
|
+
var self=this;
|
671
|
+
return smalltalk.withContext(function($ctx1) {
|
672
|
+
$1=(smalltalk.InliningCodeGenerator || InliningCodeGenerator);
|
673
|
+
return $1;
|
674
|
+
}, function($ctx1) {$ctx1.fill(self,"codeGeneratorClass",{}, smalltalk.InliningCodeGeneratorTest)})}
|
319
675
|
}),
|
320
676
|
smalltalk.InliningCodeGeneratorTest);
|
321
677
|
|
@@ -326,18 +682,17 @@ smalltalk.addMethod(
|
|
326
682
|
"_testClassRefVar",
|
327
683
|
smalltalk.method({
|
328
684
|
selector: "testClassRefVar",
|
329
|
-
fn: function ()
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
}
|
685
|
+
fn: function (){
|
686
|
+
var self=this;
|
687
|
+
var node;
|
688
|
+
return smalltalk.withContext(function($ctx1) {
|
689
|
+
$1=_st((smalltalk.ClassReferenceNode || ClassReferenceNode))._new();
|
690
|
+
_st($1)._value_("Object");
|
691
|
+
$2=_st($1)._yourself();
|
692
|
+
node=$2;
|
693
|
+
_st(_st((smalltalk.SemanticAnalyzer || SemanticAnalyzer))._new())._visit_(node);
|
694
|
+
_st(self)._assert_(_st(_st(node)._binding())._isClassRefVar());
|
695
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testClassRefVar",{node:node}, smalltalk.ScopeVarTest)})}
|
341
696
|
}),
|
342
697
|
smalltalk.ScopeVarTest);
|
343
698
|
|
@@ -345,20 +700,18 @@ smalltalk.addMethod(
|
|
345
700
|
"_testInstanceVar",
|
346
701
|
smalltalk.method({
|
347
702
|
selector: "testInstanceVar",
|
348
|
-
fn: function ()
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
return self;
|
361
|
-
}
|
703
|
+
fn: function (){
|
704
|
+
var self=this;
|
705
|
+
var node,scope;
|
706
|
+
return smalltalk.withContext(function($ctx1) {
|
707
|
+
$1=_st((smalltalk.VariableNode || VariableNode))._new();
|
708
|
+
_st($1)._value_("bzzz");
|
709
|
+
$2=_st($1)._yourself();
|
710
|
+
node=$2;
|
711
|
+
scope=_st((smalltalk.MethodLexicalScope || MethodLexicalScope))._new();
|
712
|
+
_st(scope)._addIVar_("bzzz");
|
713
|
+
_st(self)._assert_(_st(_st(scope)._bindingFor_(node))._isInstanceVar());
|
714
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testInstanceVar",{node:node,scope:scope}, smalltalk.ScopeVarTest)})}
|
362
715
|
}),
|
363
716
|
smalltalk.ScopeVarTest);
|
364
717
|
|
@@ -366,15 +719,20 @@ smalltalk.addMethod(
|
|
366
719
|
"_testPseudoVar",
|
367
720
|
smalltalk.method({
|
368
721
|
selector: "testPseudoVar",
|
369
|
-
fn: function ()
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
722
|
+
fn: function (){
|
723
|
+
var self=this;
|
724
|
+
var node,pseudoVars;
|
725
|
+
return smalltalk.withContext(function($ctx1) {
|
726
|
+
pseudoVars=["self", "super", "true", "false", "nil"];
|
727
|
+
_st(pseudoVars)._do_((function(each){
|
728
|
+
return smalltalk.withContext(function($ctx2) {
|
729
|
+
_st($1)._value_(each);
|
730
|
+
$2=_st($1)._yourself();
|
731
|
+
node=$2;
|
732
|
+
node;
|
733
|
+
return _st(self)._assert_(_st(_st(_st((smalltalk.MethodLexicalScope || MethodLexicalScope))._new())._bindingFor_(node))._isPseudoVar());
|
734
|
+
}, function($ctx2) {$ctx2.fillBlock({each:each},$ctx1)})}));
|
735
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testPseudoVar",{node:node,pseudoVars:pseudoVars}, smalltalk.ScopeVarTest)})}
|
378
736
|
}),
|
379
737
|
smalltalk.ScopeVarTest);
|
380
738
|
|
@@ -382,20 +740,18 @@ smalltalk.addMethod(
|
|
382
740
|
"_testTempVar",
|
383
741
|
smalltalk.method({
|
384
742
|
selector: "testTempVar",
|
385
|
-
fn: function ()
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
return self;
|
398
|
-
}
|
743
|
+
fn: function (){
|
744
|
+
var self=this;
|
745
|
+
var node,scope;
|
746
|
+
return smalltalk.withContext(function($ctx1) {
|
747
|
+
$1=_st((smalltalk.VariableNode || VariableNode))._new();
|
748
|
+
_st($1)._value_("bzzz");
|
749
|
+
$2=_st($1)._yourself();
|
750
|
+
node=$2;
|
751
|
+
scope=_st((smalltalk.MethodLexicalScope || MethodLexicalScope))._new();
|
752
|
+
_st(scope)._addTemp_("bzzz");
|
753
|
+
_st(self)._assert_(_st(_st(scope)._bindingFor_(node))._isTempVar());
|
754
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testTempVar",{node:node,scope:scope}, smalltalk.ScopeVarTest)})}
|
399
755
|
}),
|
400
756
|
smalltalk.ScopeVarTest);
|
401
757
|
|
@@ -403,17 +759,16 @@ smalltalk.addMethod(
|
|
403
759
|
"_testUnknownVar",
|
404
760
|
smalltalk.method({
|
405
761
|
selector: "testUnknownVar",
|
406
|
-
fn: function ()
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
}
|
762
|
+
fn: function (){
|
763
|
+
var self=this;
|
764
|
+
var node;
|
765
|
+
return smalltalk.withContext(function($ctx1) {
|
766
|
+
$1=_st((smalltalk.VariableNode || VariableNode))._new();
|
767
|
+
_st($1)._value_("bzzz");
|
768
|
+
$2=_st($1)._yourself();
|
769
|
+
node=$2;
|
770
|
+
_st(self)._assert_(_st(_st(_st((smalltalk.MethodLexicalScope || MethodLexicalScope))._new())._bindingFor_(node))._isNil());
|
771
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVar",{node:node}, smalltalk.ScopeVarTest)})}
|
417
772
|
}),
|
418
773
|
smalltalk.ScopeVarTest);
|
419
774
|
|
@@ -424,11 +779,10 @@ smalltalk.addMethod(
|
|
424
779
|
"_setUp",
|
425
780
|
smalltalk.method({
|
426
781
|
selector: "setUp",
|
427
|
-
fn: function ()
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
}
|
782
|
+
fn: function (){
|
783
|
+
var self=this;
|
784
|
+
return smalltalk.withContext(function($ctx1) {
|
785
|
+
return self}, function($ctx1) {$ctx1.fill(self,"setUp",{}, smalltalk.SemanticAnalyzerTest)})}
|
432
786
|
}),
|
433
787
|
smalltalk.SemanticAnalyzerTest);
|
434
788
|
|
@@ -436,15 +790,15 @@ smalltalk.addMethod(
|
|
436
790
|
"_testAssignment",
|
437
791
|
smalltalk.method({
|
438
792
|
selector: "testAssignment",
|
439
|
-
fn: function ()
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
}
|
793
|
+
fn: function (){
|
794
|
+
var self=this;
|
795
|
+
var src,ast;
|
796
|
+
return smalltalk.withContext(function($ctx1) {
|
797
|
+
ast=_st(smalltalk)._parse_(src);
|
798
|
+
_st(self)._should_raise_((function(){
|
799
|
+
return smalltalk.withContext(function($ctx2) {
|
800
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.InvalidAssignmentError || InvalidAssignmentError));
|
801
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testAssignment",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
448
802
|
}),
|
449
803
|
smalltalk.SemanticAnalyzerTest);
|
450
804
|
|
@@ -452,16 +806,14 @@ smalltalk.addMethod(
|
|
452
806
|
"_testNonLocalReturn",
|
453
807
|
smalltalk.method({
|
454
808
|
selector: "testNonLocalReturn",
|
455
|
-
fn: function ()
|
456
|
-
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
return self;
|
464
|
-
}
|
809
|
+
fn: function (){
|
810
|
+
var self=this;
|
811
|
+
var src,ast;
|
812
|
+
return smalltalk.withContext(function($ctx1) {
|
813
|
+
ast=_st(smalltalk)._parse_(src);
|
814
|
+
_st(self["@analyzer"])._visit_(ast);
|
815
|
+
_st(self)._deny_(_st(_st(ast)._scope())._hasNonLocalReturn());
|
816
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
465
817
|
}),
|
466
818
|
smalltalk.SemanticAnalyzerTest);
|
467
819
|
|
@@ -469,16 +821,14 @@ smalltalk.addMethod(
|
|
469
821
|
"_testNonLocalReturn2",
|
470
822
|
smalltalk.method({
|
471
823
|
selector: "testNonLocalReturn2",
|
472
|
-
fn: function ()
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
return self;
|
481
|
-
}
|
824
|
+
fn: function (){
|
825
|
+
var self=this;
|
826
|
+
var src,ast;
|
827
|
+
return smalltalk.withContext(function($ctx1) {
|
828
|
+
ast=_st(smalltalk)._parse_(src);
|
829
|
+
_st(self["@analyzer"])._visit_(ast);
|
830
|
+
_st(self)._assert_(_st(_st(ast)._scope())._hasNonLocalReturn());
|
831
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testNonLocalReturn2",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
482
832
|
}),
|
483
833
|
smalltalk.SemanticAnalyzerTest);
|
484
834
|
|
@@ -486,16 +836,14 @@ smalltalk.addMethod(
|
|
486
836
|
"_testScope",
|
487
837
|
smalltalk.method({
|
488
838
|
selector: "testScope",
|
489
|
-
fn: function ()
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
return self;
|
498
|
-
}
|
839
|
+
fn: function (){
|
840
|
+
var self=this;
|
841
|
+
var src,ast;
|
842
|
+
return smalltalk.withContext(function($ctx1) {
|
843
|
+
ast=_st(smalltalk)._parse_(src);
|
844
|
+
_st(self["@analyzer"])._visit_(ast);
|
845
|
+
_st(self)._deny_(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._scope()).__eq_eq(_st(ast)._scope()));
|
846
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testScope",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
499
847
|
}),
|
500
848
|
smalltalk.SemanticAnalyzerTest);
|
501
849
|
|
@@ -503,16 +851,14 @@ smalltalk.addMethod(
|
|
503
851
|
"_testScope2",
|
504
852
|
smalltalk.method({
|
505
853
|
selector: "testScope2",
|
506
|
-
fn: function ()
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
return self;
|
515
|
-
}
|
854
|
+
fn: function (){
|
855
|
+
var self=this;
|
856
|
+
var src,ast;
|
857
|
+
return smalltalk.withContext(function($ctx1) {
|
858
|
+
ast=_st(smalltalk)._parse_(src);
|
859
|
+
_st(self["@analyzer"])._visit_(ast);
|
860
|
+
_st(self)._deny_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope()).__eq_eq(_st(ast)._scope()));
|
861
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testScope2",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
516
862
|
}),
|
517
863
|
smalltalk.SemanticAnalyzerTest);
|
518
864
|
|
@@ -520,17 +866,15 @@ smalltalk.addMethod(
|
|
520
866
|
"_testScopeLevel",
|
521
867
|
smalltalk.method({
|
522
868
|
selector: "testScopeLevel",
|
523
|
-
fn: function ()
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
return self;
|
533
|
-
}
|
869
|
+
fn: function (){
|
870
|
+
var self=this;
|
871
|
+
var src,ast;
|
872
|
+
return smalltalk.withContext(function($ctx1) {
|
873
|
+
ast=_st(smalltalk)._parse_(src);
|
874
|
+
_st(self["@analyzer"])._visit_(ast);
|
875
|
+
_st(self)._assert_(_st(_st(_st(ast)._scope())._scopeLevel()).__eq((1)));
|
876
|
+
_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._scope())._scopeLevel()).__eq((3)));
|
877
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testScopeLevel",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
534
878
|
}),
|
535
879
|
smalltalk.SemanticAnalyzerTest);
|
536
880
|
|
@@ -538,28 +882,15 @@ smalltalk.addMethod(
|
|
538
882
|
"_testUnknownVariables",
|
539
883
|
smalltalk.method({
|
540
884
|
selector: "testUnknownVariables",
|
541
|
-
fn: function ()
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
}
|
550
|
-
}),
|
551
|
-
smalltalk.SemanticAnalyzerTest);
|
552
|
-
|
553
|
-
smalltalk.addMethod(
|
554
|
-
"_testUnknownVariablesDefinedInJS",
|
555
|
-
smalltalk.method({
|
556
|
-
selector: "testUnknownVariablesDefinedInJS",
|
557
|
-
fn: function () {
|
558
|
-
var self = this;
|
559
|
-
var someVariable = 1;
|
560
|
-
smalltalk.send(self, "_shouldnt_raise_", [function () {return smalltalk.send(smalltalk, "_parse_", ["foo someVariable"]);}, smalltalk.UnknownVariableError || UnknownVariableError]);
|
561
|
-
return self;
|
562
|
-
}
|
885
|
+
fn: function (){
|
886
|
+
var self=this;
|
887
|
+
var src,ast;
|
888
|
+
return smalltalk.withContext(function($ctx1) {
|
889
|
+
ast=_st(smalltalk)._parse_(src);
|
890
|
+
_st(self)._should_raise_((function(){
|
891
|
+
return smalltalk.withContext(function($ctx2) {
|
892
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.UnknownVariableError || UnknownVariableError));
|
893
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVariables",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
563
894
|
}),
|
564
895
|
smalltalk.SemanticAnalyzerTest);
|
565
896
|
|
@@ -567,15 +898,15 @@ smalltalk.addMethod(
|
|
567
898
|
"_testUnknownVariablesWithScope",
|
568
899
|
smalltalk.method({
|
569
900
|
selector: "testUnknownVariablesWithScope",
|
570
|
-
fn: function ()
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
}
|
901
|
+
fn: function (){
|
902
|
+
var self=this;
|
903
|
+
var src,ast;
|
904
|
+
return smalltalk.withContext(function($ctx1) {
|
905
|
+
ast=_st(smalltalk)._parse_(src);
|
906
|
+
_st(self)._should_raise_((function(){
|
907
|
+
return smalltalk.withContext(function($ctx2) {
|
908
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.UnknownVariableError || UnknownVariableError));
|
909
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testUnknownVariablesWithScope",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
579
910
|
}),
|
580
911
|
smalltalk.SemanticAnalyzerTest);
|
581
912
|
|
@@ -583,15 +914,13 @@ smalltalk.addMethod(
|
|
583
914
|
"_testVariableShadowing",
|
584
915
|
smalltalk.method({
|
585
916
|
selector: "testVariableShadowing",
|
586
|
-
fn: function ()
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
return self;
|
594
|
-
}
|
917
|
+
fn: function (){
|
918
|
+
var self=this;
|
919
|
+
var src,ast;
|
920
|
+
return smalltalk.withContext(function($ctx1) {
|
921
|
+
ast=_st(smalltalk)._parse_(src);
|
922
|
+
_st(self["@analyzer"])._visit_(ast);
|
923
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
595
924
|
}),
|
596
925
|
smalltalk.SemanticAnalyzerTest);
|
597
926
|
|
@@ -599,15 +928,15 @@ smalltalk.addMethod(
|
|
599
928
|
"_testVariableShadowing2",
|
600
929
|
smalltalk.method({
|
601
930
|
selector: "testVariableShadowing2",
|
602
|
-
fn: function ()
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
}
|
931
|
+
fn: function (){
|
932
|
+
var self=this;
|
933
|
+
var src,ast;
|
934
|
+
return smalltalk.withContext(function($ctx1) {
|
935
|
+
ast=_st(smalltalk)._parse_(src);
|
936
|
+
_st(self)._should_raise_((function(){
|
937
|
+
return smalltalk.withContext(function($ctx2) {
|
938
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.ShadowingVariableError || ShadowingVariableError));
|
939
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing2",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
611
940
|
}),
|
612
941
|
smalltalk.SemanticAnalyzerTest);
|
613
942
|
|
@@ -615,15 +944,13 @@ smalltalk.addMethod(
|
|
615
944
|
"_testVariableShadowing3",
|
616
945
|
smalltalk.method({
|
617
946
|
selector: "testVariableShadowing3",
|
618
|
-
fn: function ()
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
return self;
|
626
|
-
}
|
947
|
+
fn: function (){
|
948
|
+
var self=this;
|
949
|
+
var src,ast;
|
950
|
+
return smalltalk.withContext(function($ctx1) {
|
951
|
+
ast=_st(smalltalk)._parse_(src);
|
952
|
+
_st(self["@analyzer"])._visit_(ast);
|
953
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing3",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
627
954
|
}),
|
628
955
|
smalltalk.SemanticAnalyzerTest);
|
629
956
|
|
@@ -631,15 +958,13 @@ smalltalk.addMethod(
|
|
631
958
|
"_testVariableShadowing4",
|
632
959
|
smalltalk.method({
|
633
960
|
selector: "testVariableShadowing4",
|
634
|
-
fn: function ()
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
return self;
|
642
|
-
}
|
961
|
+
fn: function (){
|
962
|
+
var self=this;
|
963
|
+
var src,ast;
|
964
|
+
return smalltalk.withContext(function($ctx1) {
|
965
|
+
ast=_st(smalltalk)._parse_(src);
|
966
|
+
_st(self["@analyzer"])._visit_(ast);
|
967
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing4",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
643
968
|
}),
|
644
969
|
smalltalk.SemanticAnalyzerTest);
|
645
970
|
|
@@ -647,15 +972,15 @@ smalltalk.addMethod(
|
|
647
972
|
"_testVariableShadowing5",
|
648
973
|
smalltalk.method({
|
649
974
|
selector: "testVariableShadowing5",
|
650
|
-
fn: function ()
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
}
|
975
|
+
fn: function (){
|
976
|
+
var self=this;
|
977
|
+
var src,ast;
|
978
|
+
return smalltalk.withContext(function($ctx1) {
|
979
|
+
ast=_st(smalltalk)._parse_(src);
|
980
|
+
_st(self)._should_raise_((function(){
|
981
|
+
return smalltalk.withContext(function($ctx2) {
|
982
|
+
}, function($ctx2) {$ctx2.fillBlock({},$ctx1)})}),(smalltalk.ShadowingVariableError || ShadowingVariableError));
|
983
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariableShadowing5",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
659
984
|
}),
|
660
985
|
smalltalk.SemanticAnalyzerTest);
|
661
986
|
|
@@ -663,19 +988,17 @@ smalltalk.addMethod(
|
|
663
988
|
"_testVariablesLookup",
|
664
989
|
smalltalk.method({
|
665
990
|
selector: "testVariablesLookup",
|
666
|
-
fn: function ()
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
return self;
|
678
|
-
}
|
991
|
+
fn: function (){
|
992
|
+
var self=this;
|
993
|
+
var src,ast;
|
994
|
+
return smalltalk.withContext(function($ctx1) {
|
995
|
+
ast=_st(smalltalk)._parse_(src);
|
996
|
+
_st(self["@analyzer"])._visit_(ast);
|
997
|
+
_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._first())._receiver())._binding())._isTempVar());
|
998
|
+
_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._first())._receiver())._binding())._scope()).__eq_eq(_st(ast)._scope()));
|
999
|
+
_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._left())._binding())._isTempVar());
|
1000
|
+
_st(self)._assert_(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._nodes())._first())._nodes())._first())._left())._binding())._scope()).__eq_eq(_st(_st(_st(_st(_st(ast)._nodes())._first())._nodes())._last())._scope()));
|
1001
|
+
return self}, function($ctx1) {$ctx1.fill(self,"testVariablesLookup",{src:src,ast:ast}, smalltalk.SemanticAnalyzerTest)})}
|
679
1002
|
}),
|
680
1003
|
smalltalk.SemanticAnalyzerTest);
|
681
1004
|
|