occam-verify-cli 1.0.825 → 1.0.827

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 (129) hide show
  1. package/lib/element/assertion/contained.js +9 -5
  2. package/lib/element/assertion/property.js +9 -5
  3. package/lib/element/assertion/satisfies.js +9 -5
  4. package/lib/element/assertion/subproof.js +9 -5
  5. package/lib/element/assertion/type.js +9 -9
  6. package/lib/element/assertion.js +4 -3
  7. package/lib/element/assumption.js +7 -6
  8. package/lib/element/combinator.js +8 -7
  9. package/lib/element/conclusion.js +8 -7
  10. package/lib/element/constructor.js +7 -6
  11. package/lib/element/declaration/combinator.js +7 -8
  12. package/lib/element/declaration/complexType.js +25 -26
  13. package/lib/element/declaration/constructor.js +10 -11
  14. package/lib/element/declaration/metavariable.js +10 -11
  15. package/lib/element/declaration/simpleType.js +19 -20
  16. package/lib/element/declaration/typePrefix.js +7 -8
  17. package/lib/element/declaration/variable.js +10 -11
  18. package/lib/element/deduction.js +8 -7
  19. package/lib/element/derivation.js +10 -3
  20. package/lib/element/equality.js +8 -7
  21. package/lib/element/equivalence.js +10 -3
  22. package/lib/element/error.js +10 -3
  23. package/lib/element/frame.js +8 -7
  24. package/lib/element/hypothesis.js +8 -7
  25. package/lib/element/judgement.js +8 -7
  26. package/lib/element/label.js +8 -7
  27. package/lib/element/metaType.js +7 -6
  28. package/lib/element/metavariable.js +6 -5
  29. package/lib/element/parameter.js +8 -7
  30. package/lib/element/procedureCall.js +8 -7
  31. package/lib/element/procedureReference.js +8 -7
  32. package/lib/element/proof.js +10 -3
  33. package/lib/element/proofAssertion/premise.js +5 -5
  34. package/lib/element/proofAssertion/step.js +3 -3
  35. package/lib/element/proofAssertion/supposition.js +5 -5
  36. package/lib/element/proofAssertion.js +3 -3
  37. package/lib/element/property.js +7 -6
  38. package/lib/element/propertyRelation.js +8 -7
  39. package/lib/element/reference.js +8 -7
  40. package/lib/element/rule.js +13 -13
  41. package/lib/element/section.js +12 -5
  42. package/lib/element/signature.js +7 -6
  43. package/lib/element/statement.js +6 -5
  44. package/lib/element/subDerivation.js +10 -3
  45. package/lib/element/subproof.js +10 -3
  46. package/lib/element/substitution/frame.js +5 -5
  47. package/lib/element/substitution/reference.js +5 -5
  48. package/lib/element/substitution/statement.js +5 -5
  49. package/lib/element/substitution/term.js +5 -5
  50. package/lib/element/substitution.js +6 -5
  51. package/lib/element/term.js +7 -6
  52. package/lib/element/topLevelAssertion/axiom.js +3 -4
  53. package/lib/element/topLevelAssertion/conjecture.js +3 -4
  54. package/lib/element/topLevelAssertion/lemma.js +3 -4
  55. package/lib/element/topLevelAssertion/theorem.js +3 -4
  56. package/lib/element/topLevelAssertion.js +9 -7
  57. package/lib/element/topLevelMetaAssertion/metaLemma.js +3 -4
  58. package/lib/element/topLevelMetaAssertion/metatheorem.js +3 -4
  59. package/lib/element/topLevelMetaAssertion.js +12 -10
  60. package/lib/element/type.js +9 -8
  61. package/lib/element/typePrefix.js +8 -7
  62. package/lib/element/variable.js +7 -6
  63. package/lib/process/verify.js +17 -17
  64. package/lib/utilities/element.js +127 -93
  65. package/package.json +4 -4
  66. package/src/element/assertion/contained.js +10 -4
  67. package/src/element/assertion/property.js +10 -4
  68. package/src/element/assertion/satisfies.js +10 -4
  69. package/src/element/assertion/subproof.js +10 -4
  70. package/src/element/assertion/type.js +13 -15
  71. package/src/element/assertion.js +3 -1
  72. package/src/element/assumption.js +7 -5
  73. package/src/element/combinator.js +7 -5
  74. package/src/element/conclusion.js +7 -5
  75. package/src/element/constructor.js +6 -4
  76. package/src/element/declaration/combinator.js +6 -9
  77. package/src/element/declaration/complexType.js +24 -33
  78. package/src/element/declaration/constructor.js +9 -13
  79. package/src/element/declaration/metavariable.js +9 -13
  80. package/src/element/declaration/simpleType.js +19 -26
  81. package/src/element/declaration/typePrefix.js +6 -9
  82. package/src/element/declaration/variable.js +9 -13
  83. package/src/element/deduction.js +7 -5
  84. package/src/element/derivation.js +13 -2
  85. package/src/element/equality.js +7 -5
  86. package/src/element/equivalence.js +13 -2
  87. package/src/element/error.js +13 -3
  88. package/src/element/frame.js +7 -5
  89. package/src/element/hypothesis.js +7 -5
  90. package/src/element/judgement.js +7 -5
  91. package/src/element/label.js +7 -5
  92. package/src/element/metaType.js +7 -4
  93. package/src/element/metavariable.js +6 -4
  94. package/src/element/parameter.js +7 -5
  95. package/src/element/procedureCall.js +7 -5
  96. package/src/element/procedureReference.js +7 -5
  97. package/src/element/proof.js +13 -2
  98. package/src/element/proofAssertion/premise.js +4 -4
  99. package/src/element/proofAssertion/step.js +2 -2
  100. package/src/element/proofAssertion/supposition.js +4 -4
  101. package/src/element/proofAssertion.js +2 -2
  102. package/src/element/property.js +6 -4
  103. package/src/element/propertyRelation.js +7 -5
  104. package/src/element/reference.js +7 -5
  105. package/src/element/rule.js +15 -17
  106. package/src/element/section.js +15 -5
  107. package/src/element/signature.js +7 -5
  108. package/src/element/statement.js +5 -3
  109. package/src/element/subDerivation.js +13 -2
  110. package/src/element/subproof.js +13 -2
  111. package/src/element/substitution/frame.js +4 -4
  112. package/src/element/substitution/reference.js +4 -4
  113. package/src/element/substitution/statement.js +4 -4
  114. package/src/element/substitution/term.js +4 -4
  115. package/src/element/substitution.js +5 -3
  116. package/src/element/term.js +6 -4
  117. package/src/element/topLevelAssertion/axiom.js +2 -4
  118. package/src/element/topLevelAssertion/conjecture.js +2 -4
  119. package/src/element/topLevelAssertion/lemma.js +2 -4
  120. package/src/element/topLevelAssertion/theorem.js +2 -4
  121. package/src/element/topLevelAssertion.js +11 -7
  122. package/src/element/topLevelMetaAssertion/metaLemma.js +2 -4
  123. package/src/element/topLevelMetaAssertion/metatheorem.js +2 -4
  124. package/src/element/topLevelMetaAssertion.js +14 -11
  125. package/src/element/type.js +8 -5
  126. package/src/element/typePrefix.js +7 -5
  127. package/src/element/variable.js +6 -4
  128. package/src/process/verify.js +16 -16
  129. package/src/utilities/element.js +194 -84
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "occam-verify-cli",
3
3
  "author": "James Smith",
