modl 0.3.23 → 0.3.24
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/modl/parser/MODLParser.interp +1 -1
- data/lib/modl/parser/MODLParser.rb +210 -197
- data/lib/modl/parser/evaluator.rb +12 -9
- data/lib/modl/parser/modl_keylist.rb +14 -0
- data/lib/modl/parser/substitutions.rb +4 -0
- data/lib/modl/parser/unicode_escape_replacer.rb +148 -0
- data/lib/modl/parser/version.rb +1 -1
- metadata +3 -18
- data/grammar_tests/1.modl +0 -1
- data/grammar_tests/2.modl +0 -1
- data/grammar_tests/3.modl +0 -1
- data/grammar_tests/a.modl +0 -1
- data/grammar_tests/b.modl +0 -1
- data/grammar_tests/base_tests.json +0 -3174
- data/grammar_tests/c.modl +0 -1
- data/grammar_tests/demo_config.modl +0 -9
- data/grammar_tests/error_tests.json +0 -677
- data/grammar_tests/files/a-b.txt +0 -1
- data/grammar_tests/files/c-d.txt +0 -1
- data/grammar_tests/import_config.modl +0 -9
- data/grammar_tests/test_import_dir/nested_import1.txt +0 -1
- data/grammar_tests/test_import_dir/nested_import2.txt +0 -1
- data/grammar_tests/test_import_dir/nested_import3.txt +0 -1
- data/grammar_tests/test_import_dir/test_import.txt +0 -9
data/grammar_tests/c.modl
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
_var=%var%c
|
@@ -1,677 +0,0 @@
|
|
1
|
-
[
|
2
|
-
{
|
3
|
-
"id": 1,
|
4
|
-
"input": "*VERSION=100;\"123\"=1",
|
5
|
-
"expected_output": "Interpreter Error: Invalid key - \"123\" - entirely numeric keys are not allowed: 123 - MODL Version 1 interpreter cannot process this MODL Version 100 file.",
|
6
|
-
"tested_features": [
|
7
|
-
"errors"
|
8
|
-
],
|
9
|
-
"minimised_modl": "*VERSION=100;\"123\"=1"
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"id": 2,
|
13
|
-
"input": "b=(c=(d=(e=(f=(g=(h=(i=(j=1))))))));a=%b.c.e.f.g.h.i.j",
|
14
|
-
"expected_output": "Interpreter Error: Invalid object reference: \"%b.c.e.f.g.h.i.j\"",
|
15
|
-
"tested_features": [
|
16
|
-
"errors"
|
17
|
-
],
|
18
|
-
"minimised_modl": "b=(c=(d=(e=(f=(g=(h=(i=(j=1))))))));a=%b.c.e.f.g.h.i.j"
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"id": 3,
|
22
|
-
"input": "*method(*id=hy;*name=hyp1;*transform=replace< ,->);*method(*id=hy;*name=hyp2;*transform=replace< ,->)",
|
23
|
-
"expected_output": "Interpreter Error: Duplicate method name or id: hy",
|
24
|
-
"tested_features": [
|
25
|
-
"errors"
|
26
|
-
],
|
27
|
-
"minimised_modl": "*method(*id=hy;*name=hyp1;*transform=replace< ,->);*method(*id=hy;*name=hyp2;*transform=replace< ,->)"
|
28
|
-
},
|
29
|
-
{
|
30
|
-
"id": 4,
|
31
|
-
"input": "*method(*id=hy;*name=hyp1;*transform=replace< ,->);*method(*id=hy1;*name=hyp1;*transform=replace< ,->)",
|
32
|
-
"expected_output": "Interpreter Error: Duplicate method name or id: hyp1",
|
33
|
-
"tested_features": [
|
34
|
-
"errors"
|
35
|
-
],
|
36
|
-
"minimised_modl": "*method(*id=hy;*name=hyp1;*transform=replace< ,->);*method(*id=hy1;*name=hyp1;*transform=replace< ,->)"
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"id": 5,
|
40
|
-
"input": "*method(*id=hy;*name=hyp;*transform=replace< ,->);*method(*id=hyp1;*name=hy;*transform=replace< ,->)",
|
41
|
-
"expected_output": "Interpreter Error: Duplicate method name or id: hy",
|
42
|
-
"tested_features": [
|
43
|
-
"errors"
|
44
|
-
],
|
45
|
-
"minimised_modl": "*method(*id=hy;*name=hyp;*transform=replace< ,->);*method(*id=hyp1;*name=hy;*transform=replace< ,->)"
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"id": 6,
|
49
|
-
"input": "*method(*id=hy;*name=hyp;*transform=replace< ,->);*method(*id=hyp;*name=hyp1;*transform=replace< ,->)",
|
50
|
-
"expected_output": "Interpreter Error: Duplicate method name or id: hyp",
|
51
|
-
"tested_features": [
|
52
|
-
"errors"
|
53
|
-
],
|
54
|
-
"minimised_modl": "*method(*id=hy;*name=hyp;*transform=replace< ,->);*method(*id=hyp;*name=hyp1;*transform=replace< ,->)"
|
55
|
-
},
|
56
|
-
{
|
57
|
-
"id": 7,
|
58
|
-
"input": "*class(*id=t;*name=test;*assign=[[a;b];[a]])",
|
59
|
-
"expected_output": "Interpreter Error: Error: Key lists in *assign are not in ascending order of list length: [\"a\"]",
|
60
|
-
"tested_features": [
|
61
|
-
"errors"
|
62
|
-
],
|
63
|
-
"minimised_modl": "*class(*id=t;*name=test;*assign=[[a;b];[a]])"
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"id": 8,
|
67
|
-
"input": "*class(*id=t;*name=test;*assign=[[a;b]]);test=1:2:3",
|
68
|
-
"expected_output": "Interpreter Error: No key list of the correct length in class t - looking for one of length 3",
|
69
|
-
"tested_features": [
|
70
|
-
"errors"
|
71
|
-
],
|
72
|
-
"minimised_modl": "*class(*id=t;*name=test;*assign=[[a;b]]);test=1:2:3"
|
73
|
-
},
|
74
|
-
{
|
75
|
-
"id": 9,
|
76
|
-
"input": "*class(*id=t;*name=test);*class(*id=tt;*name=test)",
|
77
|
-
"expected_output": "Interpreter Error: Class name or id already defined - cannot redefine: tt, test",
|
78
|
-
"tested_features": [
|
79
|
-
"errors"
|
80
|
-
],
|
81
|
-
"minimised_modl": "*class(*id=t;*name=test);*class(*id=tt;*name=test)"
|
82
|
-
},
|
83
|
-
{
|
84
|
-
"id": 10,
|
85
|
-
"input": "*class(*id=test;*name=t);*class(*id=tt;*name=test)",
|
86
|
-
"expected_output": "Interpreter Error: Class name or id already defined - cannot redefine: tt, test",
|
87
|
-
"tested_features": [
|
88
|
-
"errors"
|
89
|
-
],
|
90
|
-
"minimised_modl": "*class(*id=test;*name=t);*class(*id=tt;*name=test)"
|
91
|
-
},
|
92
|
-
{
|
93
|
-
"id": 11,
|
94
|
-
"input": "*class(*id=test;*name=t);*class(*id=test;*name=tt)",
|
95
|
-
"expected_output": "Interpreter Error: Class name or id already defined - cannot redefine: test, tt",
|
96
|
-
"tested_features": [
|
97
|
-
"errors"
|
98
|
-
],
|
99
|
-
"minimised_modl": "*class(*id=test;*name=t);*class(*id=test;*name=tt)"
|
100
|
-
},
|
101
|
-
{
|
102
|
-
"id": 12,
|
103
|
-
"input": "*class(*name=test;*id=t);*class(*id=test;*name=tt)",
|
104
|
-
"expected_output": "Interpreter Error: Class name or id already defined - cannot redefine: test, tt",
|
105
|
-
"tested_features": [
|
106
|
-
"errors"
|
107
|
-
],
|
108
|
-
"minimised_modl": "*class(*name=test;*id=t);*class(*id=test;*name=tt)"
|
109
|
-
},
|
110
|
-
{
|
111
|
-
"id": 13,
|
112
|
-
"input": "*L=grammar_tests/1;*l=grammar_tests/1;a=1",
|
113
|
-
"expected_output": "Interpreter Error: Cannot load multiple files after *LOAD instruction",
|
114
|
-
"tested_features": [
|
115
|
-
"errors"
|
116
|
-
],
|
117
|
-
"minimised_modl": "*L=grammar_tests/1;*l=grammar_tests/1;a=1"
|
118
|
-
},
|
119
|
-
{
|
120
|
-
"id": 14,
|
121
|
-
"input": "*L=grammar_tests/1;*L=grammar_tests/1",
|
122
|
-
"expected_output": "Interpreter Error: Cannot load multiple files after *LOAD instruction",
|
123
|
-
"tested_features": [
|
124
|
-
"errors"
|
125
|
-
],
|
126
|
-
"minimised_modl": "*L=grammar_tests/1;*L=grammar_tests/1"
|
127
|
-
},
|
128
|
-
{
|
129
|
-
"id": 15,
|
130
|
-
"input": "*class(\n *id=g;\n *name=glossary;\n *superclass=map\n);\n*class(\n *id=t;\n *name=title;\n *superclass=str\n);\n*class(\n *id=d;\n *name=GlossDiv;\n *superclass=map\n);\n*class(\n *id=l;\n *name=GlossList;\n *superclass=map\n);\n*class(\n *id=e;\n *name=GlossEntry;\n *superclass=map;\n *assign[\n [i;s;gt;a;ab;gd;gs]\n ]\n);\n*class(\n *id=i;\n *name=ID;\n *superclass=str\n);\n*class(\n *id=s;\n *name=SortAs;\n *superclass=str\n);\n*class(\n *id=gt;\n *name=GlossTerm;\n *superclass=str\n);\n*class(\n *id=a;\n *name=Acronym;\n *superclass=str\n);\n*class(\n *id=ab;\n *name=Abbrev;\n *superclass=str\n);\n*class(\n *id=gd;\n *name=GlossDef;\n *superclass=map;\n *assign=[\n [p];\n [p;sa]\n ]\n);\n*CLASS(\n *id=p;\n *name=para;\n *superclass=str\n);\n*class(\n *id=sa;\n *name=SeeAlso;\n *superclass=arr\n);\n*class(\n *id=gs;\n *name=GlossSee;\n *superclass=str\n);\n\ng(\n ?=[SGML;markup;language];\n t=example glossary;\n d(\n t=S;\n l(\n e(\n i=%0;\n s=%0;\n gt=Standard Generalized %1.s %2.s;\n a=%0;\n ab=ISO 8879\\:1986;\n gd=A meta-%1 %2, used to create %1 %2s such as DocBook.\n :[GML;XML];\n gs=%1\n )\n )\n )\n)",
|
131
|
-
"expected_output": "Interpreter Error: Already defined *class as final.",
|
132
|
-
"tested_features": [
|
133
|
-
"errors"
|
134
|
-
],
|
135
|
-
"minimised_modl": "*class(\n *id=g;\n *name=glossary;\n *superclass=map\n);\n*class(\n *id=t;\n *name=title;\n *superclass=str\n);\n*class(\n *id=d;\n *name=GlossDiv;\n *superclass=map\n);\n*class(\n *id=l;\n *name=GlossList;\n *superclass=map\n);\n*class(\n *id=e;\n *name=GlossEntry;\n *superclass=map;\n *assign[\n [i;s;gt;a;ab;gd;gs]\n ]\n);\n*class(\n *id=i;\n *name=ID;\n *superclass=str\n);\n*class(\n *id=s;\n *name=SortAs;\n *superclass=str\n);\n*class(\n *id=gt;\n *name=GlossTerm;\n *superclass=str\n);\n*class(\n *id=a;\n *name=Acronym;\n *superclass=str\n);\n*class(\n *id=ab;\n *name=Abbrev;\n *superclass=str\n);\n*class(\n *id=gd;\n *name=GlossDef;\n *superclass=map;\n *assign=[\n [p];\n [p;sa]\n ]\n);\n*CLASS(\n *id=p;\n *name=para;\n *superclass=str\n);\n*class(\n *id=sa;\n *name=SeeAlso;\n *superclass=arr\n);\n*class(\n *id=gs;\n *name=GlossSee;\n *superclass=str\n);\n\ng(\n ?=[SGML;markup;language];\n t=example glossary;\n d(\n t=S;\n l(\n e(\n i=%0;\n s=%0;\n gt=Standard Generalized %1.s %2.s;\n a=%0;\n ab=ISO 8879\\:1986;\n gd=A meta-%1 %2, used to create %1 %2s such as DocBook.\n :[GML;XML];\n gs=%1\n )\n )\n )\n)"
|
136
|
-
},
|
137
|
-
{
|
138
|
-
"id": 16,
|
139
|
-
"input": "*class(*id=n;*name=name;*superclass=num);n=Elliott",
|
140
|
-
"expected_output": "Superclass of \"n\" is num - cannot assign value \"Elliott\"",
|
141
|
-
"tested_features": [
|
142
|
-
"errors"
|
143
|
-
],
|
144
|
-
"minimised_modl": "*class(*id=n;*name=name;*superclass=num);n=Elliott"
|
145
|
-
},
|
146
|
-
{
|
147
|
-
"id": 17,
|
148
|
-
"input": "*class(*id=newstr;*superclass=str);*class(*id=a;*name=age;*superclass=anotherstr);a=10",
|
149
|
-
"expected_output": "Interpreter Error: Invalid superclass: anotherstr",
|
150
|
-
"tested_features": [
|
151
|
-
"errors"
|
152
|
-
],
|
153
|
-
"minimised_modl": "*class(*id=newstr;*superclass=str);*class(*id=a;*name=age;*superclass=anotherstr);a=10"
|
154
|
-
},
|
155
|
-
{
|
156
|
-
"id": 18,
|
157
|
-
"input": "!a=1",
|
158
|
-
"expected_output": "Interpreter Error: Invalid key - \"!\" character not allowed: !a",
|
159
|
-
"tested_features": [
|
160
|
-
"errors"
|
161
|
-
],
|
162
|
-
"minimised_modl": "!a=1"
|
163
|
-
},
|
164
|
-
{
|
165
|
-
"id": 19,
|
166
|
-
"input": "a!=1",
|
167
|
-
"expected_output": "Interpreter Error: Invalid key - \"!\" character not allowed: a!",
|
168
|
-
"tested_features": [
|
169
|
-
"errors"
|
170
|
-
],
|
171
|
-
"minimised_modl": "a!=1"
|
172
|
-
},
|
173
|
-
{
|
174
|
-
"id": 20,
|
175
|
-
"input": "!a!=1",
|
176
|
-
"expected_output": "Interpreter Error: Invalid key - \"!\" character not allowed: !a!",
|
177
|
-
"tested_features": [
|
178
|
-
"errors"
|
179
|
-
],
|
180
|
-
"minimised_modl": "!a!=1"
|
181
|
-
},
|
182
|
-
{
|
183
|
-
"id": 21,
|
184
|
-
"input": "!~a~!=1",
|
185
|
-
"expected_output": "Parser Error: line 1:1 token recognition error at: '~a'",
|
186
|
-
"tested_features": [
|
187
|
-
"errors"
|
188
|
-
],
|
189
|
-
"minimised_modl": "!~a~!=1"
|
190
|
-
},
|
191
|
-
{
|
192
|
-
"id": 22,
|
193
|
-
"input": "£x=y",
|
194
|
-
"expected_output": "Interpreter Error: Invalid key - \"£\" character not allowed: £x",
|
195
|
-
"tested_features": [
|
196
|
-
"errors"
|
197
|
-
],
|
198
|
-
"minimised_modl": "£x=y"
|
199
|
-
},
|
200
|
-
{
|
201
|
-
"id": 23,
|
202
|
-
"input": "$x=y",
|
203
|
-
"expected_output": "Interpreter Error: Invalid key - \"$\" character not allowed: $x",
|
204
|
-
"tested_features": [
|
205
|
-
"errors"
|
206
|
-
],
|
207
|
-
"minimised_modl": "$x=y"
|
208
|
-
},
|
209
|
-
{
|
210
|
-
"id": 24,
|
211
|
-
"input": "@x=y",
|
212
|
-
"expected_output": "Interpreter Error: Invalid key - \"@\" character not allowed: @x",
|
213
|
-
"tested_features": [
|
214
|
-
"errors"
|
215
|
-
],
|
216
|
-
"minimised_modl": "@x=y"
|
217
|
-
},
|
218
|
-
{
|
219
|
-
"id": 25,
|
220
|
-
"input": "-x=y",
|
221
|
-
"expected_output": "Interpreter Error: Invalid key - \"-\" character not allowed: -x",
|
222
|
-
"tested_features": [
|
223
|
-
"errors"
|
224
|
-
],
|
225
|
-
"minimised_modl": "-x=y"
|
226
|
-
},
|
227
|
-
{
|
228
|
-
"id": 26,
|
229
|
-
"input": "+x=y",
|
230
|
-
"expected_output": "Interpreter Error: Invalid key - \"+\" character not allowed: +x",
|
231
|
-
"tested_features": [
|
232
|
-
"errors"
|
233
|
-
],
|
234
|
-
"minimised_modl": "+x=y"
|
235
|
-
},
|
236
|
-
{
|
237
|
-
"id": 27,
|
238
|
-
"input": "'x'=y",
|
239
|
-
"expected_output": "Interpreter Error: Invalid key - \"'\" character not allowed: 'x'",
|
240
|
-
"tested_features": [
|
241
|
-
"errors"
|
242
|
-
],
|
243
|
-
"minimised_modl": "'x'=y"
|
244
|
-
},
|
245
|
-
{
|
246
|
-
"id": 28,
|
247
|
-
"input": "'x?=y",
|
248
|
-
"expected_output": "Interpreter Error: Invalid key - \"'\" character not allowed: 'x?",
|
249
|
-
"tested_features": [
|
250
|
-
"errors"
|
251
|
-
],
|
252
|
-
"minimised_modl": "'x?=y"
|
253
|
-
},
|
254
|
-
{
|
255
|
-
"id": 29,
|
256
|
-
"input": "a=1:2:3;;\nb=4:5:6",
|
257
|
-
"expected_output": "Parser Error: line 1:8 no viable alternative at input ';;'",
|
258
|
-
"tested_features": [
|
259
|
-
"errors"
|
260
|
-
],
|
261
|
-
"minimised_modl": "a=1:2:3;;\nb=4:5:6"
|
262
|
-
},
|
263
|
-
{
|
264
|
-
"id": 30,
|
265
|
-
"input": "a=1:2:3;\n;\nb=4:5:6",
|
266
|
-
"expected_output": "Parser Error: line 2:0 no viable alternative at input ';;'",
|
267
|
-
"tested_features": [
|
268
|
-
"errors"
|
269
|
-
],
|
270
|
-
"minimised_modl": "a=1:2:3;\n;\nb=4:5:6"
|
271
|
-
},
|
272
|
-
{
|
273
|
-
"id": 31,
|
274
|
-
"input": "a=1:2:3\n;\n;\nb=4:5:6",
|
275
|
-
"expected_output": "Parser Error: line 3:0 no viable alternative at input ';;'",
|
276
|
-
"tested_features": [
|
277
|
-
"errors"
|
278
|
-
],
|
279
|
-
"minimised_modl": "a=1:2:3\n;\n;\nb=4:5:6"
|
280
|
-
},
|
281
|
-
{
|
282
|
-
"id": 32,
|
283
|
-
"input": "a=1:2:3\n;;\nb=4:5:6",
|
284
|
-
"expected_output": "Parser Error: line 2:1 no viable alternative at input ';;'",
|
285
|
-
"tested_features": [
|
286
|
-
"errors"
|
287
|
-
],
|
288
|
-
"minimised_modl": "a=1:2:3\n;;\nb=4:5:6"
|
289
|
-
},
|
290
|
-
{
|
291
|
-
"id": 33,
|
292
|
-
"input": "a=1:2:3\n;\nb=4:5:6\n;\n;\n",
|
293
|
-
"expected_output": "Parser Error: line 5:0 no viable alternative at input ';;'",
|
294
|
-
"tested_features": [
|
295
|
-
"errors"
|
296
|
-
],
|
297
|
-
"minimised_modl": "a=1:2:3\n;\nb=4:5:6\n;\n;\n"
|
298
|
-
},
|
299
|
-
{
|
300
|
-
"id": 34,
|
301
|
-
"input": "a=1:2:3\n;\nb=4:5:6\n;;\n",
|
302
|
-
"expected_output": "Parser Error: line 4:1 no viable alternative at input ';;'",
|
303
|
-
"tested_features": [
|
304
|
-
"errors"
|
305
|
-
],
|
306
|
-
"minimised_modl": "a=1:2:3\n;\nb=4:5:6\n;;\n"
|
307
|
-
},
|
308
|
-
{
|
309
|
-
"id": 35,
|
310
|
-
"input": "*nonsense=1",
|
311
|
-
"expected_output": "Interpreter Error: Invalid keyword: *nonsense",
|
312
|
-
"tested_features": [
|
313
|
-
"errors"
|
314
|
-
],
|
315
|
-
"minimised_modl": "*nonsense=1"
|
316
|
-
},
|
317
|
-
{
|
318
|
-
"id": 36,
|
319
|
-
"input": "?=1:2:3:4;_12%3=1",
|
320
|
-
"expected_output": "Interpreter Error: Invalid key - \"124\" - entirely numeric keys are not allowed: _124",
|
321
|
-
"tested_features": [
|
322
|
-
"errors"
|
323
|
-
],
|
324
|
-
"minimised_modl": "?=1:2:3:4;_12%3=1"
|
325
|
-
},
|
326
|
-
{
|
327
|
-
"id": 37,
|
328
|
-
"input": "_123=1",
|
329
|
-
"expected_output": "Interpreter Error: Invalid key - \"123\" - entirely numeric keys are not allowed: _123",
|
330
|
-
"tested_features": [
|
331
|
-
"errors"
|
332
|
-
],
|
333
|
-
"minimised_modl": "_123=1"
|
334
|
-
},
|
335
|
-
{
|
336
|
-
"id": 38,
|
337
|
-
"input": "_12*3=1",
|
338
|
-
"expected_output": "Interpreter Error: Invalid key - \"*\" character not allowed: _12*3",
|
339
|
-
"tested_features": [
|
340
|
-
"errors"
|
341
|
-
],
|
342
|
-
"minimised_modl": "_12*3=1"
|
343
|
-
},
|
344
|
-
{
|
345
|
-
"id": 39,
|
346
|
-
"input": "_12!3=1",
|
347
|
-
"expected_output": "Interpreter Error: Invalid key - \"!\" character not allowed: _12!3",
|
348
|
-
"tested_features": [
|
349
|
-
"errors"
|
350
|
-
],
|
351
|
-
"minimised_modl": "_12!3=1"
|
352
|
-
},
|
353
|
-
{
|
354
|
-
"id": 40,
|
355
|
-
"input": "_12@3=1",
|
356
|
-
"expected_output": "Interpreter Error: Invalid key - \"@\" character not allowed: _12@3",
|
357
|
-
"tested_features": [
|
358
|
-
"errors"
|
359
|
-
],
|
360
|
-
"minimised_modl": "_12@3=1"
|
361
|
-
},
|
362
|
-
{
|
363
|
-
"id": 41,
|
364
|
-
"input": "_12#3=1",
|
365
|
-
"expected_output": "Interpreter Error: Invalid key - \"#\" character not allowed: _12#3",
|
366
|
-
"tested_features": [
|
367
|
-
"errors"
|
368
|
-
],
|
369
|
-
"minimised_modl": "_12#3=1"
|
370
|
-
},
|
371
|
-
{
|
372
|
-
"id": 42,
|
373
|
-
"input": "_12$3=1",
|
374
|
-
"expected_output": "Interpreter Error: Invalid key - \"$\" character not allowed: _12$3",
|
375
|
-
"tested_features": [
|
376
|
-
"errors"
|
377
|
-
],
|
378
|
-
"minimised_modl": "_12$3=1"
|
379
|
-
},
|
380
|
-
{
|
381
|
-
"id": 43,
|
382
|
-
"input": "_12^3=1",
|
383
|
-
"expected_output": "Interpreter Error: Invalid key - \"^\" character not allowed: _12^3",
|
384
|
-
"tested_features": [
|
385
|
-
"errors"
|
386
|
-
],
|
387
|
-
"minimised_modl": "_12^3=1"
|
388
|
-
},
|
389
|
-
{
|
390
|
-
"id": 44,
|
391
|
-
"input": "_12&3=1",
|
392
|
-
"expected_output": "Interpreter Error: Invalid key - \"&\" character not allowed: _12&3",
|
393
|
-
"tested_features": [
|
394
|
-
"errors"
|
395
|
-
],
|
396
|
-
"minimised_modl": "_12&3=1"
|
397
|
-
},
|
398
|
-
{
|
399
|
-
"id": 45,
|
400
|
-
"input": "_12(3=1",
|
401
|
-
"expected_output": "Parser Error: line 1:4 no viable alternative at input '_12(3'",
|
402
|
-
"tested_features": [
|
403
|
-
"errors"
|
404
|
-
],
|
405
|
-
"minimised_modl": "_12(3=1"
|
406
|
-
},
|
407
|
-
{
|
408
|
-
"id": 46,
|
409
|
-
"input": "_12)3=1",
|
410
|
-
"expected_output": "Parser Error: line 1:3 no viable alternative at input '_12)'",
|
411
|
-
"tested_features": [
|
412
|
-
"errors"
|
413
|
-
],
|
414
|
-
"minimised_modl": "_12)3=1"
|
415
|
-
},
|
416
|
-
{
|
417
|
-
"id": 47,
|
418
|
-
"input": "123=456",
|
419
|
-
"expected_output": "Parser Error: line 1:0 mismatched input '123' expecting {<EOF>, LBRAC, LSBRAC, QUOTED, STRING, '{'}",
|
420
|
-
"tested_features": [
|
421
|
-
"errors"
|
422
|
-
],
|
423
|
-
"minimised_modl": "123=456"
|
424
|
-
},
|
425
|
-
{
|
426
|
-
"id": 48,
|
427
|
-
"input": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.one.0",
|
428
|
-
"expected_output": "Interpreter Error: Found a map when expecting an array",
|
429
|
-
"tested_features": [
|
430
|
-
"errors"
|
431
|
-
],
|
432
|
-
"minimised_modl": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.one.0"
|
433
|
-
},
|
434
|
-
{
|
435
|
-
"id": 49,
|
436
|
-
"input": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.0.two",
|
437
|
-
"expected_output": "Interpreter Error: Invalid object reference: \"%test.first.v1.0.two\"",
|
438
|
-
"tested_features": [
|
439
|
-
"errors"
|
440
|
-
],
|
441
|
-
"minimised_modl": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.0.two"
|
442
|
-
},
|
443
|
-
{
|
444
|
-
"id": 50,
|
445
|
-
"input": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.0.0",
|
446
|
-
"expected_output": "Interpreter Error: Found a map when expecting an array",
|
447
|
-
"tested_features": [
|
448
|
-
"errors"
|
449
|
-
],
|
450
|
-
"minimised_modl": "_test=(\n first=(\"v1\"=(one=(two=three)))\n);\n \ntesting = %test.first.v1.0.0"
|
451
|
-
},
|
452
|
-
{
|
453
|
-
"id": 51,
|
454
|
-
"input": "_test=(\n numbers=(\"one\"=1)\n);\n\ntesting = this is a string that includes a reference with a letter s after it %test.numbers.ones",
|
455
|
-
"expected_output": "Interpreter Error: Invalid object reference: \"this is a string that includes a reference with a letter s after it %test.numbers.ones\"",
|
456
|
-
"tested_features": [
|
457
|
-
"errors"
|
458
|
-
],
|
459
|
-
"minimised_modl": "_test=(\n numbers=(\"one\"=1)\n);\n\ntesting = this is a string that includes a reference with a letter s after it %test.numbers.ones"
|
460
|
-
},
|
461
|
-
{
|
462
|
-
"id": 52,
|
463
|
-
"input": "true=test",
|
464
|
-
"expected_output": "Parser Error: line 1:0 mismatched input 'true' expecting {<EOF>, LBRAC, LSBRAC, QUOTED, STRING, '{'}",
|
465
|
-
"tested_features": [
|
466
|
-
"errors"
|
467
|
-
],
|
468
|
-
"minimised_modl": "true=test"
|
469
|
-
},
|
470
|
-
{
|
471
|
-
"id": 53,
|
472
|
-
"input": "false=test",
|
473
|
-
"expected_output": "Parser Error: line 1:0 mismatched input 'false' expecting {<EOF>, LBRAC, LSBRAC, QUOTED, STRING, '{'}",
|
474
|
-
"tested_features": [
|
475
|
-
"errors"
|
476
|
-
],
|
477
|
-
"minimised_modl": "false=test"
|
478
|
-
},
|
479
|
-
{
|
480
|
-
"id": 54,
|
481
|
-
"input": "null=test",
|
482
|
-
"expected_output": "Parser Error: line 1:0 mismatched input 'null' expecting {<EOF>, LBRAC, LSBRAC, QUOTED, STRING, '{'}",
|
483
|
-
"tested_features": [
|
484
|
-
"errors"
|
485
|
-
],
|
486
|
-
"minimised_modl": "null=test"
|
487
|
-
},
|
488
|
-
{
|
489
|
-
"id": 55,
|
490
|
-
"input": "*class(*id=arr)",
|
491
|
-
"expected_output": "Interpreter Error: Reserved class id - cannot redefine: arr",
|
492
|
-
"tested_features": [
|
493
|
-
"errors"
|
494
|
-
],
|
495
|
-
"minimised_modl": "*class(*id=arr)"
|
496
|
-
},
|
497
|
-
{
|
498
|
-
"id": 56,
|
499
|
-
"input": "*class(*id=num)",
|
500
|
-
"expected_output": "Interpreter Error: Reserved class id - cannot redefine: num",
|
501
|
-
"tested_features": [
|
502
|
-
"errors"
|
503
|
-
],
|
504
|
-
"minimised_modl": "*class(*id=num)"
|
505
|
-
},
|
506
|
-
{
|
507
|
-
"id": 57,
|
508
|
-
"input": "*class(*id=map)",
|
509
|
-
"expected_output": "Interpreter Error: Reserved class id - cannot redefine: map",
|
510
|
-
"tested_features": [
|
511
|
-
"errors"
|
512
|
-
],
|
513
|
-
"minimised_modl": "*class(*id=map)"
|
514
|
-
},
|
515
|
-
{
|
516
|
-
"id": 58,
|
517
|
-
"input": "*class(*id=str)",
|
518
|
-
"expected_output": "Interpreter Error: Reserved class id - cannot redefine: str",
|
519
|
-
"tested_features": [
|
520
|
-
"errors"
|
521
|
-
],
|
522
|
-
"minimised_modl": "*class(*id=str)"
|
523
|
-
},
|
524
|
-
{
|
525
|
-
"id": 59,
|
526
|
-
"input": "*class(*name=arr)",
|
527
|
-
"expected_output": "Interpreter Error: Reserved class name - cannot redefine: arr",
|
528
|
-
"tested_features": [
|
529
|
-
"errors"
|
530
|
-
],
|
531
|
-
"minimised_modl": "*class(*name=arr)"
|
532
|
-
},
|
533
|
-
{
|
534
|
-
"id": 60,
|
535
|
-
"input": "*class(*name=num)",
|
536
|
-
"expected_output": "Interpreter Error: Reserved class name - cannot redefine: num",
|
537
|
-
"tested_features": [
|
538
|
-
"errors"
|
539
|
-
],
|
540
|
-
"minimised_modl": "*class(*name=num)"
|
541
|
-
},
|
542
|
-
{
|
543
|
-
"id": 61,
|
544
|
-
"input": "*class(*name=map)",
|
545
|
-
"expected_output": "Interpreter Error: Reserved class name - cannot redefine: map",
|
546
|
-
"tested_features": [
|
547
|
-
"errors"
|
548
|
-
],
|
549
|
-
"minimised_modl": "*class(*name=map)"
|
550
|
-
},
|
551
|
-
{
|
552
|
-
"id": 62,
|
553
|
-
"input": "*class(*name=str)",
|
554
|
-
"expected_output": "Interpreter Error: Reserved class name - cannot redefine: str",
|
555
|
-
"tested_features": [
|
556
|
-
"errors"
|
557
|
-
],
|
558
|
-
"minimised_modl": "*class(*name=str)"
|
559
|
-
},
|
560
|
-
{
|
561
|
-
"id": 63,
|
562
|
-
"input": "IMMUTABLE=true;IMMUTABLE=false",
|
563
|
-
"expected_output": "Interpreter Error: Already defined IMMUTABLE as final.",
|
564
|
-
"tested_features": [
|
565
|
-
"errors"
|
566
|
-
],
|
567
|
-
"minimised_modl": "IMMUTABLE=true;IMMUTABLE=false"
|
568
|
-
},
|
569
|
-
{
|
570
|
-
"id": 64,
|
571
|
-
"input": "*VERSION=test",
|
572
|
-
"expected_output": "Interpreter Error: Invalid MODL version: test",
|
573
|
-
"tested_features": [
|
574
|
-
"errors"
|
575
|
-
],
|
576
|
-
"minimised_modl": "*VERSION=test"
|
577
|
-
},
|
578
|
-
{
|
579
|
-
"id": 65,
|
580
|
-
"input": "*V=test",
|
581
|
-
"expected_output": "Interpreter Error: Invalid MODL version: test",
|
582
|
-
"tested_features": [
|
583
|
-
"errors"
|
584
|
-
],
|
585
|
-
"minimised_modl": "*V=test"
|
586
|
-
},
|
587
|
-
{
|
588
|
-
"id": 66,
|
589
|
-
"input": "*VERSION=0",
|
590
|
-
"expected_output": "Interpreter Error: Invalid MODL version: 0",
|
591
|
-
"tested_features": [
|
592
|
-
"errors"
|
593
|
-
],
|
594
|
-
"minimised_modl": "*VERSION=0"
|
595
|
-
},
|
596
|
-
{
|
597
|
-
"id": 67,
|
598
|
-
"input": "*VERSION=0.1",
|
599
|
-
"expected_output": "Interpreter Error: Invalid MODL version: 0.1",
|
600
|
-
"tested_features": [
|
601
|
-
"errors"
|
602
|
-
],
|
603
|
-
"minimised_modl": "*VERSION=0.1"
|
604
|
-
},
|
605
|
-
{
|
606
|
-
"id": 68,
|
607
|
-
"input": "a=b;*VERSION=1",
|
608
|
-
"expected_output": "Interpreter Error: MODL version should be on the first line if specified.",
|
609
|
-
"tested_features": [
|
610
|
-
"errors"
|
611
|
-
],
|
612
|
-
"minimised_modl": "a=b;*VERSION=1"
|
613
|
-
},
|
614
|
-
{
|
615
|
-
"id": 69,
|
616
|
-
"input": "*class(*id=a;*name=alpha;*superclass=str);a=null",
|
617
|
-
"expected_output": "Interpreter Error: Cannot convert null value to string.",
|
618
|
-
"tested_features": [
|
619
|
-
"errors"
|
620
|
-
],
|
621
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=str);a=null"
|
622
|
-
},
|
623
|
-
{
|
624
|
-
"id": 70,
|
625
|
-
"input": "*class(*id=a;*name=alpha;*superclass=num);a=null",
|
626
|
-
"expected_output": "Superclass of \"a\" is num - cannot assign value \"\"",
|
627
|
-
"tested_features": [
|
628
|
-
"errors"
|
629
|
-
],
|
630
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=num);a=null"
|
631
|
-
},
|
632
|
-
{
|
633
|
-
"id": 71,
|
634
|
-
"input": "*class(*id=a;*name=alpha;*superclass=num);a=x",
|
635
|
-
"expected_output": "Superclass of \"a\" is num - cannot assign value \"x\"",
|
636
|
-
"tested_features": [
|
637
|
-
"errors"
|
638
|
-
],
|
639
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=num);a=x"
|
640
|
-
},
|
641
|
-
{
|
642
|
-
"id": 72,
|
643
|
-
"input": "*class(*id=a;*name=alpha;*superclass=num);a=null",
|
644
|
-
"expected_output": "Superclass of \"a\" is num - cannot assign value \"\"",
|
645
|
-
"tested_features": [
|
646
|
-
"errors"
|
647
|
-
],
|
648
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=num);a=null"
|
649
|
-
},
|
650
|
-
{
|
651
|
-
"id": 73,
|
652
|
-
"input": "*class(*id=a;*name=alpha;*superclass=map);a=[1;2;3]",
|
653
|
-
"expected_output": "Interpreter Error: Cannot convert array to map: [1, 2, 3]",
|
654
|
-
"tested_features": [
|
655
|
-
"errors"
|
656
|
-
],
|
657
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=map);a=[1;2;3]"
|
658
|
-
},
|
659
|
-
{
|
660
|
-
"id": 74,
|
661
|
-
"input": "*class(*id=a;*name=alpha;*superclass=arr);a=(c=d)",
|
662
|
-
"expected_output": "Interpreter Error: Cannot convert map to array: {\"c\"=>\"d\"}",
|
663
|
-
"tested_features": [
|
664
|
-
"errors"
|
665
|
-
],
|
666
|
-
"minimised_modl": "*class(*id=a;*name=alpha;*superclass=arr);a=(c=d)"
|
667
|
-
},
|
668
|
-
{
|
669
|
-
"id": 75,
|
670
|
-
"input": "*L=grammar_tests/test_import_dir/nested_import1.txt;files=%*load",
|
671
|
-
"expected_output": "Interpreter Error: Cannot load multiple files after *LOAD instruction",
|
672
|
-
"tested_features": [
|
673
|
-
"errors"
|
674
|
-
],
|
675
|
-
"minimised_modl": "*L=grammar_tests/test_import_dir/nested_import1.txt;files=%*load"
|
676
|
-
}
|
677
|
-
]
|