occam-grammars 1.0.714 → 1.0.718
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 +7 -61
package/lib/teX/lexer.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 TeXLexer = /*#__PURE__*/ function(CommonLexer) {
|
|
117
105
|
_inherits(TeXLexer, CommonLexer);
|
|
118
|
-
var _super = _create_super(TeXLexer);
|
|
119
106
|
function TeXLexer() {
|
|
120
107
|
_class_call_check(this, TeXLexer);
|
|
121
|
-
return
|
|
108
|
+
return _call_super(this, TeXLexer, arguments);
|
|
122
109
|
}
|
|
123
110
|
_create_class(TeXLexer, null, [
|
|
124
111
|
{
|
|
@@ -154,4 +141,4 @@ _define_property(TeXLexer, "MiddleOfMultiLineCommentToken", null);
|
|
|
154
141
|
_define_property(TeXLexer, "SinglyQuotedStringLiteralToken", null);
|
|
155
142
|
_define_property(TeXLexer, "DoublyQuotedStringLiteralToken", null);
|
|
156
143
|
|
|
157
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
144
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZVgvbGV4ZXIuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XHJcblxyXG5pbXBvcnQgeyBDb21tb25MZXhlciwgV2hpdGVzcGFjZVRva2VuLCBFbmRPZkxpbmVOb25TaWduaWZpY2FudFRva2VuIH0gZnJvbSBcIm9jY2FtLWxleGVyc1wiO1xyXG5cclxuaW1wb3J0IGVudHJpZXMgZnJvbSBcIi4vZW50cmllc1wiO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgY2xhc3MgVGVYTGV4ZXIgZXh0ZW5kcyBDb21tb25MZXhlciB7XHJcbiAgc3RhdGljIGVudHJpZXMgPSBlbnRyaWVzO1xyXG5cclxuICBzdGF0aWMgRW5kT2ZMaW5lVG9rZW4gPSBFbmRPZkxpbmVOb25TaWduaWZpY2FudFRva2VuO1xyXG5cclxuICBzdGF0aWMgV2hpdGVzcGFjZVRva2VuID0gV2hpdGVzcGFjZVRva2VuO1xyXG5cclxuICBzdGF0aWMgRW5kT2ZMaW5lQ29tbWVudFRva2VuID0gbnVsbDtcclxuXHJcbiAgc3RhdGljIFNpbmdsZUxpbmVDb21tZW50VG9rZW4gPSBudWxsO1xyXG5cclxuICBzdGF0aWMgUmVndWxhckV4cHJlc3Npb25Ub2tlbiA9IG51bGw7XHJcblxyXG4gIHN0YXRpYyBFbmRPZk11bHRpTGluZUNvbW1lbnRUb2tlbiA9IG51bGw7XHJcblxyXG4gIHN0YXR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RXRDLGlCQWpCbUJkLFVBaUJaZSxpQ0FBZ0M7QUFFdkMsaUJBbkJtQmYsVUFtQlpnQixrQ0FBaUM7QUFFeEMsaUJBckJtQmhCLFVBcUJaaUIsa0NBQWlDIn0=
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZVgvcGFyc2VyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbIlwidXNlIHN0cmljdFwiO1xuXG5pbXBvcnQgeyBDb21tb25QYXJzZXIgfSBmcm9tIFwib2NjYW0tcGFyc2Vyc1wiO1xuXG5pbXBvcnQgYm5mIGZyb20gXCIuL2JuZlwiO1xuXG5leHBvcnQgZGVmYXVsdCBjbGFzcyBUZVhQYXJzZXIgZXh0ZW5kcyBDb21tb25QYXJzZXIge1xuICBzdGF0aWMgYm5mID0gYm5mO1xuXG4gIHN0YXRpYyBmcm9tTm90aGluZygpIHsgcmV0dXJuIENvbW1vblBhcnNlci5mcm9tTm90aGluZyhUZVhQYXJzZXIpOyB9XG5cbiAgc3RhdGljIGZyb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"(" label ( "," label )* ")" <E
|
|
|
70
70
|
|
|
71
71
|
"Conclusion" <END_OF_LINE> conclusion
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
metaproof? ;
|
|
74
74
|
|
|
75
75
|
metaLemma ::= "MetaLemma" ( "(" label ( "," label )* ")" )? <END_OF_LINE>
|
|
76
76
|
|
|
@@ -156,42 +156,18 @@ conjecture ::= "Conjecture" "(" label ( "," label )*
|
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
|
|
159
|
-
ruleProof ::= "Proof" <END_OF_LINE> ruleDerivation ;
|
|
160
|
-
|
|
161
159
|
metaproof ::= "Proof" <END_OF_LINE> metaDerivation ;
|
|
162
160
|
|
|
163
161
|
proof ::= "Proof" <END_OF_LINE> derivation ;
|
|
164
162
|
|
|
165
163
|
|
|
166
164
|
|
|
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
165
|
metaSubproof ::= "Suppose" <END_OF_LINE> metaSupposition+ metaSubDerivation ;
|
|
180
166
|
|
|
181
167
|
subproof ::= "Suppose" <END_OF_LINE> supposition+ subDerivation ;
|
|
182
168
|
|
|
183
169
|
|
|
184
170
|
|
|
185
|
-
ruleDerivation ::= (
|
|
186
|
-
|
|
187
|
-
ruleProofStep+
|
|
188
|
-
|
|
189
|
-
"Therefore" <END_OF_LINE>
|
|
190
|
-
|
|
191
|
-
)?
|
|
192
|
-
|
|
193
|
-
lastRuleProofStep ;
|
|
194
|
-
|
|
195
171
|
metaDerivation ::= (
|
|
196
172
|
|
|
197
173
|
metaproofStep+
|
|
@@ -214,18 +190,6 @@ derivation ::= (
|
|
|
214
190
|
|
|
215
191
|
|
|
216
192
|
|
|
217
|
-
ruleSubDerivation ::= (
|
|
218
|
-
|
|
219
|
-
"Hence" <END_OF_LINE>
|
|
220
|
-
|
|
221
|
-
ruleProofStep+
|
|
222
|
-
|
|
223
|
-
)?
|
|
224
|
-
|
|
225
|
-
"Then" <END_OF_LINE>
|
|
226
|
-
|
|
227
|
-
lastRuleProofStep ;
|
|
228
|
-
|
|
229
193
|
metaSubDerivation ::= (
|
|
230
194
|
|
|
231
195
|
"Hence" <END_OF_LINE>
|
|
@@ -294,20 +258,6 @@ consequent.. ::= unqualifiedStatement
|
|
|
294
258
|
|
|
295
259
|
|
|
296
260
|
|
|
297
|
-
ruleProofStep.. ::= unqualifiedMetastatement
|
|
298
|
-
|
|
299
|
-
| qualifiedMetastatement
|
|
300
|
-
|
|
301
|
-
| unqualifiedStatement
|
|
302
|
-
|
|
303
|
-
| qualifiedStatement
|
|
304
|
-
|
|
305
|
-
| ruleSubproof
|
|
306
|
-
|
|
307
|
-
| nonsense
|
|
308
|
-
|
|
309
|
-
;
|
|
310
|
-
|
|
311
261
|
metaproofStep.. ::= unqualifiedMetastatement
|
|
312
262
|
|
|
313
263
|
| qualifiedMetastatement
|
|
@@ -334,18 +284,14 @@ proofStep.. ::= unqualifiedStatement
|
|
|
334
284
|
|
|
335
285
|
|
|
336
286
|
|
|
337
|
-
lastRuleProofStep.. ::= unqualifiedMetastatement
|
|
338
|
-
|
|
339
|
-
| qualifiedMetastatement
|
|
340
|
-
|
|
341
|
-
| nonsense
|
|
342
|
-
|
|
343
|
-
;
|
|
344
|
-
|
|
345
287
|
lastMetaproofStep.. ::= unqualifiedMetastatement
|
|
346
|
-
|
|
347
|
-
| qualifiedMetastatement
|
|
348
288
|
|
|
289
|
+
| qualifiedMetastatement
|
|
290
|
+
|
|
291
|
+
| unqualifiedStatement
|
|
292
|
+
|
|
293
|
+
| qualifiedStatement
|
|
294
|
+
|
|
349
295
|
| nonsense
|
|
350
296
|
|
|
351
297
|
;
|