4
- "version": "1.0.825",
4
+ "version": "1.0.827",
5
5
  "license": "MIT, Anti-996",
6
6
  "homepage": "https://github.com/djalbat/occam-verify-cli",
7
7
  "description": "Occam's Verifier",
@@ -12,12 +12,12 @@
12
12
  "dependencies": {
13
13
  "argumentative": "^2.0.47",
14
14
  "necessary": "^17.1.7",
15
- "occam-furtle": "^3.0.179",
15
+ "occam-furtle": "^3.0.180",
16
16
  "occam-grammars": "^1.3.520",
17
- "occam-languages": "^0.0.175",
17
+ "occam-languages": "^0.0.178",
18
18
  "occam-lexers": "^23.1.44",
19
19
  "occam-model": "^1.0.505",
20
- "occam-nominal": "^1.0.90",
20
+ "occam-nominal": "^1.0.91",
21
21
  "occam-parsers": "^23.1.50",
22
22
  "occam-server": "^7.0.6"
23
23
  },
@@ -13,8 +13,8 @@ import { termFromContainedAssertionNode,
13
13
  containedAssertionFromStatementNode } from "../../utilities/element";
14
14
 
15
15
  export default define(class ContainedAssertion extends Assertion {
16
- constructor(context, string, node, term, frame, negated, statement) {
17
- super(context, string, node);
16
+ constructor(context, string, node, lineIndex, term, frame, negated, statement) {
17
+ super(context, string, node, lineIndex);
18
18
 
19
19
  this.term = term;
20
20
  this.frame = frame;
@@ -243,6 +243,12 @@ export default define(class ContainedAssertion extends Assertion {
243
243
  return unifiesIndependently;
244
244
  }
245
245
 
246
+ toJSON() {
247
+ const json = super.toJSON();
248
+
249
+ return json;
250
+ }
251
+
246
252
  static name = "ContainedAssertion";
247
253
 
248
254
  static fromJSON(json, context) {
@@ -252,7 +258,7 @@ export default define(class ContainedAssertion extends Assertion {
252
258
 
253
259
  if (this.name === name) {
254
260
  instantiate((context) => {
255
- const { string } = json,
261
+ const { string, lineIndex } = json,
256
262
  containedAssertionNode = instantiateContainedAssertion(string, context),
257
263
  node = containedAssertionNode, ///
258
264
  term = termFromContainedAssertionNode(containedAssertionNode, context),
@@ -262,7 +268,7 @@ export default define(class ContainedAssertion extends Assertion {
262
268
 
263
269
  context = null;
264
270
 
265
- containedAssertion = new ContainedAssertion(context, string, node, term, frame, negated, statement);
271
+ containedAssertion = new ContainedAssertion(context, string, node, lineIndex, term, frame, negated, statement);
266
272
  }, context);
267
273
  }
268
274
 
@@ -9,8 +9,8 @@ import { variableAssignmentFromPrepertyAssertion } from "../../process/assign";
9
9
  import { termFromPropertyAssertionNode, propertyAssertionFromStatementNode, propertyRelationFromPropertyAssertionNode } from "../../utilities/element";
10
10
 
11
11
  export default define(class PropertyAssertion extends Assertion {
12
- constructor(context, string, node, term, propertyRelation) {
13
- super(context, string, node);
12
+ constructor(context, string, node, lineIndex, term, propertyRelation) {
13
+ super(context, string, node, lineIndex);
14
14
 
15
15
  this.term = term;
16
16
  this.propertyRelation = propertyRelation;
@@ -203,6 +203,12 @@ export default define(class PropertyAssertion extends Assertion {
203
203
  context.addAssignment(variableAssigment);
204
204
  }
205
205
 
206
+ toJSON() {
207
+ const json = super.toJSON();
208
+
209
+ return json;
210
+ }
211
+
206
212
  static name = "PropertyAssertion";
207
213
 
208
214
  static fromJSON(json, context) {
@@ -212,7 +218,7 @@ export default define(class PropertyAssertion extends Assertion {
212
218
 
213
219
  if (this.name === name) {
214
220
  instantiate((context) => {
215
- const { string } = json,
221
+ const { string, lineIndex } = json,
216
222
  propertyAssertionNode = instantiatePropertyAssertion(string, context),
217
223
  node = propertyAssertionNode, ///
218
224
  term = termFromPropertyAssertionNode(propertyAssertionNode, context),
@@ -220,7 +226,7 @@ export default define(class PropertyAssertion extends Assertion {
220
226
 
221
227
  context = null;
222
228
 
223
- propertyAssertion = new PropertyAssertion(context, string, node, term, propertyRelation);
229
+ propertyAssertion = new PropertyAssertion(context, string, node, lineIndex, term, propertyRelation);
224
230
  }, context);
225
231
  }
226
232
 
@@ -8,8 +8,8 @@ import { instantiateSatisfiesAssertion } from "../../process/instantiate";
8
8
  import { signatureFromJSatisfiesAssertionNode, referenceFromJSatisfiesAssertionNode, satisfiesAssertionFromStatementNode } from "../../utilities/element";
9
9
 
10
10
  export default define(class SatisfiesAssertion extends Assertion {
11
- constructor(context, string, node, signature, reference) {
12
- super(context, string, node);
11
+ constructor(context, string, node, lineIndex, signature, reference) {
12
+ super(context, string, node, lineIndex);
13
13
 
14
14
  this.signature = signature;
15
15
  this.reference = reference;
@@ -157,6 +157,12 @@ export default define(class SatisfiesAssertion extends Assertion {
157
157
  return stepAndSubproofOrProofAssertionsUnify;
158
158
  }
159
159
 
160
+ toJSON() {
161
+ const json = super.toJSON();
162
+
163
+ return json;
164
+ }
165
+
160
166
  static name = "SatisfiesAssertion";
161
167
 
162
168
  static fromJSON(json, context) {
@@ -165,7 +171,7 @@ export default define(class SatisfiesAssertion extends Assertion {
165
171
  const { name } = json;
166
172
 
167
173
  if (this.name === name) {
168
- instantiate((context) => {const { string } = json,
174
+ instantiate((context) => {const { string, lineIndex } = json,
169
175
  definedAssertionNode = instantiateSatisfiesAssertion(string, context),
170
176
  node = definedAssertionNode, ///
171
177
  signature = signatureFromJSatisfiesAssertionNode(definedAssertionNode, context),
@@ -173,7 +179,7 @@ export default define(class SatisfiesAssertion extends Assertion {
173
179
 
174
180
  context = null;
175
181
 
176
- satisfiesAssertion = new SatisfiesAssertion(context, string, node, signature, reference);
182
+ satisfiesAssertion = new SatisfiesAssertion(context, string, node, lineIndex, signature, reference);
177
183
  }, context);
178
184
  }
179
185
 
@@ -13,8 +13,8 @@ import { subproofAssertionFromStatementNode } from "../../utilities/element";
13
13
  const { last, front, backwardsEvery } = arrayUtilities;
14
14
 
15
15
  export default define(class SubproofAssertion extends Assertion {
16
- constructor(context, string, node, statements) {
17
- super(context, string, node);
16
+ constructor(context, string, node, lineIndex, statements) {
17
+ super(context, string, node, lineIndex);
18
18
 
19
19
  this.statements = statements;
20
20
  }
@@ -289,6 +289,12 @@ export default define(class SubproofAssertion extends Assertion {
289
289
  return topLevelMetaAssertionUnifies;
290
290
  }
291
291
 
292
+ toJSON() {
293
+ const json = super.toJSON();
294
+
295
+ return json;
296
+ }
297
+
292
298
  static name = "SubproofAssertion";
293
299
 
294
300
  static fromJSON(json, context) {
@@ -298,14 +304,14 @@ export default define(class SubproofAssertion extends Assertion {
298
304
 
299
305
  if (this.name === name) {
300
306
  instantiate((context) => {
301
- const { string } = json,
307
+ const { string, lineIndex } = json,
302
308
  subproofAssertionNode = instantiateSubproofAssertion(string, context),
303
309
  statements = statementsFromSubproofAssertionNode(subproofAssertionNode, context),
304
310
  node = subproofAssertionNode; ///
305
311
 
306
312
  context = null;
307
313
 
308
- subproorAssertion = new SubproofAssertion(context, string, node, statements);
314
+ subproorAssertion = new SubproofAssertion(context, string, node, lineIndex, statements);
309
315
  }, context);
310
316
  }
311
317
 
@@ -10,8 +10,8 @@ import { variableAssignmentFromTypeAssertion } from "../../process/assign";
10
10
  import { termFromTypeAssertionNode, typeAssertionFromStatementNode } from "../../utilities/element";
11
11
 
12
12
  export default define(class TypeAssertion extends Assertion {
13
- constructor(context, string, node, term, type) {
14
- super(context, string, node);
13
+ constructor(context, string, node, lineIndex, term, type) {
14
+ super(context, string, node, lineIndex);
15
15
 
16
16
  this.term = term;
17
17
  this.type = type;
@@ -193,17 +193,15 @@ export default define(class TypeAssertion extends Assertion {
193
193
  }
194
194
 
195
195
  toJSON() {
196
- const { name } = this.constructor,
197
- typeJSON = typeToTypeJSON(this.type),
198
- type = typeJSON, ///
199
- string = this.getString(),
200
- json = {
201
- name,
202
- string,
203
- type
204
- };
205
-
206
- return json;
196
+ const json = super.toJSON();
197
+
198
+ const typeJSON = typeToTypeJSON(this.type),
199
+ type = typeJSON; ///
200
+
201
+ return {
202
+ ...json,
203
+ type
204
+ };
207
205
  }
208
206
 
209
207
  static name = "TypeAssertion";
@@ -215,7 +213,7 @@ export default define(class TypeAssertion extends Assertion {
215
213
 
216
214
  if (this.name === name) {
217
215
  instantiate((context) => {
218
- const { string } = json,
216
+ const { string, lineIndex } = json,
219
217
  typeAssertionNode = instantiateTypeAssertion(string, context),
220
218
  term = termFromTypeAssertionNode(typeAssertionNode, context),
221
219
  type = typeFromJSON(json, context),
@@ -223,7 +221,7 @@ export default define(class TypeAssertion extends Assertion {
223
221
 
224
222
  context = null;
225
223
 
226
- typeAssertion = new TypeAssertion(context, string, node, term, type);
224
+ typeAssertion = new TypeAssertion(context, string, node, lineIndex, term, type);
227
225
  }, context);
228
226
  }
229
227
 
@@ -37,9 +37,11 @@ export default class Assertion extends Element {
37
37
  toJSON() {
38
38
  const { name } = this.constructor,
39
39
  string = this.getString(),
40
+ lineIndex = this.getLineIndex(),
40
41
  json = {
41
42
  name,
42
- string
43
+ string,
44
+ lineIndex
43
45
  };
44
46
 
45
47
  return json;
@@ -8,8 +8,8 @@ import { instantiateAssumption } from "../process/instantiate";
8
8
  import { join, reconcile, instantiate } from "../utilities/context";
9
9
 
10
10
  export default define(class Assumption extends Element {
11
- constructor(context, string, node, reference, statement) {
12
- super(context, string, node);
11
+ constructor(context, string, node, lineIndex, reference, statement) {
12
+ super(context, string, node, lineIndex);
13
13
 
14
14
  this.reference = reference;
15
15
  this.statement = statement;
@@ -269,8 +269,10 @@ export default define(class Assumption extends Element {
269
269
 
270
270
  toJSON() {
271
271
  const string = this.getString(),
272
+ lineIndex = this.getLineIndex(),
272
273
  json = {
273
- string
274
+ string,
275
+ lineIndex
274
276
  };
275
277
 
276
278
  return json;
@@ -280,12 +282,12 @@ export default define(class Assumption extends Element {
280
282
 
281
283
  static fromJSON(json, context) {
282
284
  const assumption = instantiate((context) => {
283
- const { string } = json,
285
+ const { string, lineIndex } = json,
284
286
  assumptionNode = instantiateAssumption(string, context),
285
287
  node = assumptionNode, ///
286
288
  reference = referenceFromAssumptionNode(assumptionNode, context),
287
289
  statement = statementFromAssumptionNode(assumptionNode, context),
288
- assumption = new Assumption(context, string, node, reference, statement);
290
+ assumption = new Assumption(context, string, node, lineIndex, reference, statement);
289
291
 
290
292
  return assumption;
291
293
  }, context);
@@ -10,8 +10,8 @@ import { validateStatementAsCombinator } from "../process/validate";
10
10
  import { attempt, serialise, unserialise, instantiate } from "../utilities/context";
11
11
 
12
12
  export default define(class Combinator extends Element {
13
- constructor(context, string, node, statement) {
14
- super(context, string, node);
13
+ constructor(context, string, node, lineIndex, statement) {
14
+ super(context, string, node, lineIndex);
15
15
 
16
16
  this.statement = statement;
17
17
  }
@@ -107,9 +107,11 @@ export default define(class Combinator extends Element {
107
107
 
108
108
  return serialise((context) => {
109
109
  const string = this.getString(),
110
+ lineIndex = this.getLineIndex(),
110
111
  json = {
111
112
  context,
112
- string
113
+ string,
114
+ lineIndex
113
115
  };
114
116
 
115
117
  return json;
@@ -123,12 +125,12 @@ export default define(class Combinator extends Element {
123
125
 
124
126
  unserialise((json, context) => {
125
127
  instantiate((context) => {
126
- const { string } = json,
128
+ const { string, lineIndex } = json,
127
129
  combinatorNode = instantiateCombinator(string, context),
128
130
  node = combinatorNode, ///
129
131
  statement = statementFromCombinatorNode(combinatorNode, context);
130
132
 
131
- combinator = new Combinator(context, string, node, statement);
133
+ combinator = new Combinator(context, string, node, lineIndex, statement);
132
134
  }, context);
133
135
  }, json, context);
134
136
 
@@ -7,8 +7,8 @@ import { instantiateConclusion } from "../process/instantiate";
7
7
  import { declare, attempt, descend, serialise, unserialise, instantiate } from "../utilities/context";
8
8
 
9
9
  export default define(class Conclusion extends Element {
10
- constructor(context, string, node, statement) {
11
- super(context, string, node);
10
+ constructor(context, string, node, lineIndex, statement) {
11
+ super(context, string, node, lineIndex);
12
12
 
13
13
  this.statement = statement;
14
14
  }
@@ -136,9 +136,11 @@ export default define(class Conclusion extends Element {
136
136
 
137
137
  return serialise((context) => {
138
138
  const string = this.getString(),
139
+ lineIndex = this.getLineIndex(),
139
140
  json = {
140
141
  context,
141
- string
142
+ string,
143
+ lineIndex
142
144
  };
143
145
 
144
146
  return json;
@@ -152,12 +154,12 @@ export default define(class Conclusion extends Element {
152
154
 
153
155
  unserialise((json, context) => {
154
156
  instantiate((context) => {
155
- const { string } = json,
157
+ const { string, lineIndex } = json,
156
158
  conclusionNode = instantiateConclusion(string, context),
157
159
  node = conclusionNode, ///
158
160
  statement = statementFromConclusionNode(conclusionNode, context);
159
161
 
160
- conclusion = new Conclusion(context, string, node, statement);
162
+ conclusion = new Conclusion(context, string, node, lineIndex, statement);
161
163
  }, context);
162
164
  }, json, context);
163
165
 
@@ -11,8 +11,8 @@ import { typeFromJSON, typeToTypeJSON } from "../utilities/json";
11
11
  import { attempt, serialise, unserialise, instantiate } from "../utilities/context";
12
12
 
13
13
  export default define(class Constructor extends Element {
14
- constructor(context, string, node, term, type) {
15
- super(context, string, node, type);
14
+ constructor(context, string, node, lineIndex, term, type) {
15
+ super(context, string, node, lineIndex);
16
16
 
17
17
  this.term = term;
18
18
  this.type = type;
@@ -151,10 +151,12 @@ export default define(class Constructor extends Element {
151
151
  const includeType = false,
152
152
  typeJSON = typeToTypeJSON(this.type),
153
153
  string = this.getString(includeType),
154
+ lineIndex = this.getLineIndex(),
154
155
  type = typeJSON, ///
155
156
  json = {
156
157
  context,
157
158
  string,
159
+ lineIndex,
158
160
  type
159
161
  };
160
162
 
@@ -169,13 +171,13 @@ export default define(class Constructor extends Element {
169
171
 
170
172
  unserialise((json, context) => {
171
173
  instantiate((context) => {
172
- const { string } = json,
174
+ const { string, lineIndex } = json,
173
175
  constructorNode = instantiateConstructor(string, context),
174
176
  node = constructorNode, ///
175
177
  term = termFromConstructorNode(constructorNode, context),
176
178
  type = typeFromJSON(json, context);
177
179
 
178
- constructor = new Constructor(context, string, node, term, type);
180
+ constructor = new Constructor(context, string, node, lineIndex, term, type);
179
181
  }, context);
180
182
  }, json, context);
181
183
 
@@ -5,8 +5,8 @@ import Declaration from "../declaration";
5
5
  import { define } from "../../elements";
6
6
 
7
7
  export default define(class CombinatorDeclaration extends Declaration {
8
- constructor(context, string, node, combinator) {
9
- super(context, string, node);
8
+ constructor(context, string, node, lineIndex, combinator) {
9
+ super(context, string, node, lineIndex);
10
10
 
11
11
  this.combinator = combinator;
12
12
  }
@@ -22,18 +22,16 @@ export default define(class CombinatorDeclaration extends Declaration {
22
22
  return combinatorDeclarationNode;
23
23
  }
24
24
 
25
- async verify() {
25
+ async verify(context) {
26
26
  let verifies = false;
27
27
 
28
- const context = this.getContext();
29
-
30
28
  await this.break(context);
31
29
 
32
30
  const combinatorDeclarationString = this.getString(); ///
33
31
 
34
32
  context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`);
35
33
 
36
- const combinatorValidates = this.validateCombinator();
34
+ const combinatorValidates = this.validateCombinator(context);
37
35
 
38
36
  if (combinatorValidates) {
39
37
  context.addCombinator(this.combinator);
@@ -48,11 +46,10 @@ export default define(class CombinatorDeclaration extends Declaration {
48
46
  return verifies;
49
47
  }
50
48
 
51
- validateCombinator() {
49
+ validateCombinator(context) {
52
50
  let combinatorValidates;
53
51
 
54
- const context = this.getContext(),
55
- combinatorString = this.combinator.getString(),
52
+ const combinatorString = this.combinator.getString(),
56
53
  combinatorDeclarationString = this.getString(); ///
57
54
 
58
55
  context.trace(`Validating the '${combinatorDeclarationString}' combinator declaration's '${combinatorString}' combinator...`);
@@ -5,8 +5,8 @@ import Declaration from "../declaration";
5
5
  import { define } from "../../elements";
6
6
 
7
7
  export default define(class ComplexTypeDeclaration extends Declaration {
8
- constructor(context, string, node, type, superTypes) {
9
- super(context, string, node);
8
+ constructor(context, string, node, lineIndex, type, superTypes) {
9
+ super(context, string, node, lineIndex);
10
10
 
11
11
  this.type = type;
12
12
  this.superTypes = superTypes;
@@ -27,11 +27,9 @@ export default define(class ComplexTypeDeclaration extends Declaration {
27
27
  return complexTypeDeclarationNode;
28
28
  }
29
29
 
30
- async verify() {
30
+ async verify(context) {
31
31
  let verifies = false;
32
32
 
33
- const context = this.getContext();
34
-
35
33
  await this.break(context);
36
34
 
37
35
  const complexTypeDeclarationString = this.getString(); ///
@@ -43,13 +41,13 @@ export default define(class ComplexTypeDeclaration extends Declaration {
43
41
 
44
42
  context.trace(`The '${typeString}' type is prefixed.`);
45
43
  } else {
46
- const typeVerifies = this.verifyType();
44
+ const typeVerifies = this.verifyType(context);
47
45
 
48
46
  if (typeVerifies) {
49
- const superTypesVerify = this.verifySuperTypes();
47
+ const superTypesVerify = this.verifySuperTypes(context);
50
48
 
51
49
  if (superTypesVerify) {
52
- const propertiesVerify = this.verifyProperties();
50
+ const propertiesVerify = this.verifyProperties(context);
53
51
 
54
52
  if (propertiesVerify) {
55
53
  const typePrefix = context.getTypePrefix();
@@ -76,11 +74,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
76
74
  return verifies;
77
75
  }
78
76
 
79
- verifyType() {
77
+ verifyType(context) {
80
78
  let typeVerifies = false;
81
79
 
82
- const context = this.getContext(),
83
- typeString = this.type.getString();
80
+ const typeString = this.type.getString();
84
81
 
85
82
  context.trace(`Verifying the '${typeString}' complex type...`);
86
83
 
@@ -108,11 +105,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
108
105
  return typeVerifies;
109
106
  }
110
107
 
111
- verifySuperType(superType) {
108
+ verifySuperType(context, superType) {
112
109
  let superTypeVerifies = false;
113
110
 
114
- const context = this.getContext(),
115
- superTypeString = superType.getString();
111
+ const superTypeString = superType.getString();
116
112
 
117
113
  context.trace(`Verifying the '${superTypeString}' super-type...`);
118
114
 
@@ -145,11 +141,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
145
141
  return superTypeVerifies;
146
142
  }
147
143
 
148
- verifySuperTypes() {
144
+ verifySuperTypes(context) {
149
145
  let superTypesVerify;
150
146
 
151
- const context = this.getContext(),
152
- typeString = this.type.getString();
147
+ const typeString = this.type.getString();
153
148
 
154
149
  context.trace(`Verifying the '${typeString}' complex type's super-types...`);
155
150
 
@@ -163,7 +158,7 @@ export default define(class ComplexTypeDeclaration extends Declaration {
163
158
  const superTypes = this.type.getSuperTypes();
164
159
 
165
160
  superTypesVerify = superTypes.every((superType) => {
166
- const superTypeVerifies = this.verifySuperType(superType);
161
+ const superTypeVerifies = this.verifySuperType(context, superType);
167
162
 
168
163
  if (superTypeVerifies) {
169
164
  return true;
@@ -178,18 +173,17 @@ export default define(class ComplexTypeDeclaration extends Declaration {
178
173
  return superTypesVerify;
179
174
  }
180
175
 
181
- verifyProperty(property, properties) {
176
+ verifyProperty(context, property, properties) {
182
177
  let propertyVerifies = false;
183
178
 
184
- const context = this.getContext(),
185
- propertyString = property.getString();
179
+ const propertyString = property.getString();
186
180
 
187
181
  context.trace(`Verifying the '${propertyString}' property...`);
188
182
 
189
- const propertyNameVerifies = this.verifyPropertyName(property, properties);
183
+ const propertyNameVerifies = this.verifyPropertyName(context, property, properties);
190
184
 
191
185
  if (propertyNameVerifies) {
192
- const propertyNominalTypeNameVerifies = this.verifyPropertyNominalTypeName(property, properties);
186
+ const propertyNominalTypeNameVerifies = this.verifyPropertyNominalTypeName(context, property, properties);
193
187
 
194
188
  if (propertyNominalTypeNameVerifies) {
195
189
  propertyVerifies = true;
@@ -203,11 +197,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
203
197
  return propertyVerifies;
204
198
  }
205
199
 
206
- verifyProperties() {
200
+ verifyProperties(context) {
207
201
  let propertiesVerify;
208
202
 
209
- const context = this.getContext(),
210
- typeString = this.type.getString();
203
+ const typeString = this.type.getString();
211
204
 
212
205
  context.trace(`Verifying the '${typeString}' complex type's properties...`);
213
206
 
@@ -215,7 +208,7 @@ export default define(class ComplexTypeDeclaration extends Declaration {
215
208
  properties = this.type.getProperties(includeSuperTypes);
216
209
 
217
210
  propertiesVerify = properties.every((property) => {
218
- const propertyVerifies = this.verifyProperty(property, properties);
211
+ const propertyVerifies = this.verifyProperty(context, property, properties);
219
212
 
220
213
  if (propertyVerifies) {
221
214
  return true;
@@ -229,11 +222,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
229
222
  return propertiesVerify;
230
223
  }
231
224
 
232
- verifyPropertyName(property, properties) {
225
+ verifyPropertyName(context, property, properties) {
233
226
  let propertyNameVerifies = false;
234
227
 
235
- const context = this.getContext(),
236
- propertyString = property.getString();
228
+ const propertyString = property.getString();
237
229
 
238
230
  context.trace(`Verifying the '${propertyString}' property's name...`);
239
231
 
@@ -283,11 +275,10 @@ export default define(class ComplexTypeDeclaration extends Declaration {
283
275
  return propertyNameVerifies;
284
276
  }
285
277
 
286
- verifyPropertyNominalTypeName(property) {
278
+ verifyPropertyNominalTypeName(context, property) {
287
279
  let propertyNominalTypeNameVerifies = false;
288
280
 
289
- const context = this.getContext(),
290
- propertyString = property.getString(),
281
+ const propertyString = property.getString(),
291
282
  nominalTypeName = property.getNominalTypeName();
292
283
 
293
284
  context.trace(`Verifying the '${propertyString}' property's '${nominalTypeName}' nominal type name...`);