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.
Files changed (87) hide show
  1. package/lib/element/assertion/contained.js +3 -2
  2. package/lib/element/assertion/defined.js +3 -2
  3. package/lib/element/assertion/property.js +3 -2
  4. package/lib/element/assertion/signature.js +3 -2
  5. package/lib/element/assertion/subproof.js +3 -2
  6. package/lib/element/assertion/type.js +9 -3
  7. package/lib/element/assertion.js +8 -2
  8. package/lib/element/assumption/metaLevel.js +9 -3
  9. package/lib/element/assumption.js +10 -4
  10. package/lib/element/combinator.js +9 -3
  11. package/lib/element/conclusion.js +9 -3
  12. package/lib/element/constructor.js +10 -4
  13. package/lib/element/deduction.js +9 -3
  14. package/lib/element/equality.js +9 -3
  15. package/lib/element/frame.js +9 -3
  16. package/lib/element/hypothesis.js +9 -3
  17. package/lib/element/judgement.js +9 -3
  18. package/lib/element/label.js +9 -3
  19. package/lib/element/metaType.js +8 -2
  20. package/lib/element/metavariable.js +10 -4
  21. package/lib/element/parameter.js +9 -3
  22. package/lib/element/procedureCall.js +9 -3
  23. package/lib/element/procedureReference.js +9 -3
  24. package/lib/element/proofAssertion/premise.js +9 -3
  25. package/lib/element/proofAssertion/supposition.js +9 -3
  26. package/lib/element/property.js +9 -3
  27. package/lib/element/propertyRelation.js +9 -3
  28. package/lib/element/reference.js +9 -3
  29. package/lib/element/rule.js +9 -3
  30. package/lib/element/signature.js +10 -5
  31. package/lib/element/statement.js +10 -4
  32. package/lib/element/substitution/frame.js +4 -3
  33. package/lib/element/substitution/reference.js +4 -3
  34. package/lib/element/substitution/statement.js +4 -3
  35. package/lib/element/substitution/term.js +4 -3
  36. package/lib/element/substitution.js +8 -2
  37. package/lib/element/term.js +9 -3
  38. package/lib/element/topLevelAssertion.js +8 -2
  39. package/lib/element/topLevelMetaAssertion.js +8 -2
  40. package/lib/element/type.js +9 -3
  41. package/lib/element/typePrefix.js +9 -3
  42. package/lib/element/variable.js +9 -3
  43. package/lib/utilities/breakPoint.js +38 -0
  44. package/package.json +4 -4
  45. package/src/element/assertion/contained.js +3 -1
  46. package/src/element/assertion/defined.js +3 -1
  47. package/src/element/assertion/property.js +3 -1
  48. package/src/element/assertion/signature.js +3 -1
  49. package/src/element/assertion/subproof.js +5 -3
  50. package/src/element/assertion/type.js +14 -4
  51. package/src/element/assertion.js +17 -7
  52. package/src/element/assumption/metaLevel.js +18 -8
  53. package/src/element/assumption.js +18 -8
  54. package/src/element/combinator.js +18 -8
  55. package/src/element/conclusion.js +18 -8
  56. package/src/element/constructor.js +15 -5
  57. package/src/element/deduction.js +18 -8
  58. package/src/element/equality.js +17 -7
  59. package/src/element/frame.js +17 -7
  60. package/src/element/hypothesis.js +18 -8
  61. package/src/element/judgement.js +17 -7
  62. package/src/element/label.js +18 -8
  63. package/src/element/metaType.js +15 -6
  64. package/src/element/metavariable.js +19 -9
  65. package/src/element/parameter.js +17 -7
  66. package/src/element/procedureCall.js +17 -7
  67. package/src/element/procedureReference.js +17 -7
  68. package/src/element/proofAssertion/premise.js +18 -8
  69. package/src/element/proofAssertion/supposition.js +18 -8
  70. package/src/element/property.js +14 -4
  71. package/src/element/propertyRelation.js +17 -7
  72. package/src/element/reference.js +18 -8
  73. package/src/element/rule.js +14 -4
  74. package/src/element/signature.js +18 -9
  75. package/src/element/statement.js +19 -9
  76. package/src/element/substitution/frame.js +3 -1
  77. package/src/element/substitution/reference.js +3 -1
  78. package/src/element/substitution/statement.js +3 -1
  79. package/src/element/substitution/term.js +3 -1
  80. package/src/element/substitution.js +17 -8
  81. package/src/element/term.js +14 -4
  82. package/src/element/topLevelAssertion.js +12 -3
  83. package/src/element/topLevelMetaAssertion.js +12 -3
  84. package/src/element/type.js +17 -7
  85. package/src/element/typePrefix.js +17 -7
  86. package/src/element/variable.js +14 -4
  87. package/src/utilities/breakPoint.js +29 -0
@@ -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
- breakPoint = this.getBreakPoint(),
238
- json = {
239
- context,
240
- string,
241
- breakPoint
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, breakPoint } = json,
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);
@@ -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
- breakPoint = this.getBreakPoint(),
398
- json = {
399
- string,
400
- breakPoint
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, breakPoint } = json,
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, breakPoint } = json,
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, breakPoint } = json,
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, breakPoint } = json,
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, breakPoint } = json,
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
- breakPoint = this.getBreakPoint(),
248
- json = {
249
- name,
250
- contexts,
251
- string,
252
- breakPoint
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);
@@ -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
- breakPoint = this.getBreakPoint(),
293
- type = typeJSON, ///
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, breakPoint } = json,
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
- breakPoint = this.getBreakPoint(),
358
- labels = labelsJSON, ///
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
- breakPoint = this.getBreakPoint(),
238
- label = labelJSON, ///
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, ///
@@ -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
- breakPoint = this.getBreakPoint(),
302
- json = {
303
- string,
304
- breakPoint
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, breakPoint } = json,
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
- breakPoint = this.getBreakPoint(),
81
- json = {
82
- string,
83
- breakPoint
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, breakPoint } = json,
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; ///
@@ -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
- breakPoint = this.getBreakPoint(),
212
- type = typeJSON, ///
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, breakPoint } = json,
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
+ }