-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathrun.t
More file actions
291 lines (288 loc) · 9.23 KB
/
run.t
File metadata and controls
291 lines (288 loc) · 9.23 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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
Hello world should work:
$ aslref hello_world.asl
Hello, world!
ASL Semantics Tests:
$ aslref SemanticsRule.Lit.asl
$ aslref SemanticsRule.ELocalVar.asl
$ aslref SemanticsRule.EGlobalVar.asl
$ aslref SemanticsRule.EGlobalVarError.asl
$ aslref SemanticsRule.EUndefIdent.asl
File SemanticsRule.EUndefIdent.asl, line 5, characters 9 to 10:
assert y;
^
ASL Static error: Undefined identifier: 'y'
[1]
// $ aslref SemanticsRule.EBinopPlusPrint.asl
$ aslref SemanticsRule.EBinopPlusAssert.asl
$ aslref SemanticsRule.EUnopAssert.asl
$ aslref SemanticsRule.ECondFALSE.asl
$ aslref SemanticsRule.ECondARBITRARY3or42.asl
File SemanticsRule.ECondARBITRARY3or42.asl, line 10, characters 9 to 13:
assert x==3;
^^^^
ASL Dynamic error: Assertion failed: (x == 3).
[1]
$ aslref SemanticsRule.ESlice.asl
$ aslref SemanticsRule.ECall.asl
$ aslref SemanticsRule.EGetArray.asl
$ aslref SemanticsRule.EGetArrayTooSmall.asl
ASL Dynamic error: Mismatch type:
value 3 does not belong to type integer {0..2}.
[1]
$ aslref SemanticsRule.ERecord.asl
$ aslref SemanticsRule.EGetItem.asl
$ aslref SemanticsRule.EConcat.asl
$ aslref SemanticsRule.ETuple.asl
$ aslref SemanticsRule.EArbitraryInteger0.asl
$ aslref SemanticsRule.EArbitraryInteger3.asl
File SemanticsRule.EArbitraryInteger3.asl, line 5, characters 9 to 13:
assert x==3;
^^^^
ASL Dynamic error: Assertion failed: (x == 3).
[1]
$ aslref SemanticsRule.EArbitraryIntegerRange3-42-3.asl
$ aslref SemanticsRule.EArbitraryIntegerRange3-42-42.asl
File SemanticsRule.EArbitraryIntegerRange3-42-42.asl, line 5,
characters 9 to 14:
assert x==42;
^^^^^
ASL Dynamic error: Assertion failed: (x == 42).
[1]
$ aslref SemanticsRule.EArbitraryArray.asl
$ aslref SemanticsRule.EPattern.asl
$ aslref SemanticsRule.LELocalVar.asl
$ aslref SemanticsRule.LESetArray.asl
$ aslref SemanticsRule.LESetEnumArray.asl
$ aslref SemanticsRule.SReturnNone.asl
$ aslref SemanticsRule.SCond.asl
$ aslref SemanticsRule.SCase.asl
$ aslref SemanticsRule.SWhile.asl
i = 0
i = 1
i = 2
i = 3
$ aslref SemanticsRule.SWhile.limit_reached.asl
File SemanticsRule.SWhile.limit_reached.asl, line 4, character 2 to line 7,
character 7:
while i <= 3 looplimit 2 do
assert i <= 3;
i = i + 1;
end;
ASL Dynamic error: loop limit reached.
[1]
$ aslref SemanticsRule.SWhile.negative_limit.asl
File SemanticsRule.SWhile.negative_limit.asl, line 4, character 2 to line 6,
character 6:
while TRUE looplimit -1 do
println "This should not be printed";
end;
ASL Dynamic error: loop limit reached.
[1]
$ aslref SemanticsRule.SRepeat.asl
File SemanticsRule.SRepeat.asl, line 24, character 4 to line 31, character 17:
repeat
println "i = ", i;
assert i < 5;
if x[i] == '1' then
ones = ones + 1;
end;
i = i + 1;
until i == 5;
ASL Warning: Loop does not have a limit.
j = 0
j = 1
j = 2
j = 3
j = 4
#ones in x = 5
i = 0
i = 1
i = 2
i = 3
i = 4
#ones in x = 5
$ aslref SemanticsRule.SFor.asl
j = 0
j = 1
j = 2
j = 3
j = 4
#ones in x = 5
i = 4
i = 3
i = 2
i = 1
i = 0
#ones in x = 5
$ aslref SemanticsRule.SFor.nop.asl
$ aslref SemanticsRule.SThrowSomeTyped.asl
$ aslref SemanticsRule.SThrowSTry.asl
aslref cannot find file "SemanticsRule.SThrowSTry.asl"
[1]
$ aslref SemanticsRule.SPrint.asl
string_number_1
0
1000000
53170898287292728730499578000
TRUE
FALSE
12345678900123456789/10000000000
0
hello\world
"here I am "
0xd
0x
LABEL_B
$ aslref SemanticsRule.Loop.asl
$ aslref SemanticsRule.For.asl
$ aslref SemanticsRule.Catch.asl
$ aslref SemanticsRule.CatchNamed.asl
caught MyExceptionType with msg=42
$ aslref SemanticsRule.CatchOtherwise.asl
Otherwise
$ aslref SemanticsRule.CatchNone.asl
File SemanticsRule.CatchNone.asl, line 15, characters 8 to 24:
catch MyExceptionType1;
^^^^^^^^^^^^^^^^
ASL Grammar error: Cannot parse.
[1]
$ aslref SemanticsRule.FUndefIdent.asl
File SemanticsRule.FUndefIdent.asl, line 4, characters 5 to 12:
foo ();
^^^^^^^
ASL Static error: Undefined identifier: 'foo'
[1]
$ aslref SemanticsRule.FCall.asl
$ aslref SemanticsRule.PAll.asl
$ aslref SemanticsRule.PAny.asl
$ aslref SemanticsRule.PGeq.asl
$ aslref SemanticsRule.PLeq.asl
$ aslref SemanticsRule.PNot.asl
$ aslref SemanticsRule.PRange.asl
$ aslref SemanticsRule.PSingle.asl
$ aslref SemanticsRule.PMask.asl
$ aslref SemanticsRule.PTuple.asl
$ aslref SemanticsRule.ATCValue.asl
$ aslref -0 SemanticsRule.LEUndefIdentV0.asl
$ aslref SemanticsRule.LEUndefIdentV1.asl
File SemanticsRule.LEUndefIdentV1.asl, line 5, characters 2 to 3:
y = 3;
^
ASL Static error: Undefined identifier: 'y'
[1]
$ aslref SemanticsRule.LESlice.asl
$ aslref SemanticsRule.LESetField.asl
$ aslref SemanticsRule.LEDestructuring.asl
$ aslref SemanticsRule.SliceSingle.asl
$ aslref SemanticsRule.SliceLength.asl
$ aslref SemanticsRule.SliceRange.asl
$ aslref SemanticsRule.SliceStar.asl
$ aslref SemanticsRule.SliceFromZero.asl
$ aslref SemanticsRule.Slices.asl
$ aslref SemanticsRule.LDTuple.asl
$ aslref SemanticsRule.LDTypedTuple.asl
$ aslref SemanticsRule.LDTypedVar.asl
$ aslref SemanticsRule.LDTyped.asl
$ aslref SemanticsRule.LDUninitialisedTyped.asl
$ aslref SemanticsRule.SAssign.asl
$ aslref SemanticsRule.SCall.asl
$ aslref SemanticsRule.SDeclNone.asl
$ aslref SemanticsRule.SDeclSome.asl
$ aslref SemanticsRule.SPass.asl
$ aslref SemanticsRule.SReturnOne.asl
$ aslref SemanticsRule.SReturnSome.asl
$ aslref SemanticsRule.SSeq.asl
$ aslref SemanticsRule.Block.asl
$ aslref SemanticsRule.SAssignCall.asl
$ aslref SemanticsRule.SAssignTuple.asl
$ aslref SemanticsRule.EBinopImplExFalso.asl
$ aslref SemanticsRule.EBinopOrTrue.asl
$ aslref SemanticsRule.EBinopAndFalse.asl
$ aslref SemanticsRule.SAssertOk.asl
$ aslref SemanticsRule.SAssertNo.asl
File SemanticsRule.SAssertNo.asl, line 4, characters 10 to 17:
assert (42 == 3);
^^^^^^^
ASL Dynamic error: Assertion failed: (42 == 3).
[1]
$ aslref SemanticsRule.LEDiscard.asl
$ aslref SemanticsRule.LDDiscard.asl
File SemanticsRule.LDDiscard.asl, line 4, characters 6 to 7:
var - : integer;
^
ASL Grammar error: Cannot parse. A local declaration must declare a name.
[1]
$ aslref EvalCatchers.asl
21
$ aslref SemanticsRule.ATCNotDynamicErrorIfFalse.asl
$ aslref SemanticsRule.ATCVariousErrors.asl
File SemanticsRule.ATCVariousErrors.asl, line 8, characters 28 to 29:
var c: integer{4, 5, 6} = 2 as integer{4, 5, 6}; // A dynamic error
^
ASL Dynamic error: Mismatch type:
value 2 does not belong to type integer {4, 5, 6}.
[1]
$ aslref SemanticsRule.CatchNoThrow.asl
No exception raised
$ aslref SemanticsRule.EConcat2.asl
$ aslref SemanticsRule.LEGlobalVar.asl
$ aslref SemanticsRule.SCond2.asl
$ aslref SemanticsRule.SCond3.asl
File SemanticsRule.SCond3.asl, line 3, characters 9 to 14:
assert FALSE;
^^^^^
ASL Dynamic error: Assertion failed: FALSE.
[1]
$ aslref SemanticsRule.SCond4.asl
$ aslref SemanticsRule.STry.asl
$ aslref SemanticsRule.EGetEnumArray.asl
$ aslref SemanticsRule.CheckNonOverlappingSlices.asl
$ aslref SemanticsRule.CheckNonOverlappingSlices.bad.asl
ASL Dynamic error: overlapping slices (N - 2)+:2, 0+:1.
[1]
$ aslref SemanticsRule.DeclareGlobal.asl
$ aslref SemanticsRule.EvalGlobals.asl
$ aslref SemanticsRule.MatchFuncRes.asl
$ aslref SemanticsRule.CheckRecurseLimit.asl
$ aslref SemanticsRule.CheckRecurseLimit.no_limit.asl
File SemanticsRule.CheckRecurseLimit.no_limit.asl, line 1, character 0 to
line 4, character 4:
readonly func factorial(n: integer) => integer
begin
return if n == 0 then 1 else n * factorial(n - 1);
end;
ASL Warning: the recursive function factorial has no recursive limit
annotation.
$ aslref SemanticsRule.CheckRecurseLimit.limit_reached.asl
File SemanticsRule.CheckRecurseLimit.limit_reached.asl, line 3,
characters 37 to 53:
return if n == 0 then 1 else n * factorial(n - 1);
^^^^^^^^^^^^^^^^
ASL Dynamic error: recursion limit reached.
[1]
$ aslref SemanticsRule.AssignArgs.asl
$ aslref SemanticsRule.Call.asl
$ aslref SemanticsRule.ReadFromBitvector.asl
empty_bv_slice = 0x, empty_i_slice = 0x
slice_bv = 0x9c5, slice_i = 0x9c5
$ aslref SemanticsRule.AsBitvector.asl
bv = 0xfdf0, bv_i = 0xfdf0
$ aslref SemanticsRule.ConcatBitvectors.asl
$ aslref SemanticsRule.RemoveLocal.asl
i=0
i=11/2
exn=TRUE
$ aslref SemanticsRule.ReadIdentifier.asl
$ aslref SemanticsRule.SlicesToPositions.asl
$ aslref SemanticsRule.SlicesToPositions.bad.asl
ASL Dynamic error: Cannot extract from bitvector of length 0 slice -1+:6.
[1]
$ aslref SemanticsRule.GetIndex.asl
$ aslref SemanticsRule.GetField.asl
$ aslref SemanticsRule.EvalGlobals.bad1.asl
File SemanticsRule.EvalGlobals.bad1.asl, line 10, characters 0 to 12:
var x = f();
^^^^^^^^^^^^
ASL Dynamic error: unexpected exception MyException thrown during the
evaluation of the initialisation of the global storage element "x".
[1]