@tuprolog/arg2p 0.10.2 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/2p-parser-core.js CHANGED
@@ -1,36 +1,36 @@
1
- (function (root, factory) {
1
+ (function (factory) {
2
2
  if (typeof define === 'function' && define.amd)
3
3
  define(['exports', '@tuprolog/parser-utils', 'antlr4', 'antlr4/src/antlr4/error', 'antlr4/src/antlr4/atn', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-parser-js.js', './kt-math.js'], factory);
4
4
  else if (typeof exports === 'object')
5
5
  factory(module.exports, require('@tuprolog/parser-utils'), require('antlr4'), require('antlr4/src/antlr4/error'), require('antlr4/src/antlr4/atn'), require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-parser-js.js'), require('./kt-math.js'));
6
6
  else {
7
- if (typeof this['@tuprolog/parser-utils'] === 'undefined') {
7
+ if (typeof globalThis['@tuprolog/parser-utils'] === 'undefined') {
8
8
  throw new Error("Error loading module '2p-parser-core'. Its dependency '@tuprolog/parser-utils' was not found. Please, check whether '@tuprolog/parser-utils' is loaded prior to '2p-parser-core'.");
9
9
  }
10
10
  if (typeof antlr4 === 'undefined') {
11
11
  throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4' was not found. Please, check whether 'antlr4' is loaded prior to '2p-parser-core'.");
12
12
  }
13
- if (typeof this['antlr4/src/antlr4/error'] === 'undefined') {
13
+ if (typeof globalThis['antlr4/src/antlr4/error'] === 'undefined') {
14
14
  throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4/src/antlr4/error' was not found. Please, check whether 'antlr4/src/antlr4/error' is loaded prior to '2p-parser-core'.");
15
15
  }
16
- if (typeof this['antlr4/src/antlr4/atn'] === 'undefined') {
16
+ if (typeof globalThis['antlr4/src/antlr4/atn'] === 'undefined') {
17
17
  throw new Error("Error loading module '2p-parser-core'. Its dependency 'antlr4/src/antlr4/atn' was not found. Please, check whether 'antlr4/src/antlr4/atn' is loaded prior to '2p-parser-core'.");
18
18
  }
19
- if (typeof this['kotlin-kotlin-stdlib'] === 'undefined') {
19
+ if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
20
20
  throw new Error("Error loading module '2p-parser-core'. Its dependency 'kotlin-kotlin-stdlib' was not found. Please, check whether 'kotlin-kotlin-stdlib' is loaded prior to '2p-parser-core'.");
21
21
  }
22
- if (typeof this['2p-core'] === 'undefined') {
22
+ if (typeof globalThis['2p-core'] === 'undefined') {
23
23
  throw new Error("Error loading module '2p-parser-core'. Its dependency '2p-core' was not found. Please, check whether '2p-core' is loaded prior to '2p-parser-core'.");
24
24
  }
25
- if (typeof this['2p-parser-js'] === 'undefined') {
25
+ if (typeof globalThis['2p-parser-js'] === 'undefined') {
26
26
  throw new Error("Error loading module '2p-parser-core'. Its dependency '2p-parser-js' was not found. Please, check whether '2p-parser-js' is loaded prior to '2p-parser-core'.");
27
27
  }
28
- if (typeof this['kt-math'] === 'undefined') {
28
+ if (typeof globalThis['kt-math'] === 'undefined') {
29
29
  throw new Error("Error loading module '2p-parser-core'. Its dependency 'kt-math' was not found. Please, check whether 'kt-math' is loaded prior to '2p-parser-core'.");
30
30
  }
31
- root['2p-parser-core'] = factory(typeof this['2p-parser-core'] === 'undefined' ? {} : this['2p-parser-core'], this['@tuprolog/parser-utils'], antlr4, this['antlr4/src/antlr4/error'], this['antlr4/src/antlr4/atn'], this['kotlin-kotlin-stdlib'], this['2p-core'], this['2p-parser-js'], this['kt-math']);
31
+ globalThis['2p-parser-core'] = factory(typeof globalThis['2p-parser-core'] === 'undefined' ? {} : globalThis['2p-parser-core'], globalThis['@tuprolog/parser-utils'], antlr4, globalThis['antlr4/src/antlr4/error'], globalThis['antlr4/src/antlr4/atn'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-core'], globalThis['2p-parser-js'], globalThis['kt-math']);
32
32
  }
33
- }(this, function (_, $module$_tuprolog_parser_utils_xy31vy, $module$antlr4, $module$antlr4_src_antlr4_error_s9pni7, $module$antlr4_src_antlr4_atn_66gh9q, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_parser_js, kotlin_io_github_gciatto_kt_math) {
33
+ }(function (_, $module$_tuprolog_parser_utils_xy31vy, $module$antlr4, $module$antlr4_src_antlr4_error_s9pni7, $module$antlr4_src_antlr4_atn_66gh9q, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_parser_js, kotlin_io_github_gciatto_kt_math) {
34
34
  'use strict';
35
35
  //region block: imports
36
36
  var PrologParserListener = $module$_tuprolog_parser_utils_xy31vy.PrologParserListener;
@@ -44,27 +44,26 @@
44
44
  var CommonTokenStream = $module$antlr4.CommonTokenStream;
45
45
  var BailErrorStrategy = $module$antlr4_src_antlr4_error_s9pni7.BailErrorStrategy;
46
46
  var PrologParserVisitor = $module$_tuprolog_parser_utils_xy31vy.PrologParserVisitor;
47
- var VOID = kotlin_kotlin.$_$.d;
48
- var captureStack = kotlin_kotlin.$_$.a5;
49
- var protoOf = kotlin_kotlin.$_$.b6;
50
- var classMeta = kotlin_kotlin.$_$.f5;
51
- var setMetadataFor = kotlin_kotlin.$_$.c6;
47
+ var VOID = kotlin_kotlin.$_$.b;
48
+ var captureStack = kotlin_kotlin.$_$.j5;
49
+ var protoOf = kotlin_kotlin.$_$.m6;
50
+ var initMetadataForClass = kotlin_kotlin.$_$.x5;
52
51
  var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.c1;
53
52
  var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.e;
54
- var ensureNotNull = kotlin_kotlin.$_$.ca;
55
- var replace = kotlin_kotlin.$_$.z8;
56
- var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.f1;
57
- var Char = kotlin_kotlin.$_$.m9;
58
- var toString = kotlin_kotlin.$_$.j1;
53
+ var ensureNotNull = kotlin_kotlin.$_$.pa;
54
+ var replace = kotlin_kotlin.$_$.k9;
55
+ var _Char___init__impl__6a9atx = kotlin_kotlin.$_$.d1;
56
+ var Char = kotlin_kotlin.$_$.z9;
57
+ var toString = kotlin_kotlin.$_$.h1;
59
58
  var Struct = kotlin_it_unibo_tuprolog_core.$_$.s1;
60
- var isInterface = kotlin_kotlin.$_$.r5;
59
+ var isInterface = kotlin_kotlin.$_$.e6;
61
60
  var Numeric = kotlin_it_unibo_tuprolog_core.$_$.o1;
62
61
  var Atom = kotlin_it_unibo_tuprolog_core.$_$.f1;
63
62
  var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.i;
64
63
  var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.t;
65
64
  var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.f;
66
- var objectMeta = kotlin_kotlin.$_$.a6;
67
- var getKClass = kotlin_kotlin.$_$.c;
65
+ var initMetadataForCompanion = kotlin_kotlin.$_$.y5;
66
+ var getKClass = kotlin_kotlin.$_$.e7;
68
67
  var Constant = kotlin_it_unibo_tuprolog_core.$_$.h1;
69
68
  var Var = kotlin_it_unibo_tuprolog_core.$_$.t2;
70
69
  var Integer = kotlin_it_unibo_tuprolog_core.$_$.m1;
@@ -73,58 +72,58 @@
73
72
  var Rule = kotlin_it_unibo_tuprolog_core.$_$.q1;
74
73
  var Fact = kotlin_it_unibo_tuprolog_core.$_$.k1;
75
74
  var Directive = kotlin_it_unibo_tuprolog_core.$_$.j1;
76
- var interfaceMeta = kotlin_kotlin.$_$.o5;
75
+ var initMetadataForInterface = kotlin_kotlin.$_$.z5;
77
76
  var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.m;
78
- var Unit_instance = kotlin_kotlin.$_$.s1;
79
- var THROW_CCE = kotlin_kotlin.$_$.y9;
80
- var contains = kotlin_kotlin.$_$.l2;
77
+ var toString_0 = kotlin_kotlin.$_$.p6;
78
+ var Unit_instance = kotlin_kotlin.$_$.k1;
79
+ var THROW_CCE = kotlin_kotlin.$_$.la;
80
+ var contains = kotlin_kotlin.$_$.d2;
81
81
  var Companion_getInstance_0 = kotlin_it_unibo_tuprolog_core.$_$.j;
82
- var map = kotlin_kotlin.$_$.v7;
82
+ var map = kotlin_kotlin.$_$.f8;
83
83
  var Operator = kotlin_it_unibo_tuprolog_core.$_$.e1;
84
84
  var List = kotlin_it_unibo_tuprolog_core.$_$.n1;
85
- var toString_0 = kotlin_kotlin.$_$.g6;
86
- var coerceAtLeast = kotlin_kotlin.$_$.s6;
85
+ var coerceAtLeast = kotlin_kotlin.$_$.a7;
87
86
  var isRecognitionException = kotlin_it_unibo_tuprolog_parser_js.$_$.b;
88
87
  var isParseCancellationException = kotlin_it_unibo_tuprolog_parser_js.$_$.a;
89
- var generateSequence = kotlin_kotlin.$_$.p7;
90
- var takeWhile = kotlin_kotlin.$_$.f8;
91
- var to = kotlin_kotlin.$_$.la;
88
+ var generateSequence = kotlin_kotlin.$_$.z7;
89
+ var takeWhile = kotlin_kotlin.$_$.q8;
90
+ var to = kotlin_kotlin.$_$.ya;
91
+ var initMetadataForObject = kotlin_kotlin.$_$.b6;
92
+ var substring = kotlin_kotlin.$_$.p9;
92
93
  var Companion_getInstance_1 = kotlin_io_github_gciatto_kt_math.$_$.e;
93
- var charSequenceGet = kotlin_kotlin.$_$.d5;
94
- var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.i1;
95
- var contains_0 = kotlin_kotlin.$_$.r8;
96
- var plus = kotlin_kotlin.$_$.ga;
97
- var ArrayList_init_$Create$ = kotlin_kotlin.$_$.e;
98
- var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.v;
99
- var listOf = kotlin_kotlin.$_$.j3;
100
- var asList = kotlin_kotlin.$_$.d2;
101
- var plus_0 = kotlin_kotlin.$_$.d4;
102
- var collectionSizeOrDefault = kotlin_kotlin.$_$.j2;
103
- var toList = kotlin_kotlin.$_$.m4;
104
- var flatMap = kotlin_kotlin.$_$.m7;
105
- var asSequence = kotlin_kotlin.$_$.h2;
106
- var toList_0 = kotlin_kotlin.$_$.j8;
107
- var sequenceOf = kotlin_kotlin.$_$.b8;
108
- var asSequence_0 = kotlin_kotlin.$_$.i2;
109
- var plus_1 = kotlin_kotlin.$_$.z7;
110
- var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.s;
94
+ var charCodeAt = kotlin_kotlin.$_$.m5;
95
+ var Char__toInt_impl_vasixd = kotlin_kotlin.$_$.g1;
96
+ var contains_0 = kotlin_kotlin.$_$.c9;
97
+ var plus = kotlin_kotlin.$_$.ta;
98
+ var ArrayList_init_$Create$ = kotlin_kotlin.$_$.c;
99
+ var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.t;
100
+ var listOf = kotlin_kotlin.$_$.b3;
101
+ var asList = kotlin_kotlin.$_$.v1;
102
+ var plus_0 = kotlin_kotlin.$_$.v3;
103
+ var collectionSizeOrDefault = kotlin_kotlin.$_$.b2;
104
+ var toList = kotlin_kotlin.$_$.e4;
105
+ var flatMap = kotlin_kotlin.$_$.w7;
106
+ var asSequence = kotlin_kotlin.$_$.z1;
107
+ var toList_0 = kotlin_kotlin.$_$.u8;
108
+ var sequenceOf = kotlin_kotlin.$_$.m8;
109
+ var asSequence_0 = kotlin_kotlin.$_$.a2;
110
+ var plus_1 = kotlin_kotlin.$_$.j8;
111
+ var IllegalArgumentException_init_$Create$ = kotlin_kotlin.$_$.q;
111
112
  var Term = kotlin_it_unibo_tuprolog_core.$_$.r2;
112
113
  var Companion_getInstance_2 = kotlin_it_unibo_tuprolog_core.$_$.o;
113
114
  var Companion_getInstance_3 = kotlin_it_unibo_tuprolog_core.$_$.r;
114
- var NumberFormatException = kotlin_kotlin.$_$.v9;
115
+ var NumberFormatException = kotlin_kotlin.$_$.ia;
115
116
  //endregion
116
117
  //region block: pre-declaration
117
- setMetadataFor(ParseException, 'ParseException', classMeta, TuPrologException);
118
- setMetadataFor(InvalidTermTypeException, 'InvalidTermTypeException', classMeta, ParseException);
119
- setMetadataFor(Companion, 'Companion', objectMeta);
118
+ initMetadataForClass(ParseException, 'ParseException', VOID, TuPrologException);
119
+ initMetadataForClass(InvalidTermTypeException, 'InvalidTermTypeException', VOID, ParseException);
120
+ initMetadataForCompanion(Companion);
120
121
  function parseTerm(input) {
121
- return this.parseTermWithOperators(input, this.h39());
122
+ return this.parseTermWithOperators(input, this.t37());
122
123
  }
123
124
  function parseStructWithOperators(input, operators) {
124
125
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
125
126
  // Inline function 'kotlin.let' call
126
- // Inline function 'kotlin.contracts.contract' call
127
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
128
127
  var it = this.parseTermWithOperators(input, operators);
129
128
  var tmp0_elvis_lhs = isInterface(it, Struct) ? it : null;
130
129
  var tmp;
@@ -136,13 +135,11 @@
136
135
  return tmp;
137
136
  }
138
137
  function parseStruct(input) {
139
- return this.parseStructWithOperators(input, this.h39());
138
+ return this.parseStructWithOperators(input, this.t37());
140
139
  }
141
140
  function parseConstantWithOperators(input, operators) {
142
141
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
143
142
  // Inline function 'kotlin.let' call
144
- // Inline function 'kotlin.contracts.contract' call
145
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
146
143
  var it = this.parseTermWithOperators(input, operators);
147
144
  var tmp0_elvis_lhs = isInterface(it, Constant) ? it : null;
148
145
  var tmp;
@@ -154,13 +151,11 @@
154
151
  return tmp;
155
152
  }
156
153
  function parseConstant(input) {
157
- return this.parseConstantWithOperators(input, this.h39());
154
+ return this.parseConstantWithOperators(input, this.t37());
158
155
  }
159
156
  function parseVarWithOperators(input, operators) {
160
157
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
161
158
  // Inline function 'kotlin.let' call
162
- // Inline function 'kotlin.contracts.contract' call
163
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
164
159
  var it = this.parseTermWithOperators(input, operators);
165
160
  var tmp0_elvis_lhs = isInterface(it, Var) ? it : null;
166
161
  var tmp;
@@ -172,13 +167,11 @@
172
167
  return tmp;
173
168
  }
174
169
  function parseVar(input) {
175
- return this.parseVarWithOperators(input, this.h39());
170
+ return this.parseVarWithOperators(input, this.t37());
176
171
  }
177
172
  function parseAtomWithOperators(input, operators) {
178
173
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
179
174
  // Inline function 'kotlin.let' call
180
- // Inline function 'kotlin.contracts.contract' call
181
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
182
175
  var it = this.parseTermWithOperators(input, operators);
183
176
  var tmp0_elvis_lhs = isInterface(it, Atom) ? it : null;
184
177
  var tmp;
@@ -190,13 +183,11 @@
190
183
  return tmp;
191
184
  }
192
185
  function parseAtom(input) {
193
- return this.parseAtomWithOperators(input, this.h39());
186
+ return this.parseAtomWithOperators(input, this.t37());
194
187
  }
195
188
  function parseNumericWithOperators(input, operators) {
196
189
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
197
190
  // Inline function 'kotlin.let' call
198
- // Inline function 'kotlin.contracts.contract' call
199
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
200
191
  var it = this.parseTermWithOperators(input, operators);
201
192
  var tmp0_elvis_lhs = isInterface(it, Numeric) ? it : null;
202
193
  var tmp;
@@ -208,13 +199,11 @@
208
199
  return tmp;
209
200
  }
210
201
  function parseNumeric(input) {
211
- return this.parseNumericWithOperators(input, this.h39());
202
+ return this.parseNumericWithOperators(input, this.t37());
212
203
  }
213
204
  function parseIntegerWithOperators(input, operators) {
214
205
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
215
206
  // Inline function 'kotlin.let' call
216
- // Inline function 'kotlin.contracts.contract' call
217
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
218
207
  var it = this.parseTermWithOperators(input, operators);
219
208
  var tmp0_elvis_lhs = isInterface(it, Integer) ? it : null;
220
209
  var tmp;
@@ -226,13 +215,11 @@
226
215
  return tmp;
227
216
  }
228
217
  function parseInteger(input) {
229
- return this.parseIntegerWithOperators(input, this.h39());
218
+ return this.parseIntegerWithOperators(input, this.t37());
230
219
  }
231
220
  function parseRealWithOperators(input, operators) {
232
221
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
233
222
  // Inline function 'kotlin.let' call
234
- // Inline function 'kotlin.contracts.contract' call
235
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
236
223
  var it = this.parseTermWithOperators(input, operators);
237
224
  var tmp0_elvis_lhs = isInterface(it, Real) ? it : null;
238
225
  var tmp;
@@ -244,13 +231,11 @@
244
231
  return tmp;
245
232
  }
246
233
  function parseReal(input) {
247
- return this.parseRealWithOperators(input, this.h39());
234
+ return this.parseRealWithOperators(input, this.t37());
248
235
  }
249
236
  function parseClauseWithOperators(input, operators) {
250
237
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
251
238
  // Inline function 'kotlin.let' call
252
- // Inline function 'kotlin.contracts.contract' call
253
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
254
239
  var it = this.parseTermWithOperators(input, operators);
255
240
  var tmp0_elvis_lhs = isInterface(it, Clause) ? it : null;
256
241
  var tmp;
@@ -262,13 +247,11 @@
262
247
  return tmp;
263
248
  }
264
249
  function parseClause(input) {
265
- return this.parseClauseWithOperators(input, this.h39());
250
+ return this.parseClauseWithOperators(input, this.t37());
266
251
  }
267
252
  function parseRuleWithOperators(input, operators) {
268
253
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
269
254
  // Inline function 'kotlin.let' call
270
- // Inline function 'kotlin.contracts.contract' call
271
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
272
255
  var it = this.parseTermWithOperators(input, operators);
273
256
  var tmp0_elvis_lhs = isInterface(it, Rule) ? it : null;
274
257
  var tmp;
@@ -280,13 +263,11 @@
280
263
  return tmp;
281
264
  }
282
265
  function parseRule(input) {
283
- return this.parseRuleWithOperators(input, this.h39());
266
+ return this.parseRuleWithOperators(input, this.t37());
284
267
  }
285
268
  function parseFactWithOperators(input, operators) {
286
269
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
287
270
  // Inline function 'kotlin.let' call
288
- // Inline function 'kotlin.contracts.contract' call
289
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
290
271
  var it = this.parseTermWithOperators(input, operators);
291
272
  var tmp0_elvis_lhs = isInterface(it, Fact) ? it : null;
292
273
  var tmp;
@@ -298,13 +279,11 @@
298
279
  return tmp;
299
280
  }
300
281
  function parseFact(input) {
301
- return this.parseFactWithOperators(input, this.h39());
282
+ return this.parseFactWithOperators(input, this.t37());
302
283
  }
303
284
  function parseDirectiveWithOperators(input, operators) {
304
285
  // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
305
286
  // Inline function 'kotlin.let' call
306
- // Inline function 'kotlin.contracts.contract' call
307
- // Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs.<anonymous>' call
308
287
  var it = this.parseTermWithOperators(input, operators);
309
288
  var tmp0_elvis_lhs = isInterface(it, Directive) ? it : null;
310
289
  var tmp;
@@ -316,15 +295,15 @@
316
295
  return tmp;
317
296
  }
318
297
  function parseDirective(input) {
319
- return this.parseDirectiveWithOperators(input, this.h39());
320
- }
321
- setMetadataFor(TermParser, 'TermParser', interfaceMeta);
322
- setMetadataFor(Companion_0, 'Companion', objectMeta);
323
- setMetadataFor(DynamicOpListener, 'DynamicOpListener', classMeta, PrologParserListener);
324
- setMetadataFor(PrologParserFactory$newErrorListener$1, VOID, classMeta);
325
- setMetadataFor(PrologParserFactory, 'PrologParserFactory', objectMeta);
326
- setMetadataFor(PrologVisitor, 'PrologVisitor', classMeta, PrologParserVisitor, VOID, PrologVisitor);
327
- setMetadataFor(TermParserImpl, 'TermParserImpl', classMeta, VOID, [TermParser]);
298
+ return this.parseDirectiveWithOperators(input, this.t37());
299
+ }
300
+ initMetadataForInterface(TermParser, 'TermParser');
301
+ initMetadataForCompanion(Companion_0);
302
+ initMetadataForClass(DynamicOpListener, 'DynamicOpListener', VOID, PrologParserListener);
303
+ initMetadataForClass(PrologParserFactory$newErrorListener$1);
304
+ initMetadataForObject(PrologParserFactory, 'PrologParserFactory');
305
+ initMetadataForClass(PrologVisitor, 'PrologVisitor', PrologVisitor, PrologParserVisitor);
306
+ initMetadataForClass(TermParserImpl, 'TermParserImpl', VOID, VOID, [TermParser]);
328
307
  //endregion
329
308
  function InvalidTermTypeException(input, term, type, offendingSymbol, line, column, message, throwable) {
330
309
  var tmp;
@@ -337,12 +316,12 @@
337
316
  offendingSymbol = tmp;
338
317
  line = line === VOID ? 1 : line;
339
318
  column = column === VOID ? 1 : column;
340
- message = message === VOID ? 'Expected ' + type.o6() + ', got: ' + offendingSymbol : message;
319
+ message = message === VOID ? 'Expected ' + type.b9() + ', got: ' + offendingSymbol : message;
341
320
  throwable = throwable === VOID ? null : throwable;
342
321
  ParseException.call(this, input, offendingSymbol, line, column, message, throwable);
343
322
  captureStack(this, InvalidTermTypeException);
344
- this.q38_1 = term;
345
- this.r38_1 = type;
323
+ this.c37_1 = term;
324
+ this.d37_1 = type;
346
325
  }
347
326
  function ParseException(input, offendingSymbol, line, column, message, throwable) {
348
327
  TuPrologException_init_$Init$(message, throwable, this);
@@ -353,34 +332,34 @@
353
332
  this.column = column;
354
333
  this.clauseIndex = -1;
355
334
  }
356
- protoOf(ParseException).s38 = function (_set____db54di) {
335
+ protoOf(ParseException).e37 = function (_set____db54di) {
357
336
  this.input = _set____db54di;
358
337
  };
359
- protoOf(ParseException).t38 = function () {
338
+ protoOf(ParseException).f37 = function () {
360
339
  return this.input;
361
340
  };
362
- protoOf(ParseException).u38 = function (_set____db54di) {
341
+ protoOf(ParseException).g37 = function (_set____db54di) {
363
342
  this.offendingSymbol = _set____db54di;
364
343
  };
365
- protoOf(ParseException).v38 = function () {
344
+ protoOf(ParseException).h37 = function () {
366
345
  return this.offendingSymbol;
367
346
  };
368
- protoOf(ParseException).w38 = function (_set____db54di) {
347
+ protoOf(ParseException).i37 = function (_set____db54di) {
369
348
  this.line = _set____db54di;
370
349
  };
371
- protoOf(ParseException).x38 = function () {
350
+ protoOf(ParseException).j37 = function () {
372
351
  return this.line;
373
352
  };
374
- protoOf(ParseException).y38 = function (_set____db54di) {
353
+ protoOf(ParseException).k37 = function (_set____db54di) {
375
354
  this.column = _set____db54di;
376
355
  };
377
- protoOf(ParseException).z38 = function () {
356
+ protoOf(ParseException).l37 = function () {
378
357
  return this.column;
379
358
  };
380
- protoOf(ParseException).a39 = function (_set____db54di) {
359
+ protoOf(ParseException).m37 = function (_set____db54di) {
381
360
  this.clauseIndex = _set____db54di;
382
361
  };
383
- protoOf(ParseException).b39 = function () {
362
+ protoOf(ParseException).n37 = function () {
384
363
  return this.clauseIndex;
385
364
  };
386
365
  protoOf(ParseException).toString = function () {
@@ -393,17 +372,17 @@
393
372
  var tmp_2;
394
373
  var tmp_3;
395
374
  if (isInterface(_this__u8e3s4, Struct)) {
396
- tmp_3 = _this__u8e3s4.zu() === 3;
375
+ tmp_3 = _this__u8e3s4.bu() === 3;
397
376
  } else {
398
377
  tmp_3 = false;
399
378
  }
400
379
  if (tmp_3) {
401
- tmp_2 = _this__u8e3s4.fv() === 'op';
380
+ tmp_2 = _this__u8e3s4.hu() === 'op';
402
381
  } else {
403
382
  tmp_2 = false;
404
383
  }
405
384
  if (tmp_2) {
406
- tmp_1 = _this__u8e3s4.jw();
385
+ tmp_1 = _this__u8e3s4.lv();
407
386
  } else {
408
387
  tmp_1 = false;
409
388
  }
@@ -423,40 +402,40 @@
423
402
  }
424
403
  function Companion() {
425
404
  }
426
- protoOf(Companion).c39 = function (scope) {
427
- return this.d39(Companion_getInstance().EMPTY, scope);
405
+ protoOf(Companion).o37 = function (scope) {
406
+ return this.p37(Companion_getInstance().EMPTY, scope);
428
407
  };
429
408
  protoOf(Companion).withNoOperator = function (scope, $super) {
430
409
  scope = scope === VOID ? Companion_instance.empty() : scope;
431
- return $super === VOID ? this.c39(scope) : $super.c39.call(this, scope);
410
+ return $super === VOID ? this.o37(scope) : $super.o37.call(this, scope);
432
411
  };
433
- protoOf(Companion).e39 = function (scope) {
434
- return this.d39(Companion_getInstance().STANDARD, scope);
412
+ protoOf(Companion).q37 = function (scope) {
413
+ return this.p37(Companion_getInstance().STANDARD, scope);
435
414
  };
436
415
  protoOf(Companion).withStandardOperators = function (scope, $super) {
437
416
  scope = scope === VOID ? Companion_instance.empty() : scope;
438
- return $super === VOID ? this.e39(scope) : $super.e39.call(this, scope);
417
+ return $super === VOID ? this.q37(scope) : $super.q37.call(this, scope);
439
418
  };
440
- protoOf(Companion).f39 = function (scope) {
441
- return this.d39(Companion_getInstance().DEFAULT, scope);
419
+ protoOf(Companion).r37 = function (scope) {
420
+ return this.p37(Companion_getInstance().DEFAULT, scope);
442
421
  };
443
422
  protoOf(Companion).withDefaultOperators = function (scope, $super) {
444
423
  scope = scope === VOID ? Companion_instance.empty() : scope;
445
- return $super === VOID ? this.f39(scope) : $super.f39.call(this, scope);
424
+ return $super === VOID ? this.r37(scope) : $super.r37.call(this, scope);
446
425
  };
447
- protoOf(Companion).d39 = function (operators, scope) {
426
+ protoOf(Companion).p37 = function (operators, scope) {
448
427
  return termParserWithOperators(operators, scope);
449
428
  };
450
429
  protoOf(Companion).withOperatorSet = function (operators, scope, $super) {
451
430
  scope = scope === VOID ? Companion_instance.empty() : scope;
452
- return $super === VOID ? this.d39(operators, scope) : $super.d39.call(this, operators, scope);
431
+ return $super === VOID ? this.p37(operators, scope) : $super.p37.call(this, operators, scope);
453
432
  };
454
- protoOf(Companion).g39 = function (operators, scope) {
455
- return this.d39(OperatorSet_init_$Create$(operators.slice()), scope);
433
+ protoOf(Companion).s37 = function (operators, scope) {
434
+ return this.p37(OperatorSet_init_$Create$(operators.slice()), scope);
456
435
  };
457
436
  protoOf(Companion).withOperators = function (operators, scope, $super) {
458
437
  scope = scope === VOID ? Companion_instance.empty() : scope;
459
- return $super === VOID ? this.g39(operators, scope) : $super.g39.call(this, operators, scope);
438
+ return $super === VOID ? this.s37(operators, scope) : $super.s37.call(this, operators, scope);
460
439
  };
461
440
  var Companion_instance_1;
462
441
  function Companion_getInstance_4() {
@@ -496,18 +475,18 @@
496
475
  return get_defaultParser().parseClause(input);
497
476
  }
498
477
  function toAssociativity(_this__u8e3s4) {
499
- return _this__u8e3s4.toString();
478
+ return toString_0(_this__u8e3s4);
500
479
  }
501
- function DynamicOpListener$Companion$of$lambda($this$$receiver, it) {
480
+ function DynamicOpListener$Companion$of$lambda($this$DynamicOpListener, it) {
502
481
  return Unit_instance;
503
482
  }
504
483
  function onOperatorDefined($this, operator) {
505
- $this.i39_1.addOperator(operator.g1h_1, toAssociativity(operator.h1h_1), operator.i1h_1);
506
- $this.j39_1($this.i39_1, operator);
484
+ $this.u37_1.addOperator(operator.h1g_1, toAssociativity(operator.i1g_1), operator.j1g_1);
485
+ $this.v37_1($this.u37_1, operator);
507
486
  }
508
487
  function Companion_0() {
509
488
  }
510
- protoOf(Companion_0).k39 = function (parser) {
489
+ protoOf(Companion_0).w37 = function (parser) {
511
490
  return new DynamicOpListener(parser, DynamicOpListener$Companion$of$lambda);
512
491
  };
513
492
  var Companion_instance_2;
@@ -519,10 +498,10 @@
519
498
  }
520
499
  function DynamicOpListener(parser, operatorDefinedCallback) {
521
500
  PrologParserListener.call(this);
522
- this.i39_1 = parser;
523
- this.j39_1 = operatorDefinedCallback;
501
+ this.u37_1 = parser;
502
+ this.v37_1 = operatorDefinedCallback;
524
503
  }
525
- protoOf(DynamicOpListener).l39 = function (ctx) {
504
+ protoOf(DynamicOpListener).x37 = function (ctx) {
526
505
  var expr = ctx.expression();
527
506
  if (ctx.exception != null) {
528
507
  return Unit_instance;
@@ -544,27 +523,27 @@
544
523
  if (tmp) {
545
524
  var tmp_1 = ctx.accept(new PrologVisitor());
546
525
  var directive = isInterface(tmp_1, Directive) ? tmp_1 : THROW_CCE();
547
- var op = directive.mx();
526
+ var op = directive.ow();
548
527
  if (get_isOpDirective(op)) {
549
- // Inline function 'kotlin.math.min' call
550
- // Inline function 'kotlin.math.max' call
551
528
  var tmp_2 = (isInterface(op, Struct) ? op : THROW_CCE()).get(0);
552
- var b = (isInterface(tmp_2, Numeric) ? tmp_2 : THROW_CCE()).nz().toInt();
529
+ // Inline function 'kotlin.math.max' call
530
+ var b = (isInterface(tmp_2, Numeric) ? tmp_2 : THROW_CCE()).py().toInt();
531
+ // Inline function 'kotlin.math.min' call
553
532
  var b_0 = Math.max(0, b);
554
533
  var priority = Math.min(1200, b_0);
555
534
  var specifier = Companion_getInstance_0().fromTerm(op.get(1));
556
535
  var operator = op.get(2);
557
536
  if (isInterface(operator, Atom)) {
558
- onOperatorDefined(this, new Operator(operator.r2(), specifier, priority));
537
+ onOperatorDefined(this, new Operator(operator.e2(), specifier, priority));
559
538
  } else {
560
539
  if (isInterface(operator, List)) {
540
+ var tmp0 = operator.xs();
561
541
  var tmp$ret$3;
562
542
  $l$block: {
563
543
  // Inline function 'kotlin.sequences.all' call
564
- var tmp0_iterator = operator.vt().r();
565
- while (tmp0_iterator.s()) {
566
- var element = tmp0_iterator.u();
567
- // Inline function 'it.unibo.tuprolog.core.parsing.DynamicOpListener.exitClause.<anonymous>' call
544
+ var _iterator__ex2g4s = tmp0.p();
545
+ while (_iterator__ex2g4s.s()) {
546
+ var element = _iterator__ex2g4s.t();
568
547
  if (!isInterface(element, Atom)) {
569
548
  tmp$ret$3 = false;
570
549
  break $l$block;
@@ -573,11 +552,11 @@
573
552
  tmp$ret$3 = true;
574
553
  }
575
554
  if (tmp$ret$3) {
576
- var tmp_3 = operator.vt();
577
- var tmp2_iterator = map(tmp_3, DynamicOpListener$exitClause$lambda).r();
578
- while (tmp2_iterator.s()) {
579
- var it = tmp2_iterator.u();
580
- onOperatorDefined(this, new Operator(it.r2(), specifier, priority));
555
+ var tmp_3 = operator.xs();
556
+ var _iterator__ex2g4s_0 = map(tmp_3, DynamicOpListener$exitClause$lambda).p();
557
+ while (_iterator__ex2g4s_0.s()) {
558
+ var it = _iterator__ex2g4s_0.t();
559
+ onOperatorDefined(this, new Operator(it.e2(), specifier, priority));
581
560
  }
582
561
  }
583
562
  }
@@ -586,7 +565,7 @@
586
565
  }
587
566
  };
588
567
  protoOf(DynamicOpListener).exitClause = function (ctx) {
589
- return this.l39(ctx);
568
+ return this.x37(ctx);
590
569
  };
591
570
  function parseException(token, message) {
592
571
  return new ParseException(null, token.text, token.line, token.column, message, null);
@@ -606,7 +585,7 @@
606
585
  function parseExpression($this, parserAndErrorStrategy, source) {
607
586
  var mark = -1;
608
587
  var index = -1;
609
- var parser = parserAndErrorStrategy.qd_1;
588
+ var parser = parserAndErrorStrategy.fc_1;
610
589
  var tmp;
611
590
  try {
612
591
  mark = parser.getTokenStream().mark();
@@ -616,13 +595,13 @@
616
595
  var tmp_0;
617
596
  var e = $p;
618
597
  var tmp_1;
619
- if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
598
+ if (isParseCancellationException(e) && parser._interp.predictionMode === PredictionMode.SLL) {
620
599
  parser.getTokenStream().seek(index);
621
600
  parser._interp.predictionMode = PredictionMode.LL;
622
- parser._errHandler = parserAndErrorStrategy.rd_1;
601
+ parser._errHandler = parserAndErrorStrategy.gc_1;
623
602
  parser.addErrorListener(newErrorListener($this, source));
624
603
  tmp_1 = parseExpression($this, parserAndErrorStrategy, source);
625
- } else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
604
+ } else if (e.clause !== null && isRecognitionException(e.cause)) {
626
605
  var tmp_2 = e.cause;
627
606
  throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
628
607
  } else {
@@ -639,7 +618,7 @@
639
618
  function parseClause_1($this, parserAndErrorStrategy, source) {
640
619
  var mark = -1;
641
620
  var index = -1;
642
- var parser = parserAndErrorStrategy.qd_1;
621
+ var parser = parserAndErrorStrategy.fc_1;
643
622
  var tmp;
644
623
  try {
645
624
  mark = parser.getTokenStream().mark();
@@ -649,13 +628,13 @@
649
628
  var tmp_0;
650
629
  var e = $p;
651
630
  var tmp_1;
652
- if (isParseCancellationException(e) ? parser._interp.predictionMode === PredictionMode.SLL : false) {
631
+ if (isParseCancellationException(e) && parser._interp.predictionMode === PredictionMode.SLL) {
653
632
  parser.getTokenStream().seek(index);
654
633
  parser._interp.predictionMode = PredictionMode.LL;
655
- parser._errHandler = parserAndErrorStrategy.rd_1;
634
+ parser._errHandler = parserAndErrorStrategy.gc_1;
656
635
  parser.addErrorListener(newErrorListener($this, source));
657
636
  tmp_1 = parseClause_1($this, parserAndErrorStrategy, source);
658
- } else if (e.clause !== null ? isRecognitionException(e.cause) : false) {
637
+ } else if (e.clause !== null && isRecognitionException(e.cause)) {
659
638
  var tmp_2 = e.cause;
660
639
  throw tmp_2 instanceof RecognitionException ? tmp_2 : THROW_CCE();
661
640
  } else {
@@ -676,13 +655,13 @@
676
655
  return map(tmp_1, PrologParserFactory$parseClauses$lambda_2);
677
656
  }
678
657
  function PrologParserFactory$newErrorListener$1($whileParsing) {
679
- this.m39_1 = $whileParsing;
658
+ this.y37_1 = $whileParsing;
680
659
  }
681
660
  protoOf(PrologParserFactory$newErrorListener$1).syntaxError = function (recognizer, offendingSymbol, line, column, msg, e) {
682
661
  if (recognizer instanceof PrologParser) {
683
662
  recognizer.removeParseListeners();
684
663
  }
685
- throw new ParseException(this.m39_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
664
+ throw new ParseException(this.y37_1, symbolToString(this, offendingSymbol), line, column + 1 | 0, msg, e);
686
665
  };
687
666
  function PrologParserFactory$parseClauses$lambda(it) {
688
667
  return it + 1 | 0;
@@ -713,15 +692,15 @@
713
692
  }
714
693
  function PrologParserFactory() {
715
694
  }
716
- protoOf(PrologParserFactory).n39 = function (string, withOperators) {
717
- var parser = this.o39(string, withOperators);
695
+ protoOf(PrologParserFactory).z37 = function (string, withOperators) {
696
+ var parser = this.a38(string, withOperators);
718
697
  return parseExpression(this, parser, string);
719
698
  };
720
- protoOf(PrologParserFactory).p39 = function (source, withOperators) {
721
- var parser = this.o39(source, withOperators);
699
+ protoOf(PrologParserFactory).b38 = function (source, withOperators) {
700
+ var parser = this.a38(source, withOperators);
722
701
  return parseClauses(this, parser, source);
723
702
  };
724
- protoOf(PrologParserFactory).o39 = function (source, operators) {
703
+ protoOf(PrologParserFactory).a38 = function (source, operators) {
725
704
  var stream = new InputStream(source);
726
705
  var lexer = new PrologLexer(stream);
727
706
  lexer.removeErrorListeners();
@@ -731,17 +710,16 @@
731
710
  var originalErrorStrategy = parser._errHandler;
732
711
  parser._errHandler = new BailErrorStrategy();
733
712
  parser._interp.predictionMode = PredictionMode.SLL;
734
- return to(this.q39(parser, operators), originalErrorStrategy);
713
+ return to(this.c38(parser, operators), originalErrorStrategy);
735
714
  };
736
- protoOf(PrologParserFactory).q39 = function (prologParser, operators) {
715
+ protoOf(PrologParserFactory).c38 = function (prologParser, operators) {
737
716
  // Inline function 'kotlin.collections.forEach' call
738
- var tmp0_iterator = operators.r();
739
- while (tmp0_iterator.s()) {
740
- var element = tmp0_iterator.u();
741
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologParserFactory.addOperators.<anonymous>' call
742
- prologParser.addOperator(element.g1h_1, toAssociativity(element.h1h_1), element.i1h_1);
717
+ var _iterator__ex2g4s = operators.p();
718
+ while (_iterator__ex2g4s.s()) {
719
+ var element = _iterator__ex2g4s.t();
720
+ prologParser.addOperator(element.h1g_1, toAssociativity(element.i1g_1), element.j1g_1);
743
721
  }
744
- prologParser.addParseListener(Companion_instance_2.k39(prologParser));
722
+ prologParser.addParseListener(Companion_instance_2.w37(prologParser));
745
723
  return prologParser;
746
724
  };
747
725
  var PrologParserFactory_instance;
@@ -754,34 +732,24 @@
754
732
  var clean;
755
733
  if (ctx.isBin) {
756
734
  base = 2;
757
- // Inline function 'kotlin.text.substring' call
758
- // Inline function 'kotlin.js.asDynamic' call
759
- clean = str.substring(2);
735
+ clean = substring(str, 2);
760
736
  } else if (ctx.isOct) {
761
737
  base = 8;
762
- // Inline function 'kotlin.text.substring' call
763
- // Inline function 'kotlin.js.asDynamic' call
764
- clean = str.substring(2);
738
+ clean = substring(str, 2);
765
739
  } else if (ctx.isHex) {
766
740
  base = 16;
767
- // Inline function 'kotlin.text.substring' call
768
- // Inline function 'kotlin.js.asDynamic' call
769
- clean = str.substring(2);
741
+ clean = substring(str, 2);
770
742
  } else if (ctx.isChar) {
771
- // Inline function 'kotlin.text.substring' call
772
- // Inline function 'kotlin.js.asDynamic' call
773
- clean = str.substring(2);
743
+ clean = substring(str, 2);
774
744
  if (!(clean.length === 1)) {
775
745
  throw parseException(ctx.value, 'Invalid character literal: ' + ctx.value.text);
776
746
  }
777
- // Inline function 'kotlin.with' call
778
747
  var tmp = Companion_getInstance_1();
779
748
  // Inline function 'kotlin.code' call
780
- var this_0 = charSequenceGet(clean, 0);
781
- var tmp$ret$8 = Char__toInt_impl_vasixd(this_0);
782
- // Inline function 'kotlin.contracts.contract' call
783
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.parseInteger.<anonymous>' call
784
- var $this$with = tmp.of(tmp$ret$8);
749
+ var this_0 = charCodeAt(clean, 0);
750
+ var tmp$ret$0 = Char__toInt_impl_vasixd(this_0);
751
+ // Inline function 'kotlin.with' call
752
+ var $this$with = tmp.of(tmp$ret$0);
785
753
  var tmp_0;
786
754
  var tmp0_safe_receiver = ctx.sign;
787
755
  var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.text;
@@ -814,17 +782,16 @@
814
782
  while (inductionVariable < last) {
815
783
  var item = this_0[inductionVariable];
816
784
  inductionVariable = inductionVariable + 1 | 0;
817
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPostfixExpression.<anonymous>' call
818
785
  var tmp$ret$0 = item.symbol.text;
819
- destination.o(tmp$ret$0);
786
+ destination.m(tmp$ret$0);
820
787
  }
821
788
  return postfix($this, tmp, destination);
822
789
  }
823
790
  function postfix($this, term, ops) {
824
- var operator = ops.r();
825
- var result = $this.r39_1.structOf(operator.u(), [term]);
791
+ var operator = ops.p();
792
+ var result = $this.d38_1.structOf(operator.t(), [term]);
826
793
  while (operator.s()) {
827
- result = $this.r39_1.structOf(operator.u(), [result]);
794
+ result = $this.d38_1.structOf(operator.t(), [result]);
828
795
  }
829
796
  return result;
830
797
  }
@@ -839,19 +806,18 @@
839
806
  while (inductionVariable < last) {
840
807
  var item = this_0[inductionVariable];
841
808
  inductionVariable = inductionVariable + 1 | 0;
842
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitPrefixExpression.<anonymous>' call
843
809
  var tmp$ret$0 = item.symbol.text;
844
- destination.o(tmp$ret$0);
810
+ destination.m(tmp$ret$0);
845
811
  }
846
812
  return prefix($this, tmp, destination);
847
813
  }
848
814
  function prefix($this, term, ops) {
849
- var i = ops.l() - 1 | 0;
850
- var tmp0 = i;
851
- i = tmp0 - 1 | 0;
852
- var result = $this.r39_1.structOf(ops.d1(tmp0), [term]);
815
+ var i = ops.v() - 1 | 0;
816
+ var _unary__edvuaz = i;
817
+ i = _unary__edvuaz - 1 | 0;
818
+ var result = $this.d38_1.structOf(ops.w(_unary__edvuaz), [term]);
853
819
  while (i >= 0) {
854
- result = $this.r39_1.structOf(ops.d1(i), [result]);
820
+ result = $this.d38_1.structOf(ops.w(i), [result]);
855
821
  i = i - 1 | 0;
856
822
  }
857
823
  return result;
@@ -876,12 +842,11 @@
876
842
  var this_0 = plus_0(listOf(ensureNotNull(ctx.left)), asList(ctx.right));
877
843
  // Inline function 'kotlin.collections.mapTo' call
878
844
  var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
879
- var tmp0_iterator = this_0.r();
880
- while (tmp0_iterator.s()) {
881
- var item = tmp0_iterator.u();
882
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
845
+ var _iterator__ex2g4s = this_0.p();
846
+ while (_iterator__ex2g4s.s()) {
847
+ var item = _iterator__ex2g4s.t();
883
848
  var tmp$ret$0 = item.accept($this);
884
- destination.o(tmp$ret$0);
849
+ destination.m(tmp$ret$0);
885
850
  }
886
851
  var operands = destination;
887
852
  // Inline function 'kotlin.collections.map' call
@@ -893,21 +858,20 @@
893
858
  while (inductionVariable < last) {
894
859
  var item_0 = this_1[inductionVariable];
895
860
  inductionVariable = inductionVariable + 1 | 0;
896
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.visitInfixNonAssociativeExpression.<anonymous>' call
897
861
  var tmp$ret$3 = item_0.symbol.text;
898
- destination_0.o(tmp$ret$3);
862
+ destination_0.m(tmp$ret$3);
899
863
  }
900
864
  var operators = destination_0;
901
865
  return infixNonAssociative($this, operands, operators);
902
866
  }
903
867
  function infixNonAssociative($this, terms, ops) {
904
- return $this.r39_1.structOf(ops.d1(0), [terms.d1(0), terms.d1(1)]);
868
+ return $this.d38_1.structOf(ops.w(0), [terms.w(0), terms.w(1)]);
905
869
  }
906
870
  function handleOuters($this, expression, outers) {
907
871
  var result = expression;
908
- var tmp0_iterator = outers.r();
909
- while (tmp0_iterator.s()) {
910
- var o = tmp0_iterator.u();
872
+ var _iterator__ex2g4s = outers.p();
873
+ while (_iterator__ex2g4s.s()) {
874
+ var o = _iterator__ex2g4s.t();
911
875
  var tmp = listOf(result);
912
876
  // Inline function 'kotlin.collections.map' call
913
877
  var this_0 = o.right;
@@ -918,9 +882,8 @@
918
882
  while (inductionVariable < last) {
919
883
  var item = this_0[inductionVariable];
920
884
  inductionVariable = inductionVariable + 1 | 0;
921
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
922
885
  var tmp$ret$0 = item.accept($this);
923
- destination.o(tmp$ret$0);
886
+ destination.m(tmp$ret$0);
924
887
  }
925
888
  var operands = plus_0(tmp, destination);
926
889
  // Inline function 'kotlin.collections.map' call
@@ -932,22 +895,21 @@
932
895
  while (inductionVariable_0 < last_0) {
933
896
  var item_0 = this_1[inductionVariable_0];
934
897
  inductionVariable_0 = inductionVariable_0 + 1 | 0;
935
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.handleOuters.<anonymous>' call
936
898
  var tmp$ret$3 = item_0.symbol.text;
937
- destination_0.o(tmp$ret$3);
899
+ destination_0.m(tmp$ret$3);
938
900
  }
939
901
  var operators = destination_0;
940
902
  var associativity = o.associativity;
941
903
  var tmp_0;
942
904
  if (associativity === Associativity.XFY) {
943
905
  tmp_0 = infixRight($this, operands, operators);
944
- } else if (associativity === Associativity.XF ? true : associativity === Associativity.YF) {
906
+ } else if (associativity === Associativity.XF || associativity === Associativity.YF) {
945
907
  tmp_0 = postfix($this, result, operators);
946
908
  } else if (associativity === Associativity.XFX) {
947
909
  tmp_0 = infixNonAssociative($this, operands, operators);
948
910
  } else if (associativity === Associativity.YFX) {
949
911
  tmp_0 = infixLeft($this, operands, operators);
950
- } else if (associativity === Associativity.FX ? true : associativity === Associativity.FY) {
912
+ } else if (associativity === Associativity.FX || associativity === Associativity.FY) {
951
913
  tmp_0 = prefix($this, result, operators);
952
914
  } else {
953
915
  var message = 'Invalid associativity: ' + associativity;
@@ -958,16 +920,16 @@
958
920
  return result;
959
921
  }
960
922
  function infixRight($this, terms, ops) {
961
- var i = terms.l() - 1 | 0;
962
- var j = ops.l() - 1 | 0;
963
- var tmp0 = j;
964
- j = tmp0 - 1 | 0;
965
- var result = $this.r39_1.structOf(ops.d1(tmp0), [terms.d1(i - 1 | 0), terms.d1(i)]);
923
+ var i = terms.v() - 1 | 0;
924
+ var j = ops.v() - 1 | 0;
925
+ var _unary__edvuaz = j;
926
+ j = _unary__edvuaz - 1 | 0;
927
+ var result = $this.d38_1.structOf(ops.w(_unary__edvuaz), [terms.w(i - 1 | 0), terms.w(i)]);
966
928
  i = i - 2 | 0;
967
929
  while (i >= 0) {
968
- var tmp1 = j;
969
- j = tmp1 - 1 | 0;
970
- result = $this.r39_1.structOf(ops.d1(tmp1), [terms.d1(i), result]);
930
+ var _unary__edvuaz_0 = j;
931
+ j = _unary__edvuaz_0 - 1 | 0;
932
+ result = $this.d38_1.structOf(ops.w(_unary__edvuaz_0), [terms.w(i), result]);
971
933
  i = i - 1 | 0;
972
934
  }
973
935
  return result;
@@ -975,19 +937,19 @@
975
937
  function infixLeft($this, terms, ops) {
976
938
  var i = 0;
977
939
  var j = 0;
978
- var tmp0 = j;
979
- j = tmp0 + 1 | 0;
980
- var tmp = ops.d1(tmp0);
981
- var tmp1 = i;
982
- i = tmp1 + 1 | 0;
983
- var tmp_0 = terms.d1(tmp1);
984
- var tmp2 = i;
985
- i = tmp2 + 1 | 0;
986
- var result = $this.r39_1.structOf(tmp, [tmp_0, terms.d1(tmp2)]);
987
- while (i < terms.l()) {
988
- var tmp3 = j;
989
- j = tmp3 + 1 | 0;
990
- result = $this.r39_1.structOf(ops.d1(tmp3), [result, terms.d1(i)]);
940
+ var _unary__edvuaz = j;
941
+ j = _unary__edvuaz + 1 | 0;
942
+ var tmp = ops.w(_unary__edvuaz);
943
+ var _unary__edvuaz_0 = i;
944
+ i = _unary__edvuaz_0 + 1 | 0;
945
+ var tmp_0 = terms.w(_unary__edvuaz_0);
946
+ var _unary__edvuaz_1 = i;
947
+ i = _unary__edvuaz_1 + 1 | 0;
948
+ var result = $this.d38_1.structOf(tmp, [tmp_0, terms.w(_unary__edvuaz_1)]);
949
+ while (i < terms.v()) {
950
+ var _unary__edvuaz_2 = j;
951
+ j = _unary__edvuaz_2 + 1 | 0;
952
+ result = $this.d38_1.structOf(ops.w(_unary__edvuaz_2), [result, terms.w(i)]);
991
953
  i = i + 1 | 0;
992
954
  }
993
955
  return result;
@@ -997,12 +959,11 @@
997
959
  var this_0 = plus_0(listOf(ctx.left), toList(ctx.right));
998
960
  // Inline function 'kotlin.collections.mapTo' call
999
961
  var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
1000
- var tmp0_iterator = this_0.r();
1001
- while (tmp0_iterator.s()) {
1002
- var item = tmp0_iterator.u();
1003
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperands.<anonymous>' call
962
+ var _iterator__ex2g4s = this_0.p();
963
+ while (_iterator__ex2g4s.s()) {
964
+ var item = _iterator__ex2g4s.t();
1004
965
  var tmp$ret$0 = ensureNotNull(item).accept($this);
1005
- destination.o(tmp$ret$0);
966
+ destination.m(tmp$ret$0);
1006
967
  }
1007
968
  return destination;
1008
969
  }
@@ -1016,9 +977,8 @@
1016
977
  while (inductionVariable < last) {
1017
978
  var item = this_0[inductionVariable];
1018
979
  inductionVariable = inductionVariable + 1 | 0;
1019
- // Inline function 'it.unibo.tuprolog.core.parsing.PrologVisitor.listOfOperators.<anonymous>' call
1020
980
  var tmp$ret$0 = item.symbol.text;
1021
- destination.o(tmp$ret$0);
981
+ destination.m(tmp$ret$0);
1022
982
  }
1023
983
  return destination;
1024
984
  }
@@ -1036,45 +996,45 @@
1036
996
  function flatten_0($this, outers) {
1037
997
  return toList_0(flatten($this, asSequence(outers)));
1038
998
  }
1039
- function PrologVisitor$visitExpression$ref($boundThis) {
1040
- var l = function (p0) {
1041
- return $boundThis.s39(p0);
999
+ function PrologVisitor$visitExpression$ref(p0) {
1000
+ var l = function (_this__u8e3s4) {
1001
+ return p0.e38(_this__u8e3s4);
1042
1002
  };
1043
1003
  l.callableName = 'visitExpression';
1044
1004
  return l;
1045
1005
  }
1046
1006
  function PrologVisitor$flatten$lambda(this$0) {
1047
1007
  return function (it) {
1048
- return plus_1(sequenceOf([it]), flatten(this$0, asSequence_0(it.outers)));
1008
+ return plus_1(sequenceOf(it), flatten(this$0, asSequence_0(it.outers)));
1049
1009
  };
1050
1010
  }
1051
1011
  function PrologVisitor(scope) {
1052
1012
  scope = scope === VOID ? Companion_instance.empty() : scope;
1053
1013
  PrologParserVisitor.call(this);
1054
- this.r39_1 = scope;
1014
+ this.d38_1 = scope;
1055
1015
  }
1056
- protoOf(PrologVisitor).t39 = function (ctx) {
1057
- return this.u39(ctx.term());
1016
+ protoOf(PrologVisitor).f38 = function (ctx) {
1017
+ return this.g38(ctx.term());
1058
1018
  };
1059
1019
  protoOf(PrologVisitor).visitSingletonTerm = function (ctx) {
1060
- return this.t39(ctx);
1020
+ return this.f38(ctx);
1061
1021
  };
1062
- protoOf(PrologVisitor).v39 = function (ctx) {
1063
- return this.s39(ctx.expression());
1022
+ protoOf(PrologVisitor).h38 = function (ctx) {
1023
+ return this.e38(ctx.expression());
1064
1024
  };
1065
1025
  protoOf(PrologVisitor).visitSingletonExpression = function (ctx) {
1066
- return this.v39(ctx);
1026
+ return this.h38(ctx);
1067
1027
  };
1068
- protoOf(PrologVisitor).w39 = function (ctx) {
1028
+ protoOf(PrologVisitor).i38 = function (ctx) {
1069
1029
  return termToClause(ctx.expression().accept(this), null, ensureNotNull(ctx.start).line, ensureNotNull(ctx.start).column);
1070
1030
  };
1071
1031
  protoOf(PrologVisitor).visitClause = function (ctx) {
1072
- return this.w39(ctx);
1032
+ return this.i38(ctx);
1073
1033
  };
1074
- protoOf(PrologVisitor).s39 = function (ctx) {
1034
+ protoOf(PrologVisitor).e38 = function (ctx) {
1075
1035
  var tmp;
1076
1036
  if (ctx.isTerm) {
1077
- tmp = this.u39(ensureNotNull(ctx.left));
1037
+ tmp = this.g38(ensureNotNull(ctx.left));
1078
1038
  } else if (contains(Associativity.INFIX, ctx.associativity)) {
1079
1039
  tmp = visitInfixExpression(this, ctx);
1080
1040
  } else if (contains(Associativity.POSTFIX, ctx.associativity)) {
@@ -1082,17 +1042,17 @@
1082
1042
  } else if (contains(Associativity.PREFIX, ctx.associativity)) {
1083
1043
  tmp = visitPrefixExpression(this, ctx);
1084
1044
  } else {
1085
- throw IllegalArgumentException_init_$Create$('Associativity unknown: ' + ctx.associativity + ' INFIX=' + Associativity.INFIX + ' PREFIX=' + Associativity.PREFIX + ' POSTFIX=' + Associativity.POSTFIX);
1045
+ throw IllegalArgumentException_init_$Create$('Associativity unknown: ' + ctx.associativity + ' INFIX=' + toString_0(Associativity.INFIX) + ' PREFIX=' + toString_0(Associativity.PREFIX) + ' POSTFIX=' + toString_0(Associativity.POSTFIX));
1086
1046
  }
1087
1047
  return handleOuters(this, tmp, flatten_0(this, asList(ctx.outers)));
1088
1048
  };
1089
1049
  protoOf(PrologVisitor).visitExpression = function (ctx) {
1090
- return this.s39(ctx);
1050
+ return this.e38(ctx);
1091
1051
  };
1092
- protoOf(PrologVisitor).u39 = function (ctx) {
1052
+ protoOf(PrologVisitor).g38 = function (ctx) {
1093
1053
  var tmp;
1094
1054
  if (ctx.isExpr) {
1095
- tmp = this.s39(ctx.expression());
1055
+ tmp = this.e38(ctx.expression());
1096
1056
  } else {
1097
1057
  var tmp_0 = ctx.children[0].accept(this);
1098
1058
  tmp = (!(tmp_0 == null) ? isInterface(tmp_0, Term) : false) ? tmp_0 : THROW_CCE();
@@ -1100,23 +1060,23 @@
1100
1060
  return tmp;
1101
1061
  };
1102
1062
  protoOf(PrologVisitor).visitTerm = function (ctx) {
1103
- return this.u39(ctx);
1063
+ return this.g38(ctx);
1104
1064
  };
1105
- protoOf(PrologVisitor).x39 = function (ctx) {
1065
+ protoOf(PrologVisitor).j38 = function (ctx) {
1106
1066
  var value = parseInteger_0(this, ctx);
1107
1067
  return Companion_getInstance_2().ofBigInteger(value);
1108
1068
  };
1109
1069
  protoOf(PrologVisitor).visitInteger = function (ctx) {
1110
- return this.x39(ctx);
1070
+ return this.j38(ctx);
1111
1071
  };
1112
- protoOf(PrologVisitor).y39 = function (ctx) {
1072
+ protoOf(PrologVisitor).k38 = function (ctx) {
1113
1073
  var tmp = ctx.children[0].accept(this);
1114
1074
  return (!(tmp == null) ? isInterface(tmp, Term) : false) ? tmp : THROW_CCE();
1115
1075
  };
1116
1076
  protoOf(PrologVisitor).visitNumber = function (ctx) {
1117
- return this.y39(ctx);
1077
+ return this.k38(ctx);
1118
1078
  };
1119
- protoOf(PrologVisitor).z39 = function (ctx) {
1079
+ protoOf(PrologVisitor).l38 = function (ctx) {
1120
1080
  var raw = ctx.value.text;
1121
1081
  if (!(ctx.sign == null)) {
1122
1082
  var tmp0_safe_receiver = ctx.sign;
@@ -1137,39 +1097,39 @@
1137
1097
  return tmp;
1138
1098
  };
1139
1099
  protoOf(PrologVisitor).visitReal = function (ctx) {
1140
- return this.z39(ctx);
1100
+ return this.l38(ctx);
1141
1101
  };
1142
- protoOf(PrologVisitor).a3a = function (ctx) {
1102
+ protoOf(PrologVisitor).m38 = function (ctx) {
1143
1103
  var tmp;
1144
1104
  if (ctx.isAnonymous) {
1145
- tmp = this.r39_1.anonymous();
1105
+ tmp = this.d38_1.anonymous();
1146
1106
  } else {
1147
- tmp = this.r39_1.varOf(ctx.value.text);
1107
+ tmp = this.d38_1.varOf(ctx.value.text);
1148
1108
  }
1149
1109
  return tmp;
1150
1110
  };
1151
1111
  protoOf(PrologVisitor).visitVariable = function (ctx) {
1152
- return this.a3a(ctx);
1112
+ return this.m38(ctx);
1153
1113
  };
1154
- protoOf(PrologVisitor).b3a = function (ctx) {
1114
+ protoOf(PrologVisitor).n38 = function (ctx) {
1155
1115
  var tmp;
1156
1116
  if (ctx.isList) {
1157
- tmp = this.r39_1.logicListOf([]);
1117
+ tmp = this.d38_1.logicListOf([]);
1158
1118
  } else if (ctx.isBlock) {
1159
- tmp = this.r39_1.blockOf([]);
1119
+ tmp = this.d38_1.blockOf([]);
1160
1120
  } else if (ctx.arity === 0) {
1161
- tmp = this.r39_1.atomOf(ctx.functor.text);
1121
+ tmp = this.d38_1.atomOf(ctx.functor.text);
1162
1122
  } else {
1163
1123
  var tmp_0 = ctx.functor.text;
1164
1124
  var tmp_1 = asSequence_0(ctx.args);
1165
- tmp = this.r39_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
1125
+ tmp = this.d38_1.structOfSequence(tmp_0, map(tmp_1, PrologVisitor$visitExpression$ref(this)));
1166
1126
  }
1167
1127
  return tmp;
1168
1128
  };
1169
1129
  protoOf(PrologVisitor).visitStructure = function (ctx) {
1170
- return this.b3a(ctx);
1130
+ return this.n38(ctx);
1171
1131
  };
1172
- protoOf(PrologVisitor).c3a = function (ctx) {
1132
+ protoOf(PrologVisitor).o38 = function (ctx) {
1173
1133
  // Inline function 'kotlin.collections.map' call
1174
1134
  var this_0 = ctx.items;
1175
1135
  // Inline function 'kotlin.collections.mapTo' call
@@ -1179,26 +1139,26 @@
1179
1139
  while (inductionVariable < last) {
1180
1140
  var item = this_0[inductionVariable];
1181
1141
  inductionVariable = inductionVariable + 1 | 0;
1182
- var tmp$ret$0 = this.s39(item);
1183
- destination.o(tmp$ret$0);
1142
+ var tmp$ret$0 = this.e38(item);
1143
+ destination.m(tmp$ret$0);
1184
1144
  }
1185
1145
  var terms = destination;
1186
1146
  var tmp;
1187
1147
  if (ctx.hasTail) {
1188
1148
  var tmp0_safe_receiver = ctx.tail;
1189
- tmp = this.r39_1.w10(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
1149
+ tmp = this.d38_1.yz(terms, tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept(this));
1190
1150
  } else {
1191
- tmp = this.r39_1.logicListOfIterable(terms);
1151
+ tmp = this.d38_1.logicListOfIterable(terms);
1192
1152
  }
1193
1153
  return tmp;
1194
1154
  };
1195
1155
  protoOf(PrologVisitor).visitList = function (ctx) {
1196
- return this.c3a(ctx);
1156
+ return this.o38(ctx);
1197
1157
  };
1198
- protoOf(PrologVisitor).d3a = function (ctx) {
1158
+ protoOf(PrologVisitor).p38 = function (ctx) {
1199
1159
  var tmp;
1200
1160
  if (ctx.length === 1) {
1201
- tmp = this.r39_1.blockOf([ctx.items[0].accept(this)]);
1161
+ tmp = this.d38_1.blockOf([ctx.items[0].accept(this)]);
1202
1162
  } else {
1203
1163
  // Inline function 'kotlin.collections.map' call
1204
1164
  var this_0 = ctx.items;
@@ -1209,32 +1169,32 @@
1209
1169
  while (inductionVariable < last) {
1210
1170
  var item = this_0[inductionVariable];
1211
1171
  inductionVariable = inductionVariable + 1 | 0;
1212
- var tmp$ret$0 = this.s39(item);
1213
- destination.o(tmp$ret$0);
1172
+ var tmp$ret$0 = this.e38(item);
1173
+ destination.m(tmp$ret$0);
1214
1174
  }
1215
- tmp = this.r39_1.blockOfIterable(destination);
1175
+ tmp = this.d38_1.blockOfIterable(destination);
1216
1176
  }
1217
1177
  return tmp;
1218
1178
  };
1219
1179
  protoOf(PrologVisitor).visitBlock = function (ctx) {
1220
- return this.d3a(ctx);
1180
+ return this.p38(ctx);
1221
1181
  };
1222
1182
  function termParserWithOperators(operators, scope) {
1223
1183
  scope = scope === VOID ? Companion_instance.empty() : scope;
1224
1184
  return new TermParserImpl(scope, operators);
1225
1185
  }
1226
1186
  function TermParserImpl(scope, defaultOperatorSet) {
1227
- this.e3a_1 = scope;
1228
- this.f3a_1 = defaultOperatorSet;
1187
+ this.q38_1 = scope;
1188
+ this.r38_1 = defaultOperatorSet;
1229
1189
  }
1230
- protoOf(TermParserImpl).h39 = function () {
1231
- return this.f3a_1;
1190
+ protoOf(TermParserImpl).t37 = function () {
1191
+ return this.r38_1;
1232
1192
  };
1233
- protoOf(TermParserImpl).g3a = function (input, operators) {
1234
- return PrologParserFactory_instance.n39(input, operators).accept(new PrologVisitor(this.e3a_1));
1193
+ protoOf(TermParserImpl).s38 = function (input, operators) {
1194
+ return PrologParserFactory_instance.z37(input, operators).accept(new PrologVisitor(this.q38_1));
1235
1195
  };
1236
1196
  protoOf(TermParserImpl).parseTermWithOperators = function (input, operators) {
1237
- return this.g3a(input, operators);
1197
+ return this.s38(input, operators);
1238
1198
  };
1239
1199
  //region block: post-declaration
1240
1200
  protoOf(TermParserImpl).parseTerm = parseTerm;