occam-grammars 1.0.716 → 1.0.720
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/example.js +262 -653
- package/lib/basic/lexer.js +11 -24
- package/lib/basic/parser.js +11 -24
- package/lib/customGrammarBNF/lexer.js +11 -24
- package/lib/customGrammarBNF/parser.js +11 -24
- package/lib/customGrammarPattern/lexer.js +11 -24
- package/lib/customGrammarPattern/parser.js +11 -24
- package/lib/example/view/customGrammarBNF.js +11 -24
- package/lib/example/view/customGrammarPattern.js +11 -24
- package/lib/example/view/input/ruleName.js +11 -24
- package/lib/example/view/json.js +11 -24
- package/lib/example/view/plainText.js +11 -24
- package/lib/example/view/tex.js +11 -24
- package/lib/example/view/textarea/bnf.js +11 -24
- package/lib/example/view/textarea/content.js +11 -24
- package/lib/example/view/textarea/lexicalEntries.js +11 -24
- package/lib/example/view/textarea/parseTree.js +11 -24
- package/lib/example/view/textarea/tokens.js +11 -24
- package/lib/example/view.js +11 -25
- package/lib/florence/bnf.js +2 -2
- package/lib/florence/lexer.js +11 -24
- package/lib/florence/parser.js +11 -24
- package/lib/json/lexer.js +11 -24
- package/lib/json/parser.js +11 -24
- package/lib/plainText/lexer.js +11 -24
- package/lib/plainText/parser.js +11 -24
- package/lib/teX/lexer.js +11 -24
- package/lib/teX/parser.js +11 -24
- package/package.json +1 -1
- package/src/florence/bnf.js +12 -174
package/lib/teX/parser.js
CHANGED
|
@@ -16,6 +16,10 @@ function _assert_this_initialized(self) {
|
|
|
16
16
|
}
|
|
17
17
|
return self;
|
|
18
18
|
}
|
|
19
|
+
function _call_super(_this, derived, args) {
|
|
20
|
+
derived = _get_prototype_of(derived);
|
|
21
|
+
return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
|
|
22
|
+
}
|
|
19
23
|
function _class_call_check(instance, Constructor) {
|
|
20
24
|
if (!(instance instanceof Constructor)) {
|
|
21
25
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -90,35 +94,18 @@ function _type_of(obj) {
|
|
|
90
94
|
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
91
95
|
}
|
|
92
96
|
function _is_native_reflect_construct() {
|
|
93
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
94
|
-
if (Reflect.construct.sham) return false;
|
|
95
|
-
if (typeof Proxy === "function") return true;
|
|
96
97
|
try {
|
|
97
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
function _create_super(Derived) {
|
|
104
|
-
var hasNativeReflectConstruct = _is_native_reflect_construct();
|
|
105
|
-
return function _createSuperInternal() {
|
|
106
|
-
var Super = _get_prototype_of(Derived), result;
|
|
107
|
-
if (hasNativeReflectConstruct) {
|
|
108
|
-
var NewTarget = _get_prototype_of(this).constructor;
|
|
109
|
-
result = Reflect.construct(Super, arguments, NewTarget);
|
|
110
|
-
} else {
|
|
111
|
-
result = Super.apply(this, arguments);
|
|
112
|
-
}
|
|
113
|
-
return _possible_constructor_return(this, result);
|
|
114
|
-
};
|
|
98
|
+
var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
99
|
+
} catch (_) {}
|
|
100
|
+
return (_is_native_reflect_construct = function() {
|
|
101
|
+
return !!result;
|
|
102
|
+
})();
|
|
115
103
|
}
|
|
116
104
|
var TeXParser = /*#__PURE__*/ function(CommonParser) {
|
|
117
105
|
_inherits(TeXParser, CommonParser);
|
|
118
|
-
var _super = _create_super(TeXParser);
|
|
119
106
|
function TeXParser() {
|
|
120
107
|
_class_call_check(this, TeXParser);
|
|
121
|
-
return
|
|
108
|
+
return _call_super(this, TeXParser, arguments);
|
|
122
109
|
}
|
|
123
110
|
_create_class(TeXParser, null, [
|
|
124
111
|
{
|
|
@@ -144,4 +131,4 @@ var TeXParser = /*#__PURE__*/ function(CommonParser) {
|
|
|
144
131
|
}(_occamparsers.CommonParser);
|
|
145
132
|
_define_property(TeXParser, "bnf", _bnf.default);
|
|
146
133
|
|
|
147
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
134
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZVgvcGFyc2VyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgeyBDb21tb25QYXJzZXIgfSBmcm9tIFwib2NjYW0tcGFyc2Vyc1wiO1xuXG5pbXBvcnQgYm5mIGZyb20gXCIuL2JuZlwiO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBUZVhQYXJzZXIgZXh0ZW5kcyBDb21tb25QYXJzZXIge1xuICBzdGF0aWMgYm5mID0gYm5mO1xuXG4gIHN0YXRpYyBmcm9tTm90aGluZygpIHsgcmV0dXJuIENvbW1vblBhcnNlci5mcm9tTm90aGluZyhUZVhQYXJzZXIpOyB9XG5cbiAgc3RhdGljIGZyb21CTkYoYm5mKSB7IHJldHVybiBDb21tb25QYXJzZXIuZnJvbUJORihUZVhQYXJzZXIsIGJuZik7IH1cblxuICBzdGF0aWMgZnJvbVJ1bGVzKHJ1bGVzKSB7IHJldHVybiBDb21tb25QYXJzZXIuZnJvbVJ1bGVzKFRlWFBhcnNlciwgcnVsZXMpOyB9XG59XG4iXSwibmFtZXMiOlsiVGVYUGFyc2VyIiwiZnJvbU5vdGhpbmciLCJDb21tb25QYXJzZXIiLCJmcm9tQk5GIiwiYm5mIiwiZnJvbVJ1bGVzIiwicnVsZXMiXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7O2VBTXFCQTs7OzRCQUpROzBEQUViOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUVELElBQUEsQUFBTUEsMEJBQUQsQUFBTDtjQUFNQTthQUFBQTtnQ0FBQUE7aUNBQUFBOztrQkFBQUE7O1lBR1pDLEtBQUFBO21CQUFQLFNBQU9BO2dCQUFnQixPQUFPQywwQkFBWSxDQUFDRCxXQUFXLENBSG5DRDtZQUdnRDs7O1lBRTVERyxLQUFBQTttQkFBUCxTQUFPQSxRQUFRQyxHQUFHO2dCQUFJLE9BQU9GLDBCQUFZLENBQUNDLE9BQU8sQ0FMOUJILFdBSzBDSTtZQUFNOzs7WUFFNURDLEtBQUFBO21CQUFQLFNBQU9BLFVBQVVDLEtBQUs7Z0JBQUksT0FBT0osMEJBQVksQ0FBQ0csU0FBUyxDQVBwQ0wsV0FPZ0RNO1lBQVE7OztXQVB4RE47RUFBa0JFLDBCQUFZO0FBQ2pELGlCQURtQkYsV0FDWkksT0FBTUEsWUFBRyJ9
|
package/package.json
CHANGED
package/src/florence/bnf.js
CHANGED
|
@@ -70,35 +70,35 @@ rule ::= "Rule" "(" label ( "," label )* ")" <E
|
|
|
70
70
|
|
|
71
71
|
"Conclusion" <END_OF_LINE> conclusion
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
proof? ;
|
|
74
74
|
|
|
75
75
|
metaLemma ::= "MetaLemma" ( "(" label ( "," label )* ")" )? <END_OF_LINE>
|
|
76
76
|
|
|
77
77
|
(
|
|
78
78
|
|
|
79
|
-
"Suppose" <END_OF_LINE>
|
|
79
|
+
"Suppose" <END_OF_LINE> supposition+
|
|
80
80
|
|
|
81
81
|
"Then" <END_OF_LINE>
|
|
82
82
|
|
|
83
83
|
)?
|
|
84
84
|
|
|
85
|
-
|
|
85
|
+
consequent
|
|
86
86
|
|
|
87
|
-
|
|
87
|
+
proof ;
|
|
88
88
|
|
|
89
89
|
metatheorem ::= "Metatheorem" "(" label ( "," label )* ")" <END_OF_LINE>
|
|
90
90
|
|
|
91
91
|
(
|
|
92
92
|
|
|
93
|
-
"Suppose" <END_OF_LINE>
|
|
93
|
+
"Suppose" <END_OF_LINE> supposition+
|
|
94
94
|
|
|
95
95
|
"Then" <END_OF_LINE>
|
|
96
96
|
|
|
97
97
|
)?
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
consequent
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
proof ;
|
|
102
102
|
|
|
103
103
|
axiom ::= "Axiom" "(" label ( "," label )* ")" <END_OF_LINE>
|
|
104
104
|
|
|
@@ -156,52 +156,10 @@ conjecture ::= "Conjecture" "(" label ( "," label )*
|
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
|
|
159
|
-
ruleProof ::= "Proof" <END_OF_LINE> ruleDerivation ;
|
|
160
|
-
|
|
161
|
-
metaproof ::= "Proof" <END_OF_LINE> metaDerivation ;
|
|
162
|
-
|
|
163
159
|
proof ::= "Proof" <END_OF_LINE> derivation ;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
ruleSubproof ::= (
|
|
168
|
-
|
|
169
|
-
( "Premises" <END_OF_LINE> premise premise+ )
|
|
170
|
-
|
|
171
|
-
|
|
|
172
|
-
|
|
173
|
-
( "Premise" <END_OF_LINE> premise )
|
|
174
|
-
|
|
175
|
-
)
|
|
176
|
-
|
|
177
|
-
ruleSubDerivation ;
|
|
178
|
-
|
|
179
|
-
metaSubproof ::= "Suppose" <END_OF_LINE> metaSupposition+ metaSubDerivation ;
|
|
180
160
|
|
|
181
161
|
subproof ::= "Suppose" <END_OF_LINE> supposition+ subDerivation ;
|
|
182
162
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
ruleDerivation ::= (
|
|
186
|
-
|
|
187
|
-
ruleProofStep+
|
|
188
|
-
|
|
189
|
-
"Therefore" <END_OF_LINE>
|
|
190
|
-
|
|
191
|
-
)?
|
|
192
|
-
|
|
193
|
-
lastRuleProofStep ;
|
|
194
|
-
|
|
195
|
-
metaDerivation ::= (
|
|
196
|
-
|
|
197
|
-
metaproofStep+
|
|
198
|
-
|
|
199
|
-
"Therefore" <END_OF_LINE>
|
|
200
|
-
|
|
201
|
-
)?
|
|
202
|
-
|
|
203
|
-
lastMetaproofStep ;
|
|
204
|
-
|
|
205
163
|
derivation ::= (
|
|
206
164
|
|
|
207
165
|
proofStep+
|
|
@@ -212,36 +170,10 @@ derivation ::= (
|
|
|
212
170
|
|
|
213
171
|
lastProofStep ;
|
|
214
172
|
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
ruleSubDerivation ::= (
|
|
218
|
-
|
|
219
|
-
"Hence" <END_OF_LINE>
|
|
220
|
-
|
|
221
|
-
ruleProofStep+
|
|
222
|
-
|
|
223
|
-
)?
|
|
224
|
-
|
|
225
|
-
"Then" <END_OF_LINE>
|
|
226
|
-
|
|
227
|
-
lastRuleProofStep ;
|
|
228
|
-
|
|
229
|
-
metaSubDerivation ::= (
|
|
230
|
-
|
|
231
|
-
"Hence" <END_OF_LINE>
|
|
232
|
-
|
|
233
|
-
metaproofStep+
|
|
234
|
-
|
|
235
|
-
)?
|
|
236
|
-
|
|
237
|
-
"Then" <END_OF_LINE>
|
|
238
|
-
|
|
239
|
-
lastMetaproofStep ;
|
|
240
|
-
|
|
241
173
|
subDerivation ::= (
|
|
242
174
|
|
|
243
175
|
"Hence" <END_OF_LINE>
|
|
244
|
-
|
|
176
|
+
|
|
245
177
|
proofStep+
|
|
246
178
|
|
|
247
179
|
)?
|
|
@@ -250,77 +182,13 @@ subDerivation ::= (
|
|
|
250
182
|
|
|
251
183
|
lastProofStep ;
|
|
252
184
|
|
|
185
|
+
premise.. ::= unqualifiedStatement | nonsense ;
|
|
253
186
|
|
|
187
|
+
conclusion.. ::= unqualifiedStatement | nonsense ;
|
|
254
188
|
|
|
255
|
-
|
|
189
|
+
supposition.. ::= unqualifiedStatement | nonsense ;
|
|
256
190
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
| nonsense
|
|
260
|
-
|
|
261
|
-
;
|
|
262
|
-
|
|
263
|
-
conclusion.. ::= unqualifiedMetastatement
|
|
264
|
-
|
|
265
|
-
| unqualifiedStatement
|
|
266
|
-
|
|
267
|
-
| nonsense
|
|
268
|
-
|
|
269
|
-
;
|
|
270
|
-
|
|
271
|
-
metaSupposition.. ::= unqualifiedMetastatement
|
|
272
|
-
|
|
273
|
-
| unqualifiedStatement
|
|
274
|
-
|
|
275
|
-
| nonsense
|
|
276
|
-
|
|
277
|
-
;
|
|
278
|
-
|
|
279
|
-
metaConsequent.. ::= unqualifiedMetastatement
|
|
280
|
-
|
|
281
|
-
| unqualifiedStatement
|
|
282
|
-
|
|
283
|
-
| nonsense
|
|
284
|
-
|
|
285
|
-
;
|
|
286
|
-
|
|
287
|
-
supposition.. ::= unqualifiedStatement
|
|
288
|
-
|
|
289
|
-
| nonsense ;
|
|
290
|
-
|
|
291
|
-
consequent.. ::= unqualifiedStatement
|
|
292
|
-
|
|
293
|
-
| nonsense ;
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
ruleProofStep.. ::= unqualifiedMetastatement
|
|
298
|
-
|
|
299
|
-
| qualifiedMetastatement
|
|
300
|
-
|
|
301
|
-
| unqualifiedStatement
|
|
302
|
-
|
|
303
|
-
| qualifiedStatement
|
|
304
|
-
|
|
305
|
-
| ruleSubproof
|
|
306
|
-
|
|
307
|
-
| nonsense
|
|
308
|
-
|
|
309
|
-
;
|
|
310
|
-
|
|
311
|
-
metaproofStep.. ::= unqualifiedMetastatement
|
|
312
|
-
|
|
313
|
-
| qualifiedMetastatement
|
|
314
|
-
|
|
315
|
-
| unqualifiedStatement
|
|
316
|
-
|
|
317
|
-
| qualifiedStatement
|
|
318
|
-
|
|
319
|
-
| metaSubproof
|
|
320
|
-
|
|
321
|
-
| nonsense
|
|
322
|
-
|
|
323
|
-
;
|
|
191
|
+
consequent.. ::= unqualifiedStatement | nonsense ;
|
|
324
192
|
|
|
325
193
|
proofStep.. ::= unqualifiedStatement
|
|
326
194
|
|
|
@@ -332,32 +200,6 @@ proofStep.. ::= unqualifiedStatement
|
|
|
332
200
|
|
|
333
201
|
;
|
|
334
202
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
lastRuleProofStep.. ::= unqualifiedMetastatement
|
|
338
|
-
|
|
339
|
-
| qualifiedMetastatement
|
|
340
|
-
|
|
341
|
-
| unqualifiedStatement
|
|
342
|
-
|
|
343
|
-
| qualifiedStatement
|
|
344
|
-
|
|
345
|
-
| nonsense
|
|
346
|
-
|
|
347
|
-
;
|
|
348
|
-
|
|
349
|
-
lastMetaproofStep.. ::= unqualifiedMetastatement
|
|
350
|
-
|
|
351
|
-
| qualifiedMetastatement
|
|
352
|
-
|
|
353
|
-
| unqualifiedStatement
|
|
354
|
-
|
|
355
|
-
| qualifiedStatement
|
|
356
|
-
|
|
357
|
-
| nonsense
|
|
358
|
-
|
|
359
|
-
;
|
|
360
|
-
|
|
361
203
|
lastProofStep.. ::= unqualifiedStatement
|
|
362
204
|
|
|
363
205
|
| qualifiedStatement
|
|
@@ -368,10 +210,6 @@ lastProofStep.. ::= unqualifiedStatement
|
|
|
368
210
|
|
|
369
211
|
|
|
370
212
|
|
|
371
|
-
unqualifiedMetastatement ::= metastatement... <END_OF_LINE>;
|
|
372
|
-
|
|
373
|
-
qualifiedMetastatement ::= metastatement... ( "by" | "from" ) reference <END_OF_LINE> ;
|
|
374
|
-
|
|
375
213
|
unqualifiedStatement ::= statement... <END_OF_LINE> ;
|
|
376
214
|
|
|
377
215
|
qualifiedStatement ::= statement... ( "by" | "from" ) reference <END_OF_LINE> ;
|