@tuprolog/2p-full 2.0.5 → 2.0.9
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-bdd.js +172 -172
- package/2p-bdd.js.map +1 -1
- package/2p-core.js +3593 -3366
- package/2p-core.js.map +1 -1
- package/2p-datalog.js.map +1 -1
- package/2p-dsl-core.js.map +1 -1
- package/2p-dsl-solve.js.map +1 -1
- package/2p-dsl-theory.js.map +1 -1
- package/2p-dsl-unify.js.map +1 -1
- package/2p-full.js +17 -4
- package/2p-full.js.map +1 -1
- package/2p-gui-plp.js.map +1 -1
- package/2p-gui.js.map +1 -1
- package/2p-ide-web.js.map +1 -1
- package/2p-io-lib.js +3489 -5
- package/2p-io-lib.js.map +1 -1
- package/2p-oop-lib.js +3382 -5
- package/2p-oop-lib.js.map +1 -1
- package/2p-parser-core.js +616 -5
- package/2p-parser-core.js.map +1 -1
- package/2p-parser-impl.js +5636 -5
- package/2p-parser-impl.js.map +1 -1
- package/2p-parser-theory.js +278 -5
- package/2p-parser-theory.js.map +1 -1
- package/2p-repl.js +533 -5
- package/2p-repl.js.map +1 -1
- package/2p-serialize-core.js.map +1 -1
- package/2p-serialize-theory.js.map +1 -1
- package/2p-solve-classic.js +1050 -1050
- package/2p-solve-classic.js.map +1 -1
- package/2p-solve-concurrent.js.map +1 -1
- package/2p-solve-plp.js +3 -3
- package/2p-solve-plp.js.map +1 -1
- package/2p-solve-problog.js +1450 -1444
- package/2p-solve-problog.js.map +1 -1
- package/2p-solve-streams.js +1033 -1033
- package/2p-solve-streams.js.map +1 -1
- package/2p-solve.js +5580 -4490
- package/2p-solve.js.map +1 -1
- package/2p-test-dsl.js.map +1 -1
- package/2p-theory.js +1725 -1725
- package/2p-theory.js.map +1 -1
- package/2p-unify.js +375 -375
- package/2p-unify.js.map +1 -1
- package/2p-utils.js +546 -493
- package/2p-utils.js.map +1 -1
- package/clikt-clikt-mordant.js +311 -5
- package/clikt-clikt-mordant.js.map +1 -1
- package/clikt-clikt.js +6672 -5
- package/clikt-clikt.js.map +1 -1
- package/colormath-root-colormath.js +1654 -5
- package/colormath-root-colormath.js.map +1 -1
- package/kotlin-kotlin-stdlib.js +5400 -2597
- package/kotlin-kotlin-stdlib.js.map +1 -1
- package/kotlin-kotlin-test.js.map +1 -1
- package/kotlin_org_jetbrains_kotlin_kotlin_dom_api_compat.js.map +1 -1
- package/kotlinx-atomicfu.js.map +1 -1
- package/kotlinx-coroutines-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-core.js.map +1 -1
- package/kotlinx-serialization-kotlinx-serialization-json.js.map +1 -1
- package/kt-math.js +1622 -1614
- package/kt-math.js.map +1 -1
- package/mordant-mordant-omnibus.js.map +1 -1
- package/mordant-mordant.js +10375 -5
- package/mordant-mordant.js.map +1 -1
- package/okio-parent-okio-nodefilesystem.js +201 -5
- package/okio-parent-okio-nodefilesystem.js.map +1 -1
- package/okio-parent-okio.js +3863 -5
- package/okio-parent-okio.js.map +1 -1
- package/package.json +4 -4
package/2p-parser-core.js
CHANGED
|
@@ -1,13 +1,624 @@
|
|
|
1
1
|
(function (factory) {
|
|
2
2
|
if (typeof define === 'function' && define.amd)
|
|
3
|
-
define(['exports'], factory);
|
|
3
|
+
define(['exports', './kotlin-kotlin-stdlib.js', './2p-core.js', './2p-parser-impl.js'], factory);
|
|
4
4
|
else if (typeof exports === 'object')
|
|
5
|
-
factory(module.exports);
|
|
6
|
-
else
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
factory(module.exports, require('./kotlin-kotlin-stdlib.js'), require('./2p-core.js'), require('./2p-parser-impl.js'));
|
|
6
|
+
else {
|
|
7
|
+
if (typeof globalThis['kotlin-kotlin-stdlib'] === 'undefined') {
|
|
8
|
+
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'.");
|
|
9
|
+
}
|
|
10
|
+
if (typeof globalThis['2p-core'] === 'undefined') {
|
|
11
|
+
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'.");
|
|
12
|
+
}
|
|
13
|
+
if (typeof globalThis['2p-parser-impl'] === 'undefined') {
|
|
14
|
+
throw new Error("Error loading module '2p-parser-core'. Its dependency '2p-parser-impl' was not found. Please, check whether '2p-parser-impl' is loaded prior to '2p-parser-core'.");
|
|
15
|
+
}
|
|
16
|
+
globalThis['2p-parser-core'] = factory(typeof globalThis['2p-parser-core'] === 'undefined' ? {} : globalThis['2p-parser-core'], globalThis['kotlin-kotlin-stdlib'], globalThis['2p-core'], globalThis['2p-parser-impl']);
|
|
17
|
+
}
|
|
18
|
+
}(function (_, kotlin_kotlin, kotlin_it_unibo_tuprolog_core, kotlin_it_unibo_tuprolog_parser_impl) {
|
|
9
19
|
'use strict';
|
|
20
|
+
//region block: imports
|
|
21
|
+
var imul = Math.imul;
|
|
22
|
+
var VOID = kotlin_kotlin.$_$.b;
|
|
23
|
+
var captureStack = kotlin_kotlin.$_$.i7;
|
|
24
|
+
var protoOf = kotlin_kotlin.$_$.r8;
|
|
25
|
+
var initMetadataForClass = kotlin_kotlin.$_$.a8;
|
|
26
|
+
var TuPrologException = kotlin_it_unibo_tuprolog_core.$_$.l1;
|
|
27
|
+
var TuPrologException_init_$Init$ = kotlin_it_unibo_tuprolog_core.$_$.i1;
|
|
28
|
+
var replace = kotlin_kotlin.$_$.sc;
|
|
29
|
+
var getKClassFromExpression = kotlin_kotlin.$_$.o9;
|
|
30
|
+
var getKClass = kotlin_kotlin.$_$.p9;
|
|
31
|
+
var toString = kotlin_kotlin.$_$.u8;
|
|
32
|
+
var IllegalStateException_init_$Create$ = kotlin_kotlin.$_$.n1;
|
|
33
|
+
var collectionSizeOrDefault = kotlin_kotlin.$_$.w2;
|
|
34
|
+
var ArrayList_init_$Create$ = kotlin_kotlin.$_$.t;
|
|
35
|
+
var Unit_instance = kotlin_kotlin.$_$.r;
|
|
36
|
+
var ensureNotNull = kotlin_kotlin.$_$.me;
|
|
37
|
+
var visit = kotlin_it_unibo_tuprolog_parser_impl.$_$.p;
|
|
38
|
+
var visitExpression = kotlin_it_unibo_tuprolog_parser_impl.$_$.m;
|
|
39
|
+
var visitClause = kotlin_it_unibo_tuprolog_parser_impl.$_$.l;
|
|
40
|
+
var visitTerm = kotlin_it_unibo_tuprolog_parser_impl.$_$.o;
|
|
41
|
+
var visitParenthesizedExpression = kotlin_it_unibo_tuprolog_parser_impl.$_$.n;
|
|
42
|
+
var SyntaxNodeVisitor = kotlin_it_unibo_tuprolog_parser_impl.$_$.q;
|
|
43
|
+
var Companion_getInstance = kotlin_it_unibo_tuprolog_core.$_$.k;
|
|
44
|
+
var Companion_instance = kotlin_it_unibo_tuprolog_core.$_$.w;
|
|
45
|
+
var OperatorSet_init_$Create$ = kotlin_it_unibo_tuprolog_core.$_$.j1;
|
|
46
|
+
var initMetadataForCompanion = kotlin_kotlin.$_$.b8;
|
|
47
|
+
var Struct = kotlin_it_unibo_tuprolog_core.$_$.z1;
|
|
48
|
+
var isInterface = kotlin_kotlin.$_$.j8;
|
|
49
|
+
var Constant = kotlin_it_unibo_tuprolog_core.$_$.q1;
|
|
50
|
+
var Var = kotlin_it_unibo_tuprolog_core.$_$.b3;
|
|
51
|
+
var Atom = kotlin_it_unibo_tuprolog_core.$_$.o1;
|
|
52
|
+
var Numeric = kotlin_it_unibo_tuprolog_core.$_$.w1;
|
|
53
|
+
var Integer = kotlin_it_unibo_tuprolog_core.$_$.u1;
|
|
54
|
+
var Real = kotlin_it_unibo_tuprolog_core.$_$.x1;
|
|
55
|
+
var Clause = kotlin_it_unibo_tuprolog_core.$_$.p1;
|
|
56
|
+
var Rule = kotlin_it_unibo_tuprolog_core.$_$.y1;
|
|
57
|
+
var Fact = kotlin_it_unibo_tuprolog_core.$_$.s1;
|
|
58
|
+
var Directive = kotlin_it_unibo_tuprolog_core.$_$.r1;
|
|
59
|
+
var initMetadataForInterface = kotlin_kotlin.$_$.d8;
|
|
60
|
+
var Companion_instance_0 = kotlin_it_unibo_tuprolog_core.$_$.p;
|
|
61
|
+
var PrologSyntaxException = kotlin_it_unibo_tuprolog_parser_impl.$_$.j;
|
|
62
|
+
var LexerOptions = kotlin_it_unibo_tuprolog_parser_impl.$_$.r;
|
|
63
|
+
var ParserOptions = kotlin_it_unibo_tuprolog_parser_impl.$_$.s;
|
|
64
|
+
var buildParserFor = kotlin_it_unibo_tuprolog_parser_impl.$_$.u;
|
|
65
|
+
var OperatorTables_instance = kotlin_it_unibo_tuprolog_parser_impl.$_$.h;
|
|
66
|
+
var OperatorDefinition = kotlin_it_unibo_tuprolog_parser_impl.$_$.k;
|
|
67
|
+
var Associativity_FX_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.a;
|
|
68
|
+
var Associativity_FY_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.b;
|
|
69
|
+
var Associativity_XF_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.e;
|
|
70
|
+
var Associativity_YF_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.g;
|
|
71
|
+
var Associativity_XFX_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.c;
|
|
72
|
+
var Associativity_YFX_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.f;
|
|
73
|
+
var Associativity_XFY_getInstance = kotlin_it_unibo_tuprolog_parser_impl.$_$.d;
|
|
74
|
+
var noWhenBranchMatchedException = kotlin_kotlin.$_$.qe;
|
|
75
|
+
//endregion
|
|
10
76
|
//region block: pre-declaration
|
|
77
|
+
initMetadataForClass(ParseException, 'ParseException', VOID, TuPrologException);
|
|
78
|
+
initMetadataForClass(InvalidTermTypeException, 'InvalidTermTypeException', VOID, ParseException);
|
|
79
|
+
initMetadataForClass(PrologTermParserVisitor, 'PrologTermParserVisitor', VOID, VOID, [SyntaxNodeVisitor]);
|
|
80
|
+
initMetadataForCompanion(Companion);
|
|
81
|
+
function parseTerm(input) {
|
|
82
|
+
return this.parseTermWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
83
|
+
}
|
|
84
|
+
function parseStructWithOperators(input, operators) {
|
|
85
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
86
|
+
// Inline function 'kotlin.let' call
|
|
87
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
88
|
+
var tmp0_elvis_lhs = isInterface(it, Struct) ? it : null;
|
|
89
|
+
var tmp;
|
|
90
|
+
if (tmp0_elvis_lhs == null) {
|
|
91
|
+
throw new InvalidTermTypeException(input, it, getKClass(Struct));
|
|
92
|
+
} else {
|
|
93
|
+
tmp = tmp0_elvis_lhs;
|
|
94
|
+
}
|
|
95
|
+
return tmp;
|
|
96
|
+
}
|
|
97
|
+
function parseStruct(input) {
|
|
98
|
+
return this.parseStructWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
99
|
+
}
|
|
100
|
+
function parseConstantWithOperators(input, operators) {
|
|
101
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
102
|
+
// Inline function 'kotlin.let' call
|
|
103
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
104
|
+
var tmp0_elvis_lhs = isInterface(it, Constant) ? it : null;
|
|
105
|
+
var tmp;
|
|
106
|
+
if (tmp0_elvis_lhs == null) {
|
|
107
|
+
throw new InvalidTermTypeException(input, it, getKClass(Constant));
|
|
108
|
+
} else {
|
|
109
|
+
tmp = tmp0_elvis_lhs;
|
|
110
|
+
}
|
|
111
|
+
return tmp;
|
|
112
|
+
}
|
|
113
|
+
function parseConstant(input) {
|
|
114
|
+
return this.parseConstantWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
115
|
+
}
|
|
116
|
+
function parseVarWithOperators(input, operators) {
|
|
117
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
118
|
+
// Inline function 'kotlin.let' call
|
|
119
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
120
|
+
var tmp0_elvis_lhs = isInterface(it, Var) ? it : null;
|
|
121
|
+
var tmp;
|
|
122
|
+
if (tmp0_elvis_lhs == null) {
|
|
123
|
+
throw new InvalidTermTypeException(input, it, getKClass(Var));
|
|
124
|
+
} else {
|
|
125
|
+
tmp = tmp0_elvis_lhs;
|
|
126
|
+
}
|
|
127
|
+
return tmp;
|
|
128
|
+
}
|
|
129
|
+
function parseVar(input) {
|
|
130
|
+
return this.parseVarWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
131
|
+
}
|
|
132
|
+
function parseAtomWithOperators(input, operators) {
|
|
133
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
134
|
+
// Inline function 'kotlin.let' call
|
|
135
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
136
|
+
var tmp0_elvis_lhs = isInterface(it, Atom) ? it : null;
|
|
137
|
+
var tmp;
|
|
138
|
+
if (tmp0_elvis_lhs == null) {
|
|
139
|
+
throw new InvalidTermTypeException(input, it, getKClass(Atom));
|
|
140
|
+
} else {
|
|
141
|
+
tmp = tmp0_elvis_lhs;
|
|
142
|
+
}
|
|
143
|
+
return tmp;
|
|
144
|
+
}
|
|
145
|
+
function parseAtom(input) {
|
|
146
|
+
return this.parseAtomWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
147
|
+
}
|
|
148
|
+
function parseNumericWithOperators(input, operators) {
|
|
149
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
150
|
+
// Inline function 'kotlin.let' call
|
|
151
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
152
|
+
var tmp0_elvis_lhs = isInterface(it, Numeric) ? it : null;
|
|
153
|
+
var tmp;
|
|
154
|
+
if (tmp0_elvis_lhs == null) {
|
|
155
|
+
throw new InvalidTermTypeException(input, it, getKClass(Numeric));
|
|
156
|
+
} else {
|
|
157
|
+
tmp = tmp0_elvis_lhs;
|
|
158
|
+
}
|
|
159
|
+
return tmp;
|
|
160
|
+
}
|
|
161
|
+
function parseNumeric(input) {
|
|
162
|
+
return this.parseNumericWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
163
|
+
}
|
|
164
|
+
function parseIntegerWithOperators(input, operators) {
|
|
165
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
166
|
+
// Inline function 'kotlin.let' call
|
|
167
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
168
|
+
var tmp0_elvis_lhs = isInterface(it, Integer) ? it : null;
|
|
169
|
+
var tmp;
|
|
170
|
+
if (tmp0_elvis_lhs == null) {
|
|
171
|
+
throw new InvalidTermTypeException(input, it, getKClass(Integer));
|
|
172
|
+
} else {
|
|
173
|
+
tmp = tmp0_elvis_lhs;
|
|
174
|
+
}
|
|
175
|
+
return tmp;
|
|
176
|
+
}
|
|
177
|
+
function parseInteger(input) {
|
|
178
|
+
return this.parseIntegerWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
179
|
+
}
|
|
180
|
+
function parseRealWithOperators(input, operators) {
|
|
181
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
182
|
+
// Inline function 'kotlin.let' call
|
|
183
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
184
|
+
var tmp0_elvis_lhs = isInterface(it, Real) ? it : null;
|
|
185
|
+
var tmp;
|
|
186
|
+
if (tmp0_elvis_lhs == null) {
|
|
187
|
+
throw new InvalidTermTypeException(input, it, getKClass(Real));
|
|
188
|
+
} else {
|
|
189
|
+
tmp = tmp0_elvis_lhs;
|
|
190
|
+
}
|
|
191
|
+
return tmp;
|
|
192
|
+
}
|
|
193
|
+
function parseReal(input) {
|
|
194
|
+
return this.parseRealWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
195
|
+
}
|
|
196
|
+
function parseClauseWithOperators(input, operators) {
|
|
197
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
198
|
+
// Inline function 'kotlin.let' call
|
|
199
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
200
|
+
var tmp0_elvis_lhs = isInterface(it, Clause) ? it : null;
|
|
201
|
+
var tmp;
|
|
202
|
+
if (tmp0_elvis_lhs == null) {
|
|
203
|
+
throw new InvalidTermTypeException(input, it, getKClass(Clause));
|
|
204
|
+
} else {
|
|
205
|
+
tmp = tmp0_elvis_lhs;
|
|
206
|
+
}
|
|
207
|
+
return tmp;
|
|
208
|
+
}
|
|
209
|
+
function parseClause(input) {
|
|
210
|
+
return this.parseClauseWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
211
|
+
}
|
|
212
|
+
function parseRuleWithOperators(input, operators) {
|
|
213
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
214
|
+
// Inline function 'kotlin.let' call
|
|
215
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
216
|
+
var tmp0_elvis_lhs = isInterface(it, Rule) ? it : null;
|
|
217
|
+
var tmp;
|
|
218
|
+
if (tmp0_elvis_lhs == null) {
|
|
219
|
+
throw new InvalidTermTypeException(input, it, getKClass(Rule));
|
|
220
|
+
} else {
|
|
221
|
+
tmp = tmp0_elvis_lhs;
|
|
222
|
+
}
|
|
223
|
+
return tmp;
|
|
224
|
+
}
|
|
225
|
+
function parseRule(input) {
|
|
226
|
+
return this.parseRuleWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
227
|
+
}
|
|
228
|
+
function parseFactWithOperators(input, operators) {
|
|
229
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
230
|
+
// Inline function 'kotlin.let' call
|
|
231
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
232
|
+
var tmp0_elvis_lhs = isInterface(it, Fact) ? it : null;
|
|
233
|
+
var tmp;
|
|
234
|
+
if (tmp0_elvis_lhs == null) {
|
|
235
|
+
throw new InvalidTermTypeException(input, it, getKClass(Fact));
|
|
236
|
+
} else {
|
|
237
|
+
tmp = tmp0_elvis_lhs;
|
|
238
|
+
}
|
|
239
|
+
return tmp;
|
|
240
|
+
}
|
|
241
|
+
function parseFact(input) {
|
|
242
|
+
return this.parseFactWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
243
|
+
}
|
|
244
|
+
function parseDirectiveWithOperators(input, operators) {
|
|
245
|
+
// Inline function 'it.unibo.tuprolog.core.parsing.Companion.parseAs' call
|
|
246
|
+
// Inline function 'kotlin.let' call
|
|
247
|
+
var it = this.parseTermWithOperators(input, operators);
|
|
248
|
+
var tmp0_elvis_lhs = isInterface(it, Directive) ? it : null;
|
|
249
|
+
var tmp;
|
|
250
|
+
if (tmp0_elvis_lhs == null) {
|
|
251
|
+
throw new InvalidTermTypeException(input, it, getKClass(Directive));
|
|
252
|
+
} else {
|
|
253
|
+
tmp = tmp0_elvis_lhs;
|
|
254
|
+
}
|
|
255
|
+
return tmp;
|
|
256
|
+
}
|
|
257
|
+
function parseDirective(input) {
|
|
258
|
+
return this.parseDirectiveWithOperators(input, this.get_defaultOperatorSet_nz5v8a_k$());
|
|
259
|
+
}
|
|
260
|
+
initMetadataForInterface(TermParser, 'TermParser');
|
|
261
|
+
initMetadataForClass(TermParserImpl, 'TermParserImpl', VOID, VOID, [TermParser]);
|
|
262
|
+
//endregion
|
|
263
|
+
function InvalidTermTypeException(input, term, type, offendingSymbol, line, column, message, throwable) {
|
|
264
|
+
var tmp;
|
|
265
|
+
if (offendingSymbol === VOID) {
|
|
266
|
+
var tmp0_elvis_lhs = (!(input == null) ? typeof input === 'string' : false) ? input : null;
|
|
267
|
+
tmp = tmp0_elvis_lhs == null ? term.toString() : tmp0_elvis_lhs;
|
|
268
|
+
} else {
|
|
269
|
+
tmp = offendingSymbol;
|
|
270
|
+
}
|
|
271
|
+
offendingSymbol = tmp;
|
|
272
|
+
line = line === VOID ? 1 : line;
|
|
273
|
+
column = column === VOID ? 1 : column;
|
|
274
|
+
message = message === VOID ? 'Expected ' + type.get_simpleName_r6f8py_k$() + ', got: ' + offendingSymbol : message;
|
|
275
|
+
throwable = throwable === VOID ? null : throwable;
|
|
276
|
+
ParseException.call(this, input, offendingSymbol, line, column, message, throwable);
|
|
277
|
+
captureStack(this, InvalidTermTypeException);
|
|
278
|
+
this.term_1 = term;
|
|
279
|
+
this.type_1 = type;
|
|
280
|
+
}
|
|
281
|
+
function ParseException(input, offendingSymbol, line, column, message, throwable) {
|
|
282
|
+
TuPrologException_init_$Init$(message, throwable, this);
|
|
283
|
+
captureStack(this, ParseException);
|
|
284
|
+
this.input = input;
|
|
285
|
+
this.offendingSymbol = offendingSymbol;
|
|
286
|
+
this.line = line;
|
|
287
|
+
this.column = column;
|
|
288
|
+
this.clauseIndex = -1;
|
|
289
|
+
}
|
|
290
|
+
protoOf(ParseException).set_input_o40ujm_k$ = function (_set____db54di) {
|
|
291
|
+
this.input = _set____db54di;
|
|
292
|
+
};
|
|
293
|
+
protoOf(ParseException).get_input_it4gip_k$ = function () {
|
|
294
|
+
return this.input;
|
|
295
|
+
};
|
|
296
|
+
protoOf(ParseException).set_offendingSymbol_dpztga_k$ = function (_set____db54di) {
|
|
297
|
+
this.offendingSymbol = _set____db54di;
|
|
298
|
+
};
|
|
299
|
+
protoOf(ParseException).get_offendingSymbol_l29vhh_k$ = function () {
|
|
300
|
+
return this.offendingSymbol;
|
|
301
|
+
};
|
|
302
|
+
protoOf(ParseException).set_line_45vtmf_k$ = function (_set____db54di) {
|
|
303
|
+
this.line = _set____db54di;
|
|
304
|
+
};
|
|
305
|
+
protoOf(ParseException).get_line_wopum5_k$ = function () {
|
|
306
|
+
return this.line;
|
|
307
|
+
};
|
|
308
|
+
protoOf(ParseException).set_column_1qqbf9_k$ = function (_set____db54di) {
|
|
309
|
+
this.column = _set____db54di;
|
|
310
|
+
};
|
|
311
|
+
protoOf(ParseException).get_column_c05ahr_k$ = function () {
|
|
312
|
+
return this.column;
|
|
313
|
+
};
|
|
314
|
+
protoOf(ParseException).set_clauseIndex_ezd4la_k$ = function (_set____db54di) {
|
|
315
|
+
this.clauseIndex = _set____db54di;
|
|
316
|
+
};
|
|
317
|
+
protoOf(ParseException).get_clauseIndex_42gn2e_k$ = function () {
|
|
318
|
+
return this.clauseIndex;
|
|
319
|
+
};
|
|
320
|
+
protoOf(ParseException).toString = function () {
|
|
321
|
+
var tmp0_safe_receiver = this.message;
|
|
322
|
+
var tmp1_safe_receiver = tmp0_safe_receiver == null ? null : replace(tmp0_safe_receiver, '\\n', '\\\\n');
|
|
323
|
+
var tmp;
|
|
324
|
+
if (tmp1_safe_receiver == null) {
|
|
325
|
+
tmp = null;
|
|
326
|
+
} else {
|
|
327
|
+
// Inline function 'kotlin.let' call
|
|
328
|
+
tmp = '"' + tmp1_safe_receiver + '"';
|
|
329
|
+
}
|
|
330
|
+
var tmp2_elvis_lhs = tmp;
|
|
331
|
+
var message = tmp2_elvis_lhs == null ? 'null' : tmp2_elvis_lhs;
|
|
332
|
+
var result = 'ParseException{message=' + message + ', line=' + this.line + ', column=' + this.column;
|
|
333
|
+
if (this.clauseIndex >= 0) {
|
|
334
|
+
result = result + (', clauseIndex' + this.clauseIndex);
|
|
335
|
+
}
|
|
336
|
+
if (!(this.offendingSymbol == null)) {
|
|
337
|
+
result = result + (', offendingSymbol="' + this.offendingSymbol + '"');
|
|
338
|
+
}
|
|
339
|
+
return result + '}';
|
|
340
|
+
};
|
|
341
|
+
function PrologTermParserVisitor(scope) {
|
|
342
|
+
this.scope_1 = scope;
|
|
343
|
+
}
|
|
344
|
+
protoOf(PrologTermParserVisitor).visitTheory_kbxb6b_k$ = function (node) {
|
|
345
|
+
// Inline function 'kotlin.error' call
|
|
346
|
+
var message = '[BUG] ' + getKClassFromExpression(node).get_simpleName_r6f8py_k$() + ' should not be visited by ' + getKClass(PrologTermParserVisitor).get_simpleName_r6f8py_k$();
|
|
347
|
+
throw IllegalStateException_init_$Create$(toString(message));
|
|
348
|
+
};
|
|
349
|
+
protoOf(PrologTermParserVisitor).visitOperator_js9vsg_k$ = function (node) {
|
|
350
|
+
var tmp = node.get_operator_uy5ppp_k$().definition_1.name_1;
|
|
351
|
+
// Inline function 'kotlin.collections.map' call
|
|
352
|
+
var this_0 = node.get_children_4cwbp4_k$();
|
|
353
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
354
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
355
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
356
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
357
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
358
|
+
var tmp$ret$2 = item.accept_crnher_k$(this);
|
|
359
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
360
|
+
}
|
|
361
|
+
return this.scope_1.structOfList(tmp, destination);
|
|
362
|
+
};
|
|
363
|
+
protoOf(PrologTermParserVisitor).visitNumber_2s9u78_k$ = function (node) {
|
|
364
|
+
var signedDigits = node.get_sign_woubd2_k$() < 0 ? '-' + node.get_digits_cdspnz_k$() : node.get_digits_cdspnz_k$();
|
|
365
|
+
switch (node.get_numberKind_qnwk56_k$().ordinal_1) {
|
|
366
|
+
case 5:
|
|
367
|
+
return this.scope_1.parseReal(signedDigits);
|
|
368
|
+
case 4:
|
|
369
|
+
return this.scope_1.intOf(imul(node.get_sign_woubd2_k$(), ensureNotNull(node.get_characterCode_utq44z_k$())));
|
|
370
|
+
default:
|
|
371
|
+
return this.scope_1.parseIntRadix(signedDigits, ensureNotNull(node.get_radix_ixu1uj_k$()));
|
|
372
|
+
}
|
|
373
|
+
};
|
|
374
|
+
protoOf(PrologTermParserVisitor).visitVariable_rx9004_k$ = function (node) {
|
|
375
|
+
var tmp;
|
|
376
|
+
if (node.get_isAnonymous_19zn5y_k$()) {
|
|
377
|
+
tmp = this.scope_1.anonymous();
|
|
378
|
+
} else {
|
|
379
|
+
tmp = this.scope_1.varOf(node.get_name_woqyms_k$());
|
|
380
|
+
}
|
|
381
|
+
return tmp;
|
|
382
|
+
};
|
|
383
|
+
protoOf(PrologTermParserVisitor).visitStructure_d7uvyg_k$ = function (node) {
|
|
384
|
+
var tmp = node.get_functor_75vgt2_k$();
|
|
385
|
+
// Inline function 'kotlin.collections.map' call
|
|
386
|
+
var this_0 = node.get_children_4cwbp4_k$();
|
|
387
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
388
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
389
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
390
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
391
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
392
|
+
var tmp$ret$2 = item.accept_crnher_k$(this);
|
|
393
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
394
|
+
}
|
|
395
|
+
return this.scope_1.structOfList(tmp, destination);
|
|
396
|
+
};
|
|
397
|
+
protoOf(PrologTermParserVisitor).visitList_1rrs70_k$ = function (node) {
|
|
398
|
+
// Inline function 'kotlin.collections.map' call
|
|
399
|
+
var this_0 = node.get_items_it823b_k$();
|
|
400
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
401
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
402
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
403
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
404
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
405
|
+
var tmp$ret$2 = item.accept_crnher_k$(this);
|
|
406
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
407
|
+
}
|
|
408
|
+
var tmp = destination;
|
|
409
|
+
var tmp0_safe_receiver = node.get_tail_wousgp_k$();
|
|
410
|
+
var tmp1_elvis_lhs = tmp0_safe_receiver == null ? null : tmp0_safe_receiver.accept_crnher_k$(this);
|
|
411
|
+
return this.scope_1.logicListFrom_yn067b_k$(tmp, tmp1_elvis_lhs == null ? this.scope_1.get_emptyLogicList_z7wjmg_k$() : tmp1_elvis_lhs);
|
|
412
|
+
};
|
|
413
|
+
protoOf(PrologTermParserVisitor).visitBlock_ipjpbw_k$ = function (node) {
|
|
414
|
+
// Inline function 'kotlin.collections.map' call
|
|
415
|
+
var this_0 = node.get_items_it823b_k$();
|
|
416
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
417
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(this_0, 10));
|
|
418
|
+
var _iterator__ex2g4s = this_0.iterator_jk1svi_k$();
|
|
419
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
420
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
421
|
+
var tmp$ret$2 = item.accept_crnher_k$(this);
|
|
422
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
423
|
+
}
|
|
424
|
+
return this.scope_1.blockOfIterable(destination);
|
|
425
|
+
};
|
|
426
|
+
function Companion() {
|
|
427
|
+
}
|
|
428
|
+
protoOf(Companion).withNoOperator_cszwhi_k$ = function (scope) {
|
|
429
|
+
return this.withOperators_f0aq2t_k$(Companion_getInstance().EMPTY, scope);
|
|
430
|
+
};
|
|
431
|
+
protoOf(Companion).withNoOperator = function (scope, $super) {
|
|
432
|
+
scope = scope === VOID ? Companion_instance.empty() : scope;
|
|
433
|
+
return $super === VOID ? this.withNoOperator_cszwhi_k$(scope) : $super.withNoOperator_cszwhi_k$.call(this, scope);
|
|
434
|
+
};
|
|
435
|
+
protoOf(Companion).withStandardOperators_ii3779_k$ = function (scope) {
|
|
436
|
+
return this.withOperators_f0aq2t_k$(Companion_getInstance().STANDARD, scope);
|
|
437
|
+
};
|
|
438
|
+
protoOf(Companion).withStandardOperators = function (scope, $super) {
|
|
439
|
+
scope = scope === VOID ? Companion_instance.empty() : scope;
|
|
440
|
+
return $super === VOID ? this.withStandardOperators_ii3779_k$(scope) : $super.withStandardOperators_ii3779_k$.call(this, scope);
|
|
441
|
+
};
|
|
442
|
+
protoOf(Companion).withDefaultOperators_tg7efn_k$ = function (scope) {
|
|
443
|
+
return this.withOperators_f0aq2t_k$(Companion_getInstance().DEFAULT, scope);
|
|
444
|
+
};
|
|
445
|
+
protoOf(Companion).withDefaultOperators = function (scope, $super) {
|
|
446
|
+
scope = scope === VOID ? Companion_instance.empty() : scope;
|
|
447
|
+
return $super === VOID ? this.withDefaultOperators_tg7efn_k$(scope) : $super.withDefaultOperators_tg7efn_k$.call(this, scope);
|
|
448
|
+
};
|
|
449
|
+
protoOf(Companion).withOperators_f0aq2t_k$ = function (operators, scope) {
|
|
450
|
+
return new TermParserImpl(scope, operators);
|
|
451
|
+
};
|
|
452
|
+
protoOf(Companion).withOperatorSet = function (operators, scope, $super) {
|
|
453
|
+
scope = scope === VOID ? Companion_instance.empty() : scope;
|
|
454
|
+
return $super === VOID ? this.withOperators_f0aq2t_k$(operators, scope) : $super.withOperators_f0aq2t_k$.call(this, operators, scope);
|
|
455
|
+
};
|
|
456
|
+
protoOf(Companion).withOperators_81mnyj_k$ = function (operators, scope) {
|
|
457
|
+
return this.withOperators_f0aq2t_k$(OperatorSet_init_$Create$(operators.slice()), scope);
|
|
458
|
+
};
|
|
459
|
+
protoOf(Companion).withOperators = function (operators, scope, $super) {
|
|
460
|
+
scope = scope === VOID ? Companion_instance.empty() : scope;
|
|
461
|
+
return $super === VOID ? this.withOperators_81mnyj_k$(operators, scope) : $super.withOperators_81mnyj_k$.call(this, operators, scope);
|
|
462
|
+
};
|
|
463
|
+
var Companion_instance_1;
|
|
464
|
+
function Companion_getInstance_0() {
|
|
465
|
+
return Companion_instance_1;
|
|
466
|
+
}
|
|
467
|
+
function TermParser() {
|
|
468
|
+
}
|
|
469
|
+
function termToClause(_this__u8e3s4, source, line, column) {
|
|
470
|
+
source = source === VOID ? null : source;
|
|
471
|
+
line = line === VOID ? 0 : line;
|
|
472
|
+
column = column === VOID ? 0 : column;
|
|
473
|
+
var tmp;
|
|
474
|
+
if (isInterface(_this__u8e3s4, Clause)) {
|
|
475
|
+
tmp = _this__u8e3s4;
|
|
476
|
+
} else {
|
|
477
|
+
if (isInterface(_this__u8e3s4, Struct)) {
|
|
478
|
+
tmp = Companion_instance_0.of(_this__u8e3s4);
|
|
479
|
+
} else {
|
|
480
|
+
throw new InvalidTermTypeException(source, _this__u8e3s4, getKClass(Clause), VOID, line, column);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
return tmp;
|
|
484
|
+
}
|
|
485
|
+
function parseStructWithOperators_0(_this__u8e3s4, input, operators) {
|
|
486
|
+
return get_defaultParser().parseStructWithOperators(input, operators);
|
|
487
|
+
}
|
|
488
|
+
function parseStruct_0(_this__u8e3s4, input) {
|
|
489
|
+
return get_defaultParser().parseStruct(input);
|
|
490
|
+
}
|
|
491
|
+
function get_defaultParser() {
|
|
492
|
+
return Companion_instance_1.withDefaultOperators();
|
|
493
|
+
}
|
|
494
|
+
function TermParserImpl$parseTerm$lambda($operators, this$0, $input) {
|
|
495
|
+
return function (parser, lexedSource) {
|
|
496
|
+
var tmp;
|
|
497
|
+
try {
|
|
498
|
+
var syntaxTree = parser.parseExpression_sa43yz_k$(lexedSource, toOperatorTable($operators));
|
|
499
|
+
var visitor = new PrologTermParserVisitor(this$0.scope_1);
|
|
500
|
+
tmp = syntaxTree.root_1.accept_crnher_k$(visitor);
|
|
501
|
+
} catch ($p) {
|
|
502
|
+
var tmp_0;
|
|
503
|
+
if ($p instanceof PrologSyntaxException) {
|
|
504
|
+
var e = $p;
|
|
505
|
+
throw toParseException(e, $input);
|
|
506
|
+
} else {
|
|
507
|
+
throw $p;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return tmp;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
function TermParserImpl(scope, defaultOperatorSet, lexerOptions, parserOptions) {
|
|
514
|
+
lexerOptions = lexerOptions === VOID ? new LexerOptions() : lexerOptions;
|
|
515
|
+
parserOptions = parserOptions === VOID ? new ParserOptions() : parserOptions;
|
|
516
|
+
this.scope_1 = scope;
|
|
517
|
+
this.defaultOperatorSet_1 = defaultOperatorSet;
|
|
518
|
+
this.lexerOptions_1 = lexerOptions;
|
|
519
|
+
this.parserOptions_1 = parserOptions;
|
|
520
|
+
}
|
|
521
|
+
protoOf(TermParserImpl).get_defaultOperatorSet_nz5v8a_k$ = function () {
|
|
522
|
+
return this.defaultOperatorSet_1;
|
|
523
|
+
};
|
|
524
|
+
protoOf(TermParserImpl).parseTermWithOperators_7gmkwl_k$ = function (input, operators) {
|
|
525
|
+
return buildParserFor(input, null, this.lexerOptions_1, this.parserOptions_1, TermParserImpl$parseTerm$lambda(operators, this, input));
|
|
526
|
+
};
|
|
527
|
+
protoOf(TermParserImpl).parseTermWithOperators = function (input, operators) {
|
|
528
|
+
return this.parseTermWithOperators_7gmkwl_k$(input, operators);
|
|
529
|
+
};
|
|
530
|
+
function toOperatorTable(_this__u8e3s4) {
|
|
531
|
+
var tmp = OperatorTables_instance;
|
|
532
|
+
// Inline function 'kotlin.collections.map' call
|
|
533
|
+
// Inline function 'kotlin.collections.mapTo' call
|
|
534
|
+
var destination = ArrayList_init_$Create$(collectionSizeOrDefault(_this__u8e3s4, 10));
|
|
535
|
+
var _iterator__ex2g4s = _this__u8e3s4.iterator_jk1svi_k$();
|
|
536
|
+
while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {
|
|
537
|
+
var item = _iterator__ex2g4s.next_20eer_k$();
|
|
538
|
+
var tmp$ret$2 = toDefinition(item);
|
|
539
|
+
destination.add_utx5q5_k$(tmp$ret$2);
|
|
540
|
+
}
|
|
541
|
+
return tmp.of_nwtcox_k$(destination);
|
|
542
|
+
}
|
|
543
|
+
function toDefinition(_this__u8e3s4) {
|
|
544
|
+
return new OperatorDefinition(_this__u8e3s4.functor_1, toAssociativity(_this__u8e3s4.specifier_1), _this__u8e3s4.priority_1);
|
|
545
|
+
}
|
|
546
|
+
function toAssociativity(_this__u8e3s4) {
|
|
547
|
+
var tmp;
|
|
548
|
+
switch (_this__u8e3s4.ordinal_1) {
|
|
549
|
+
case 2:
|
|
550
|
+
tmp = Associativity_FX_getInstance();
|
|
551
|
+
break;
|
|
552
|
+
case 3:
|
|
553
|
+
tmp = Associativity_FY_getInstance();
|
|
554
|
+
break;
|
|
555
|
+
case 0:
|
|
556
|
+
tmp = Associativity_XF_getInstance();
|
|
557
|
+
break;
|
|
558
|
+
case 1:
|
|
559
|
+
tmp = Associativity_YF_getInstance();
|
|
560
|
+
break;
|
|
561
|
+
case 4:
|
|
562
|
+
tmp = Associativity_XFX_getInstance();
|
|
563
|
+
break;
|
|
564
|
+
case 6:
|
|
565
|
+
tmp = Associativity_YFX_getInstance();
|
|
566
|
+
break;
|
|
567
|
+
case 5:
|
|
568
|
+
tmp = Associativity_XFY_getInstance();
|
|
569
|
+
break;
|
|
570
|
+
default:
|
|
571
|
+
noWhenBranchMatchedException();
|
|
572
|
+
break;
|
|
573
|
+
}
|
|
574
|
+
return tmp;
|
|
575
|
+
}
|
|
576
|
+
function toParseException(_this__u8e3s4, input) {
|
|
577
|
+
return new ParseException(input, _this__u8e3s4.offendingText_1, _this__u8e3s4.span_1.start_1.line_1 + 1 | 0, _this__u8e3s4.span_1.start_1.column_1 + 1 | 0, _this__u8e3s4.message, _this__u8e3s4);
|
|
578
|
+
}
|
|
579
|
+
//region block: post-declaration
|
|
580
|
+
protoOf(PrologTermParserVisitor).visit_u149rc_k$ = visit;
|
|
581
|
+
protoOf(PrologTermParserVisitor).visitExpression_oljedp_k$ = visitExpression;
|
|
582
|
+
protoOf(PrologTermParserVisitor).visitClause_xwc12l_k$ = visitClause;
|
|
583
|
+
protoOf(PrologTermParserVisitor).visitTerm_lz3x20_k$ = visitTerm;
|
|
584
|
+
protoOf(PrologTermParserVisitor).visitParenthesizedExpression_e5i8qy_k$ = visitParenthesizedExpression;
|
|
585
|
+
protoOf(TermParserImpl).parseTerm = parseTerm;
|
|
586
|
+
protoOf(TermParserImpl).parseStructWithOperators = parseStructWithOperators;
|
|
587
|
+
protoOf(TermParserImpl).parseStruct = parseStruct;
|
|
588
|
+
protoOf(TermParserImpl).parseConstantWithOperators = parseConstantWithOperators;
|
|
589
|
+
protoOf(TermParserImpl).parseConstant = parseConstant;
|
|
590
|
+
protoOf(TermParserImpl).parseVarWithOperators = parseVarWithOperators;
|
|
591
|
+
protoOf(TermParserImpl).parseVar = parseVar;
|
|
592
|
+
protoOf(TermParserImpl).parseAtomWithOperators = parseAtomWithOperators;
|
|
593
|
+
protoOf(TermParserImpl).parseAtom = parseAtom;
|
|
594
|
+
protoOf(TermParserImpl).parseNumericWithOperators = parseNumericWithOperators;
|
|
595
|
+
protoOf(TermParserImpl).parseNumeric = parseNumeric;
|
|
596
|
+
protoOf(TermParserImpl).parseIntegerWithOperators = parseIntegerWithOperators;
|
|
597
|
+
protoOf(TermParserImpl).parseInteger = parseInteger;
|
|
598
|
+
protoOf(TermParserImpl).parseRealWithOperators = parseRealWithOperators;
|
|
599
|
+
protoOf(TermParserImpl).parseReal = parseReal;
|
|
600
|
+
protoOf(TermParserImpl).parseClauseWithOperators = parseClauseWithOperators;
|
|
601
|
+
protoOf(TermParserImpl).parseClause = parseClause;
|
|
602
|
+
protoOf(TermParserImpl).parseRuleWithOperators = parseRuleWithOperators;
|
|
603
|
+
protoOf(TermParserImpl).parseRule = parseRule;
|
|
604
|
+
protoOf(TermParserImpl).parseFactWithOperators = parseFactWithOperators;
|
|
605
|
+
protoOf(TermParserImpl).parseFact = parseFact;
|
|
606
|
+
protoOf(TermParserImpl).parseDirectiveWithOperators = parseDirectiveWithOperators;
|
|
607
|
+
protoOf(TermParserImpl).parseDirective = parseDirective;
|
|
608
|
+
//endregion
|
|
609
|
+
//region block: init
|
|
610
|
+
Companion_instance_1 = new Companion();
|
|
611
|
+
//endregion
|
|
612
|
+
//region block: exports
|
|
613
|
+
_.$_$ = _.$_$ || {};
|
|
614
|
+
_.$_$.a = ParseException;
|
|
615
|
+
_.$_$.b = PrologTermParserVisitor;
|
|
616
|
+
_.$_$.c = parseStruct_0;
|
|
617
|
+
_.$_$.d = parseStructWithOperators_0;
|
|
618
|
+
_.$_$.e = termToClause;
|
|
619
|
+
_.$_$.f = toDefinition;
|
|
620
|
+
_.$_$.g = toOperatorTable;
|
|
621
|
+
_.$_$.h = toParseException;
|
|
11
622
|
//endregion
|
|
12
623
|
return _;
|
|
13
624
|
}));
|
package/2p-parser-core.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"ignoreList":[],"x_google_ignoreList":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"sources":["NATIVE_IMPLEMENTATIONS.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/TermParser.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/InvalidTermTypeException.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/ParseException.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/PrologTermParserVisitor.kt","src/kotlin/util/Preconditions.kt","common/src/generated/_Collections.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/TermParserExtensions.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/TermParserImpl.kt","../../../../../../../parser-core/src/commonMain/kotlin/it/unibo/tuprolog/core/parsing/Utils.kt"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null],"ignoreList":[0],"x_google_ignoreList":[0],"names":["parseTerm","input","parseStruct","operators","parseConstant","parseVar","parseAtom","parseNumeric","parseInteger","parseReal","parseClause","parseRule","parseFact","parseDirective","<init>","offendingSymbol","line","column","message","throwable","toString","result","visitTheory","node","visitOperator","visitNumber","signedDigits","visitVariable","visitStructure","visitList","visitBlock","withNoOperator","scope","withStandardOperators","withDefaultOperators","withOperators","toClause","<this>","parse","<get-defaultParser>","TermParserImpl$parseTerm$lambda$lambda","syntaxTree","visitor","defaultOperatorSet","toOperatorTable","toDefinition","toAssociativity","toParseException"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EC8DIA,mBAAcC,KAAdD,EAAqC;A,IAAoC,OAApC,4BAAU,KAAV,EAAiB,uCAAjB,C;EAAmC,C;EASxEE,kCACID,K,EACAE,SAFJD,EAGY;A;;QD1EhB,KC0EgB,IAiPJ,wBAjPY,KAiPZ,EAjPmB,SAiPnB,C;QACA,oD;QD5TZ,G;IC4TY,2B;MAAY,MAAM,6BAlPN,KAkPM,EAAgC,EAAhC,oB;;YAAlB,c;;IAlP6B,OAkP7B,G;EAlP4B,C;EAOpCA,qBAAgBD,KAAhBC,EAAyC;A,IAAsC,OAAtC,8BAAY,KAAZ,EAAmB,uCAAnB,C;EAAqC,C;EAS9EE,oCACIH,K,EACAE,SAFJC,EAGc;A;;QD7FlB,KC6FkB,IA8NN,wBA9Nc,KA8Nd,EA9NqB,SA8NrB,C;QACA,sD;QD5TZ,G;IC4TY,2B;MAAY,MAAM,6BA/NJ,KA+NI,EAAgC,EAAhC,sB;;YAAlB,c;;IA/N+B,OA+N/B,G;EA/N8B,C;EAOtCA,uBAAkBH,KAAlBG,EAA6C;A,IAAwC,OAAxC,gCAAc,KAAd,EAAqB,uCAArB,C;EAAuC,C;EASpFC,+BACIJ,K,EACAE,SAFJE,EAGS;A;;QDhHb,KCgHa,IA2MD,wBA3MS,KA2MT,EA3MgB,SA2MhB,C;QACA,iD;QD5TZ,G;IC4TY,2B;MAAY,MAAM,6BA5MT,KA4MS,EAAgC,EAAhC,iB;;YAAlB,c;;IA5M0B,OA4M1B,G;EA5MyB,C;EAOjCA,kBAAaJ,K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