occam-verify-cli 1.0.936 → 1.0.938
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/lib/element/assertion/contained.js +3 -2
- package/lib/element/assertion/defined.js +3 -2
- package/lib/element/assertion/property.js +3 -2
- package/lib/element/assertion/signature.js +3 -2
- package/lib/element/assertion/subproof.js +3 -2
- package/lib/element/assertion/type.js +9 -3
- package/lib/element/assertion.js +8 -2
- package/lib/element/assumption/metaLevel.js +9 -3
- package/lib/element/assumption.js +10 -4
- package/lib/element/combinator.js +9 -3
- package/lib/element/conclusion.js +9 -3
- package/lib/element/constructor.js +10 -4
- package/lib/element/deduction.js +9 -3
- package/lib/element/equality.js +9 -3
- package/lib/element/frame.js +9 -3
- package/lib/element/hypothesis.js +9 -3
- package/lib/element/judgement.js +9 -3
- package/lib/element/label.js +9 -3
- package/lib/element/metaType.js +8 -2
- package/lib/element/metavariable.js +10 -4
- package/lib/element/parameter.js +9 -3
- package/lib/element/procedureCall.js +9 -3
- package/lib/element/procedureReference.js +9 -3
- package/lib/element/proofAssertion/premise.js +9 -3
- package/lib/element/proofAssertion/supposition.js +9 -3
- package/lib/element/property.js +9 -3
- package/lib/element/propertyRelation.js +9 -3
- package/lib/element/reference.js +9 -3
- package/lib/element/rule.js +9 -3
- package/lib/element/signature.js +10 -5
- package/lib/element/statement.js +10 -4
- package/lib/element/substitution/frame.js +4 -3
- package/lib/element/substitution/reference.js +4 -3
- package/lib/element/substitution/statement.js +4 -3
- package/lib/element/substitution/term.js +4 -3
- package/lib/element/substitution.js +8 -2
- package/lib/element/term.js +9 -3
- package/lib/element/topLevelAssertion.js +8 -2
- package/lib/element/topLevelMetaAssertion.js +8 -2
- package/lib/element/type.js +9 -3
- package/lib/element/typePrefix.js +9 -3
- package/lib/element/variable.js +9 -3
- package/lib/utilities/breakPoint.js +38 -0
- package/package.json +4 -4
- package/src/element/assertion/contained.js +3 -1
- package/src/element/assertion/defined.js +3 -1
- package/src/element/assertion/property.js +3 -1
- package/src/element/assertion/signature.js +3 -1
- package/src/element/assertion/subproof.js +5 -3
- package/src/element/assertion/type.js +14 -4
- package/src/element/assertion.js +17 -7
- package/src/element/assumption/metaLevel.js +18 -8
- package/src/element/assumption.js +18 -8
- package/src/element/combinator.js +18 -8
- package/src/element/conclusion.js +18 -8
- package/src/element/constructor.js +15 -5
- package/src/element/deduction.js +18 -8
- package/src/element/equality.js +17 -7
- package/src/element/frame.js +17 -7
- package/src/element/hypothesis.js +18 -8
- package/src/element/judgement.js +17 -7
- package/src/element/label.js +18 -8
- package/src/element/metaType.js +15 -6
- package/src/element/metavariable.js +19 -9
- package/src/element/parameter.js +17 -7
- package/src/element/procedureCall.js +17 -7
- package/src/element/procedureReference.js +17 -7
- package/src/element/proofAssertion/premise.js +18 -8
- package/src/element/proofAssertion/supposition.js +18 -8
- package/src/element/property.js +14 -4
- package/src/element/propertyRelation.js +17 -7
- package/src/element/reference.js +18 -8
- package/src/element/rule.js +14 -4
- package/src/element/signature.js +18 -9
- package/src/element/statement.js +19 -9
- package/src/element/substitution/frame.js +3 -1
- package/src/element/substitution/reference.js +3 -1
- package/src/element/substitution/statement.js +3 -1
- package/src/element/substitution/term.js +3 -1
- package/src/element/substitution.js +17 -8
- package/src/element/term.js +14 -4
- package/src/element/topLevelAssertion.js +12 -3
- package/src/element/topLevelMetaAssertion.js +12 -3
- package/src/element/type.js +17 -7
- package/src/element/typePrefix.js +17 -7
- package/src/element/variable.js +14 -4
- package/src/utilities/breakPoint.js +29 -0
package/src/element/signature.js
CHANGED
|
@@ -4,8 +4,8 @@ import { Element } from "occam-languages";
|
|
|
4
4
|
import { arrayUtilities } from "necessary";
|
|
5
5
|
|
|
6
6
|
import { define } from "../elements";
|
|
7
|
-
import { instantiateSignature } from "../process/instantiate";
|
|
8
7
|
import { signatureFromSignatureNode } from "../utilities/element";
|
|
8
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
9
9
|
import { join, ablate, attempt, reconcile, serialise, unserialise, instantiate } from "../utilities/context";
|
|
10
10
|
|
|
11
11
|
const { match } = arrayUtilities;
|
|
@@ -233,13 +233,21 @@ export default define(class Signature extends Element {
|
|
|
233
233
|
const context = this.getContext();
|
|
234
234
|
|
|
235
235
|
return serialise((context) => {
|
|
236
|
-
const string = this.getString()
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
236
|
+
const string = this.getString();
|
|
237
|
+
|
|
238
|
+
let breakPoint;
|
|
239
|
+
|
|
240
|
+
breakPoint = this.getBreakPoint();
|
|
241
|
+
|
|
242
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
243
|
+
|
|
244
|
+
breakPoint = breakPointJSON; ///
|
|
245
|
+
|
|
246
|
+
const json = {
|
|
247
|
+
context,
|
|
248
|
+
string,
|
|
249
|
+
breakPoint
|
|
250
|
+
};
|
|
243
251
|
|
|
244
252
|
return json;
|
|
245
253
|
}, context);
|
|
@@ -250,9 +258,10 @@ export default define(class Signature extends Element {
|
|
|
250
258
|
|
|
251
259
|
unserialise((json, context) => {
|
|
252
260
|
instantiate((context) => {
|
|
253
|
-
const { string
|
|
261
|
+
const { string } = json,
|
|
254
262
|
signatureNode = instantiateSignature(string, context),
|
|
255
263
|
node = signatureNode, ///
|
|
264
|
+
breakPoint = breakPointFromJSON(json),
|
|
256
265
|
terms = termsFromSignatureNode(signatureNode, context);
|
|
257
266
|
|
|
258
267
|
signature = new Signature(context, string, node, breakPoint, terms);
|
package/src/element/statement.js
CHANGED
|
@@ -5,8 +5,9 @@ import { Element } from "occam-languages";
|
|
|
5
5
|
import { define } from "../elements";
|
|
6
6
|
import { unifyStatement } from "../process/unify";
|
|
7
7
|
import { validateStatements } from "../utilities/validation";
|
|
8
|
-
import { instantiateStatement } from "../process/instantiate";
|
|
9
8
|
import { reconcile, instantiate } from "../utilities/context";
|
|
9
|
+
import { instantiateStatement } from "../process/instantiate";
|
|
10
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
10
11
|
|
|
11
12
|
export default define(class Statement extends Element {
|
|
12
13
|
getStatementNode() {
|
|
@@ -393,21 +394,30 @@ export default define(class Statement extends Element {
|
|
|
393
394
|
static name = "Statement";
|
|
394
395
|
|
|
395
396
|
toJSON() {
|
|
396
|
-
const string = this.getString()
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
397
|
+
const string = this.getString();
|
|
398
|
+
|
|
399
|
+
let breakPoint;
|
|
400
|
+
|
|
401
|
+
breakPoint = this.getBreakPoint();
|
|
402
|
+
|
|
403
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
404
|
+
|
|
405
|
+
breakPoint = breakPointJSON; ///
|
|
406
|
+
|
|
407
|
+
const json = {
|
|
408
|
+
string,
|
|
409
|
+
breakPoint
|
|
410
|
+
};
|
|
402
411
|
|
|
403
412
|
return json;
|
|
404
413
|
}
|
|
405
414
|
|
|
406
415
|
static fromJSON(json, context) {
|
|
407
416
|
return instantiate((context) => {
|
|
408
|
-
const { string
|
|
417
|
+
const { string } = json,
|
|
409
418
|
statementNode = instantiateStatement(string, context),
|
|
410
|
-
node = statementNode
|
|
419
|
+
node = statementNode, ///
|
|
420
|
+
breakPoint = breakPointFromJSON(json);
|
|
411
421
|
|
|
412
422
|
context = null;
|
|
413
423
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
|
+
import { breakPointFromJSON } from "../../utilities/breakPoint";
|
|
6
7
|
import { instantiateFrameSubstitution } from "../../process/instantiate";
|
|
7
8
|
import { frameSubstitutionFromFrameSubstitutionNode } from "../../utilities/element";
|
|
8
9
|
import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
|
|
@@ -195,7 +196,7 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
195
196
|
const context = specificContext; ///
|
|
196
197
|
|
|
197
198
|
instantiate((context) => {
|
|
198
|
-
const { string
|
|
199
|
+
const { string } = json,
|
|
199
200
|
specificContext = context, ///
|
|
200
201
|
contexts = [
|
|
201
202
|
generalContext,
|
|
@@ -203,6 +204,7 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
203
204
|
],
|
|
204
205
|
frameSubstitutionNode = instantiateFrameSubstitution(string, context),
|
|
205
206
|
node = frameSubstitutionNode, ///
|
|
207
|
+
breakPoint = breakPointFromJSON(json),
|
|
206
208
|
targetFrame = targetFrameFromFrameSubstitutionNode(frameSubstitutionNode, context),
|
|
207
209
|
replacementFrame = replacementFrameFromFrameSubstitutionNode(frameSubstitutionNode, context);
|
|
208
210
|
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
|
+
import { breakPointFromJSON } from "../../utilities/breakPoint";
|
|
6
7
|
import { instantiateReferenceSubstitution } from "../../process/instantiate";
|
|
7
8
|
import { referenceSubstitutionFromReferenceSubstitutionNode } from "../../utilities/element";
|
|
8
9
|
import { referenceSubstitutionStringFromReferenceAndMetavariable } from "../../utilities/string";
|
|
@@ -200,7 +201,7 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
200
201
|
const context = specificContext; ///
|
|
201
202
|
|
|
202
203
|
instantiate((context) => {
|
|
203
|
-
const { string
|
|
204
|
+
const { string } = json,
|
|
204
205
|
specificContext = context, ///
|
|
205
206
|
contexts = [
|
|
206
207
|
generalContext,
|
|
@@ -208,6 +209,7 @@ export default define(class ReferenceSubstitution extends Substitution {
|
|
|
208
209
|
],
|
|
209
210
|
referenceSubstitutionNode = instantiateReferenceSubstitution(string, context),
|
|
210
211
|
node = referenceSubstitutionNode, ///
|
|
212
|
+
breakPoint = breakPointFromJSON(json),
|
|
211
213
|
targetReference = targetReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context),
|
|
212
214
|
replacementReference = replacementReferenceFromReferenceSubstitutionNode(referenceSubstitutionNode, context);
|
|
213
215
|
|
|
@@ -5,6 +5,7 @@ import Substitution from "../substitution";
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
6
|
import { unifySubstitution } from "../../process/unify";
|
|
7
7
|
import { stripBracketsFromStatement } from "../../utilities/brackets";
|
|
8
|
+
import { breakPointFromJSON } from "../../utilities/breakPoint";
|
|
8
9
|
import { instantiateStatementSubstitution } from "../../process/instantiate";
|
|
9
10
|
import { statementSubstitutionFromStatementSubstitutionNode } from "../../utilities/element";
|
|
10
11
|
import { join, ablates, manifest, attempts, descend, reconcile, instantiate, unserialises } from "../../utilities/context";
|
|
@@ -360,7 +361,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
360
361
|
const context = specificContext; ///
|
|
361
362
|
|
|
362
363
|
instantiate((context) => {
|
|
363
|
-
const { string
|
|
364
|
+
const { string } = json,
|
|
364
365
|
specificContext = context, ///
|
|
365
366
|
contexts = [
|
|
366
367
|
generalContext,
|
|
@@ -368,6 +369,7 @@ export default define(class StatementSubstitution extends Substitution {
|
|
|
368
369
|
],
|
|
369
370
|
statementSubstitutionNode = instantiateStatementSubstitution(string, context),
|
|
370
371
|
node = statementSubstitutionNode, ///
|
|
372
|
+
breakPoint = breakPointFromJSON(json),
|
|
371
373
|
resolved = resolvedFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
372
374
|
substitution = substitutionFromStatementSubstitutionNode(statementSubstitutionNode, generalContext, specificContext),
|
|
373
375
|
targetStatement = targetStatementFromStatementSubstitutionNode(statementSubstitutionNode, context),
|
|
@@ -4,6 +4,7 @@ import Substitution from "../substitution";
|
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
6
|
import { stripBracketsFromTerm } from "../../utilities/brackets";
|
|
7
|
+
import { breakPointFromJSON } from "../../utilities/breakPoint";
|
|
7
8
|
import { instantiateTermSubstitution } from "../../process/instantiate";
|
|
8
9
|
import { termSubstitutionFromTermSubstitutionNode } from "../../utilities/element";
|
|
9
10
|
import { termSubstitutionStringFromTermAndVariable } from "../../utilities/string";
|
|
@@ -204,7 +205,7 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
204
205
|
const context = specificContext; ///
|
|
205
206
|
|
|
206
207
|
instantiate((context) => {
|
|
207
|
-
const { string
|
|
208
|
+
const { string } = json,
|
|
208
209
|
specificContext = context, ///
|
|
209
210
|
contexts = [
|
|
210
211
|
generalContext,
|
|
@@ -212,6 +213,7 @@ export default define(class TermSubstitution extends Substitution {
|
|
|
212
213
|
],
|
|
213
214
|
termSubstitutionNode = instantiateTermSubstitution(string, context),
|
|
214
215
|
node = termSubstitutionNode, ///
|
|
216
|
+
breakPoint = breakPointFromJSON(json),
|
|
215
217
|
targetTerm = targetTermFromTermSubstitutionNode(termSubstitutionNode, context),
|
|
216
218
|
replacementTerm = replacementTermFromTermSubstitutionNode(termSubstitutionNode, context);
|
|
217
219
|
|
|
@@ -4,6 +4,7 @@ import { arrayUtilities } from "necessary";
|
|
|
4
4
|
|
|
5
5
|
import { serialises } from "../utilities/context";
|
|
6
6
|
import { primitiveUtilities } from "occam-furtle";
|
|
7
|
+
import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
7
8
|
|
|
8
9
|
const { first, second } = arrayUtilities,
|
|
9
10
|
{ primitiveFromNode } =primitiveUtilities;
|
|
@@ -243,14 +244,22 @@ export default class Substitution extends Element {
|
|
|
243
244
|
|
|
244
245
|
return serialises((...contexts) => {
|
|
245
246
|
const name = this.getName(),
|
|
246
|
-
string = this.getString()
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
247
|
+
string = this.getString();
|
|
248
|
+
|
|
249
|
+
let breakPoint;
|
|
250
|
+
|
|
251
|
+
breakPoint = this.getBreakPoint();
|
|
252
|
+
|
|
253
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
254
|
+
|
|
255
|
+
breakPoint = breakPointJSON; ///
|
|
256
|
+
|
|
257
|
+
const json = {
|
|
258
|
+
name,
|
|
259
|
+
contexts,
|
|
260
|
+
string,
|
|
261
|
+
breakPoint
|
|
262
|
+
};
|
|
254
263
|
|
|
255
264
|
return json;
|
|
256
265
|
}, ...contexts);
|
package/src/element/term.js
CHANGED
|
@@ -9,6 +9,7 @@ import { validateTerms } from "../utilities/validation";
|
|
|
9
9
|
import { instantiateTerm } from "../process/instantiate";
|
|
10
10
|
import { variablesFromTerm } from "../utilities/equivalence";
|
|
11
11
|
import { unifyTermIntrinsically } from "../process/unify";
|
|
12
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
12
13
|
import { typeFromJSON, typeToTypeJSON, provisionalFromJSON, provisionalToProvisionalJSON } from "../utilities/json";
|
|
13
14
|
|
|
14
15
|
const { filter } = arrayUtilities;
|
|
@@ -288,9 +289,17 @@ export default define(class Term extends Element {
|
|
|
288
289
|
toJSON() {
|
|
289
290
|
const typeJSON = typeToTypeJSON(this.type),
|
|
290
291
|
provisionalJSON = provisionalToProvisionalJSON(this.provisional),
|
|
291
|
-
string = this.getString()
|
|
292
|
-
|
|
293
|
-
|
|
292
|
+
string = this.getString();
|
|
293
|
+
|
|
294
|
+
let breakPoint;
|
|
295
|
+
|
|
296
|
+
breakPoint = this.getBreakPoint();
|
|
297
|
+
|
|
298
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
299
|
+
|
|
300
|
+
breakPoint = breakPointJSON; ///
|
|
301
|
+
|
|
302
|
+
const type = typeJSON, ///
|
|
294
303
|
provisional = provisionalJSON, ///
|
|
295
304
|
json = {
|
|
296
305
|
string,
|
|
@@ -306,9 +315,10 @@ export default define(class Term extends Element {
|
|
|
306
315
|
|
|
307
316
|
static fromJSON(json, context) {
|
|
308
317
|
return instantiate((context) => {
|
|
309
|
-
const { string
|
|
318
|
+
const { string } = json,
|
|
310
319
|
termNode = instantiateTerm(string, context),
|
|
311
320
|
node = termNode, ///
|
|
321
|
+
breakPoint = breakPointFromJSON(json),
|
|
312
322
|
type = typeFromJSON(json, context),
|
|
313
323
|
provisional = provisionalFromJSON(json, context);
|
|
314
324
|
|
|
@@ -4,6 +4,7 @@ import { arrayUtilities } from "necessary";
|
|
|
4
4
|
import { Element, asynchronousUtilities } from "occam-languages";
|
|
5
5
|
|
|
6
6
|
import { enclose } from "../utilities/context";
|
|
7
|
+
import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
7
8
|
import { topLevelAssertionStringFromLabelsSignatureSuppositionsAndDeduction } from "../utilities/string";
|
|
8
9
|
import { labelsFromJSON,
|
|
9
10
|
deductionFromJSON,
|
|
@@ -353,9 +354,17 @@ export default class TopLevelAssertion extends Element {
|
|
|
353
354
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
354
355
|
signatureJSON = signatureToSignatureJSON(this.signature),
|
|
355
356
|
hypothesesJSON = hypothesesToHypothesesJSON(this.hypotheses),
|
|
356
|
-
string = this.getString()
|
|
357
|
-
|
|
358
|
-
|
|
357
|
+
string = this.getString();
|
|
358
|
+
|
|
359
|
+
let breakPoint;
|
|
360
|
+
|
|
361
|
+
breakPoint = this.getBreakPoint();
|
|
362
|
+
|
|
363
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
364
|
+
|
|
365
|
+
breakPoint = breakPointJSON; ///
|
|
366
|
+
|
|
367
|
+
const labels = labelsJSON, ///
|
|
359
368
|
deduction = deductionJSON, ///
|
|
360
369
|
suppositions = suppositionsJSON, ///
|
|
361
370
|
signature = signatureJSON, ///
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Element, asynchronousUtilities } from "occam-languages";
|
|
4
4
|
|
|
5
5
|
import { enclose } from "../utilities/context";
|
|
6
|
+
import { breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
6
7
|
import { topLevelMetaAssertionStringFromLabelSuppositionsAndDeduction } from "../utilities/string";
|
|
7
8
|
import { labelFromJSON,
|
|
8
9
|
labelToLabelJSON,
|
|
@@ -233,9 +234,17 @@ export default class TopLevelMetaAssertion extends Element {
|
|
|
233
234
|
deductionJSON = deductionToDeductionJSON(this.deduction),
|
|
234
235
|
suppositionsJSON = suppositionsToSuppositionsJSON(this.suppositions),
|
|
235
236
|
metaLevelAssumptionsJSON = metaLevelAssumptionsToMetaLevelAssumptionsJSON(this.metaLevelAssumptions),
|
|
236
|
-
string = this.getString()
|
|
237
|
-
|
|
238
|
-
|
|
237
|
+
string = this.getString();
|
|
238
|
+
|
|
239
|
+
let breakPoint;
|
|
240
|
+
|
|
241
|
+
breakPoint = this.getBreakPoint();
|
|
242
|
+
|
|
243
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
244
|
+
|
|
245
|
+
breakPoint = breakPointJSON; ///
|
|
246
|
+
|
|
247
|
+
const label = labelJSON, ///
|
|
239
248
|
deduction = deductionJSON, ///
|
|
240
249
|
suppositions = suppositionsJSON, ///
|
|
241
250
|
metaLevelAssumptions = metaLevelAssumptionsJSON, ///
|
package/src/element/type.js
CHANGED
|
@@ -8,6 +8,7 @@ import { instantiate } from "../utilities/context";
|
|
|
8
8
|
import { instantiateType } from "../process/instantiate";
|
|
9
9
|
import { nameFromTypeNode } from "../utilities/element";
|
|
10
10
|
import { baseTypeFromNothing } from "../utilities/type";
|
|
11
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
11
12
|
import { propertiesFromJSON,
|
|
12
13
|
prefixNameFromJSON,
|
|
13
14
|
superTypesFromJSON,
|
|
@@ -297,12 +298,20 @@ export default define(class Type extends Element {
|
|
|
297
298
|
}
|
|
298
299
|
|
|
299
300
|
toJSON(abridged = false) {
|
|
300
|
-
const string = this.getString()
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
301
|
+
const string = this.getString();
|
|
302
|
+
|
|
303
|
+
let breakPoint;
|
|
304
|
+
|
|
305
|
+
breakPoint = this.getBreakPoint();
|
|
306
|
+
|
|
307
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
308
|
+
|
|
309
|
+
breakPoint = breakPointJSON; ///
|
|
310
|
+
|
|
311
|
+
const json = {
|
|
312
|
+
string,
|
|
313
|
+
breakPoint
|
|
314
|
+
};
|
|
306
315
|
|
|
307
316
|
if (!abridged) {
|
|
308
317
|
const prefixNameJSON = prefixnameToPrevixNameJSON(this.prefixName),
|
|
@@ -329,9 +338,10 @@ export default define(class Type extends Element {
|
|
|
329
338
|
|
|
330
339
|
static fromJSON(json, context) {
|
|
331
340
|
return instantiate((context) => {
|
|
332
|
-
const { string
|
|
341
|
+
const { string } = json,
|
|
333
342
|
typeNode = instantiateType(string, context),
|
|
334
343
|
node = typeNode, ///
|
|
344
|
+
breakPoint = breakPointFromJSON(json),
|
|
335
345
|
name = nameFromTypeNode(typeNode, context),
|
|
336
346
|
prefixName = prefixNameFromJSON(json, context),
|
|
337
347
|
superTypes = superTypesFromJSON(json, context),
|
|
@@ -6,6 +6,7 @@ import { define } from "../elements";
|
|
|
6
6
|
import { instantiate } from "../utilities/context";
|
|
7
7
|
import { instantiateTypePrefix } from "../process/instantiate";
|
|
8
8
|
import { nameFromTypePrefixNode } from "../utilities/element";
|
|
9
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
9
10
|
|
|
10
11
|
export default define(class TypePrefix extends Element {
|
|
11
12
|
constructor(context, string, node, breakPoint, name) {
|
|
@@ -76,21 +77,30 @@ export default define(class TypePrefix extends Element {
|
|
|
76
77
|
static name = "TypePrefix";
|
|
77
78
|
|
|
78
79
|
toJSON() {
|
|
79
|
-
const string = this.getString()
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
80
|
+
const string = this.getString();
|
|
81
|
+
|
|
82
|
+
let breakPoint;
|
|
83
|
+
|
|
84
|
+
breakPoint = this.getBreakPoint();
|
|
85
|
+
|
|
86
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
87
|
+
|
|
88
|
+
breakPoint = breakPointJSON; ///
|
|
89
|
+
|
|
90
|
+
const json = {
|
|
91
|
+
string,
|
|
92
|
+
breakPoint
|
|
93
|
+
};
|
|
85
94
|
|
|
86
95
|
return json;
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
static fromJSON(json, context) {
|
|
90
99
|
return instantiate((context) => {
|
|
91
|
-
const { string
|
|
100
|
+
const { string } = json,
|
|
92
101
|
typePrefixNode = instantiateTypePrefix(string, context),
|
|
93
102
|
node = typePrefixNode, ///
|
|
103
|
+
breakPoint = breakPointFromJSON(json),
|
|
94
104
|
name = nameFromTypePrefixNode(typePrefixNode, context);
|
|
95
105
|
|
|
96
106
|
context = null; ///
|
package/src/element/variable.js
CHANGED
|
@@ -9,6 +9,7 @@ import { instantiate } from "../utilities/context";
|
|
|
9
9
|
import { instantiateVariable } from "../process/instantiate";
|
|
10
10
|
import { provisionallyStringFromProvisional } from "../utilities/string";
|
|
11
11
|
import { variableFromTermNode, identifierFromVariableNode } from "../utilities/element";
|
|
12
|
+
import { breakPointFromJSON, breakPointToBreakPointJSON } from "../utilities/breakPoint";
|
|
12
13
|
import { typeFromJSON, typeToTypeJSON, provisionalFromJSON, provisionalToProvisionalJSON } from "../utilities/json";
|
|
13
14
|
|
|
14
15
|
export default define(class Variable extends Element {
|
|
@@ -207,9 +208,17 @@ export default define(class Variable extends Element {
|
|
|
207
208
|
toJSON() {
|
|
208
209
|
const typeJSON = typeToTypeJSON(this.type),
|
|
209
210
|
provisionalJSON = provisionalToProvisionalJSON(this.provisional),
|
|
210
|
-
string = this.getString()
|
|
211
|
-
|
|
212
|
-
|
|
211
|
+
string = this.getString();
|
|
212
|
+
|
|
213
|
+
let breakPoint;
|
|
214
|
+
|
|
215
|
+
breakPoint = this.getBreakPoint();
|
|
216
|
+
|
|
217
|
+
const breakPointJSON = breakPointToBreakPointJSON(breakPoint);
|
|
218
|
+
|
|
219
|
+
breakPoint = breakPointJSON; ///
|
|
220
|
+
|
|
221
|
+
const type = typeJSON, ///
|
|
213
222
|
provisional = provisionalJSON, ///
|
|
214
223
|
json = {
|
|
215
224
|
string,
|
|
@@ -225,9 +234,10 @@ export default define(class Variable extends Element {
|
|
|
225
234
|
|
|
226
235
|
static fromJSON(json, context) {
|
|
227
236
|
return instantiate((context) => {
|
|
228
|
-
const { string
|
|
237
|
+
const { string } = json,
|
|
229
238
|
variableNode = instantiateVariable(string, context),
|
|
230
239
|
node = variableNode, ///
|
|
240
|
+
breakPoint = breakPointFromJSON(json),
|
|
231
241
|
type = typeFromJSON(json, context),
|
|
232
242
|
identifier = identifierFromVariableNode(variableNode, context),
|
|
233
243
|
provisional = provisionalFromJSON(json, context);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { BreakPoint } from "occam-languages";
|
|
4
|
+
|
|
5
|
+
export function breakPointFromJSON(json) {
|
|
6
|
+
let breakPoint;
|
|
7
|
+
|
|
8
|
+
({ breakPoint } = json);
|
|
9
|
+
|
|
10
|
+
if (breakPoint !== null) {
|
|
11
|
+
const breakPointJSON = breakPoint; ///
|
|
12
|
+
|
|
13
|
+
json = breakPointJSON; ///
|
|
14
|
+
|
|
15
|
+
breakPoint = BreakPoint.fromJSON(json); ///
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return breakPoint;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function breakPointToBreakPointJSON(breakPoint) {
|
|
22
|
+
let breakPointJSON = null;
|
|
23
|
+
|
|
24
|
+
if (breakPointJSON !== null) {
|
|
25
|
+
breakPointJSON = breakPoint.toJSON();
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return breakPointJSON;
|
|
29
|
+
}
|