occam-verify-cli 1.0.282 → 1.0.285
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/context/file.js +51 -9
- package/lib/context/local.js +11 -6
- package/lib/context/release.js +11 -11
- package/lib/dom/axiom.js +18 -18
- package/lib/dom/conclusion.js +16 -9
- package/lib/dom/conjecture.js +4 -4
- package/lib/dom/constructor/bracketed.js +3 -3
- package/lib/dom/constructor.js +3 -3
- package/lib/dom/declaration/combinator.js +14 -7
- package/lib/dom/declaration/complexType.js +28 -21
- package/lib/dom/declaration/constructor.js +18 -11
- package/lib/dom/declaration/metavariable.js +19 -12
- package/lib/dom/declaration/simpleType.js +21 -14
- package/lib/dom/declaration/variable.js +19 -12
- package/lib/dom/deduction.js +18 -11
- package/lib/dom/error.js +11 -4
- package/lib/dom/hypothesis.js +16 -9
- package/lib/dom/lemma.js +4 -4
- package/lib/dom/metaLemma.js +4 -4
- package/lib/dom/metatheorem.js +4 -4
- package/lib/dom/premise.js +18 -11
- package/lib/dom/procedureCall.js +17 -10
- package/lib/dom/rule.js +14 -7
- package/lib/dom/section.js +12 -5
- package/lib/dom/statement.js +15 -15
- package/lib/dom/step.js +18 -11
- package/lib/dom/subproof.js +11 -10
- package/lib/dom/supposition.js +20 -13
- package/lib/dom/theorem.js +4 -4
- package/lib/dom/topLevelAssertion.js +13 -6
- package/lib/dom/topLevelMetaAssertion.js +11 -4
- package/lib/log.js +25 -10
- package/package.json +1 -1
- package/src/context/file.js +68 -9
- package/src/context/local.js +5 -5
- package/src/context/release.js +5 -5
- package/src/dom/axiom.js +23 -18
- package/src/dom/conclusion.js +14 -8
- package/src/dom/conjecture.js +4 -3
- package/src/dom/constructor/bracketed.js +2 -2
- package/src/dom/constructor.js +2 -2
- package/src/dom/declaration/combinator.js +11 -6
- package/src/dom/declaration/complexType.js +26 -20
- package/src/dom/declaration/constructor.js +16 -11
- package/src/dom/declaration/metavariable.js +17 -11
- package/src/dom/declaration/simpleType.js +19 -13
- package/src/dom/declaration/variable.js +17 -12
- package/src/dom/deduction.js +16 -10
- package/src/dom/error.js +8 -3
- package/src/dom/hypothesis.js +14 -8
- package/src/dom/lemma.js +5 -4
- package/src/dom/metaLemma.js +4 -3
- package/src/dom/metatheorem.js +4 -3
- package/src/dom/premise.js +16 -10
- package/src/dom/procedureCall.js +16 -9
- package/src/dom/rule.js +14 -7
- package/src/dom/section.js +10 -4
- package/src/dom/statement.js +14 -14
- package/src/dom/step.js +16 -10
- package/src/dom/subproof.js +8 -6
- package/src/dom/supposition.js +18 -12
- package/src/dom/theorem.js +4 -3
- package/src/dom/topLevelAssertion.js +11 -5
- package/src/dom/topLevelMetaAssertion.js +9 -3
- package/src/log.js +29 -16
package/src/context/local.js
CHANGED
|
@@ -375,15 +375,15 @@ class LocalContext {
|
|
|
375
375
|
|
|
376
376
|
tokensAsString(tokens) { return this.context.tokensAsString(tokens); }
|
|
377
377
|
|
|
378
|
-
trace(message, node) { this.context.trace(message, node); }
|
|
378
|
+
trace(message, node = null) { this.context.trace(message, node); }
|
|
379
379
|
|
|
380
|
-
debug(message, node) { this.context.debug(message, node); }
|
|
380
|
+
debug(message, node = null) { this.context.debug(message, node); }
|
|
381
381
|
|
|
382
|
-
info(message, node) { this.context.info(message, node); }
|
|
382
|
+
info(message, node = null) { this.context.info(message, node); }
|
|
383
383
|
|
|
384
|
-
warning(message, node) { this.context.warning(message, node); }
|
|
384
|
+
warning(message, node = null) { this.context.warning(message, node); }
|
|
385
385
|
|
|
386
|
-
error(message, node) { this.context.error(message, node); }
|
|
386
|
+
error(message, node = null) { this.context.error(message, node); }
|
|
387
387
|
|
|
388
388
|
static fromContext(context) {
|
|
389
389
|
const tokens = null,
|
package/src/context/release.js
CHANGED
|
@@ -414,15 +414,15 @@ export default class ReleaseContext {
|
|
|
414
414
|
|
|
415
415
|
matchShortenedVersion(shortenedVersion) { return this.entries.matchShortenedVersion(shortenedVersion); }
|
|
416
416
|
|
|
417
|
-
trace(message, filePath = null) { this.log.trace(message, filePath); }
|
|
417
|
+
trace(message, filePath = null, lineIndex = null) { this.log.trace(message, filePath, lineIndex); }
|
|
418
418
|
|
|
419
|
-
debug(message, filePath = null) { this.log.debug(message, filePath); }
|
|
419
|
+
debug(message, filePath = null, lineIndex = null) { this.log.debug(message, filePath, lineIndex); }
|
|
420
420
|
|
|
421
|
-
info(message, filePath = null) { this.log.info(message, filePath); }
|
|
421
|
+
info(message, filePath = null, lineIndex = null) { this.log.info(message, filePath, lineIndex); }
|
|
422
422
|
|
|
423
|
-
warning(message, filePath = null) { this.log.warning(message, filePath); }
|
|
423
|
+
warning(message, filePath = null, lineIndex = null) { this.log.warning(message, filePath, lineIndex); }
|
|
424
424
|
|
|
425
|
-
error(message, filePath = null) { this.log.error(message, filePath); }
|
|
425
|
+
error(message, filePath = null, lineIndex = null) { this.log.error(message, filePath, lineIndex); }
|
|
426
426
|
|
|
427
427
|
initialise(releaseContexts) {
|
|
428
428
|
const combinedCustomGrammar = combinedCustomGrammarFromReleaseContexts(releaseContexts),
|
package/src/dom/axiom.js
CHANGED
|
@@ -16,10 +16,11 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
16
16
|
let verifies;
|
|
17
17
|
|
|
18
18
|
const axiom = this, ///
|
|
19
|
+
node = this.getNode(),
|
|
19
20
|
context = this.getContext(),
|
|
20
21
|
axiomString = axiom.getString();
|
|
21
22
|
|
|
22
|
-
context.trace(`Verifying the '${axiomString}' axiom
|
|
23
|
+
context.trace(`Verifying the '${axiomString}' axiom...`, node);
|
|
23
24
|
|
|
24
25
|
const signatureVerifies = this.verifySignature();
|
|
25
26
|
|
|
@@ -32,7 +33,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
32
33
|
|
|
33
34
|
context.addAxiom(axiom);
|
|
34
35
|
|
|
35
|
-
context.debug(`...verified the '${axiomString}' axiom
|
|
36
|
+
context.debug(`...verified the '${axiomString}' axiom.`, node);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
return verifies;
|
|
@@ -81,15 +82,16 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
81
82
|
unifyStep(step, substitutions, context) {
|
|
82
83
|
let stepUnifies = false;
|
|
83
84
|
|
|
84
|
-
const
|
|
85
|
-
|
|
85
|
+
const node = this.getNode(),
|
|
86
|
+
stepString = step.getString(),
|
|
87
|
+
axiomString = this.getString();
|
|
86
88
|
|
|
87
|
-
context.trace(`Unifying the '${stepString}' step with the '${axiomString}' axiom
|
|
89
|
+
context.trace(`Unifying the '${stepString}' step with the '${axiomString}' axiom...`, node);
|
|
88
90
|
|
|
89
91
|
const unconditional = this.isUnconditional();
|
|
90
92
|
|
|
91
93
|
if (!unconditional) {
|
|
92
|
-
context.trace(`Cannot unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional
|
|
94
|
+
context.trace(`Cannot unify the '${stepString}' step with the '${axiomString}' axiom because the axiom is not unconditional.`, node);
|
|
93
95
|
} else {
|
|
94
96
|
const statement = step.getStatement(),
|
|
95
97
|
specificContext = context; ///
|
|
@@ -105,7 +107,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
105
107
|
}
|
|
106
108
|
|
|
107
109
|
if (stepUnifies) {
|
|
108
|
-
context.debug(`...unified the '${stepString}' step with the '${axiomString}' axiom
|
|
110
|
+
context.debug(`...unified the '${stepString}' step with the '${axiomString}' axiom.`, node);
|
|
109
111
|
}
|
|
110
112
|
|
|
111
113
|
return stepUnifies;
|
|
@@ -114,11 +116,12 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
114
116
|
unifyLastStep(lastStep, substitutions, generalContext, specificContext) {
|
|
115
117
|
let lastStepUnifies = false;
|
|
116
118
|
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
+
const node = this.getNode(),
|
|
120
|
+
context = specificContext, ///
|
|
121
|
+
axiomString = this.getString(),
|
|
119
122
|
lastStepString = lastStep.getString();
|
|
120
123
|
|
|
121
|
-
context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom
|
|
124
|
+
context.trace(`Unifying the '${lastStepString}' last step with the '${axiomString}' axiom...`, node)
|
|
122
125
|
|
|
123
126
|
const statement = lastStep.getStatement(),
|
|
124
127
|
statementUnifiesWithDeduction = this.unifyStatementWithDeduction(statement, substitutions, generalContext, specificContext);
|
|
@@ -128,7 +131,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
128
131
|
}
|
|
129
132
|
|
|
130
133
|
if (lastStepUnifies) {
|
|
131
|
-
context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom
|
|
134
|
+
context.debug(`...unified the '${lastStepString}' last step with the '${axiomString}' axiom.`, node)
|
|
132
135
|
}
|
|
133
136
|
|
|
134
137
|
return lastStepUnifies;
|
|
@@ -137,15 +140,16 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
137
140
|
unifySubproof(subproof, substitutions, context) {
|
|
138
141
|
let subproofUnifies = false;
|
|
139
142
|
|
|
140
|
-
const
|
|
143
|
+
const node = this.getNode(),
|
|
144
|
+
axiomString = this.getString(),
|
|
141
145
|
subproofString = subproof.getString();
|
|
142
146
|
|
|
143
|
-
context.trace(`Unifying the '${subproofString}' subproof with the '${axiomString}' axiom
|
|
147
|
+
context.trace(`Unifying the '${subproofString}' subproof with the '${axiomString}' axiom...`, node);
|
|
144
148
|
|
|
145
149
|
const unconditional = this.isUnconditional();
|
|
146
150
|
|
|
147
151
|
if (unconditional) {
|
|
148
|
-
context.trace(`Cannot unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional
|
|
152
|
+
context.trace(`Cannot unify the '${subproofString}' subproof with the '${axiomString}' axiom because the axiom is unconditional.`, node);
|
|
149
153
|
} else {
|
|
150
154
|
const lastStep = subproof.getLastStep(),
|
|
151
155
|
specificContext = context; ///
|
|
@@ -166,7 +170,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
166
170
|
}
|
|
167
171
|
|
|
168
172
|
if (subproofUnifies) {
|
|
169
|
-
context.debug(`...unified the '${subproofString}' subproof with the '${axiomString}' axiom
|
|
173
|
+
context.debug(`...unified the '${subproofString}' subproof with the '${axiomString}' axiom.`, node);
|
|
170
174
|
}
|
|
171
175
|
|
|
172
176
|
return subproofUnifies;
|
|
@@ -237,10 +241,11 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
237
241
|
unifyAxiomLemmaTheoremOrConjecture(axiomLemmaTheoremOrConjecture, substitutions, context) {
|
|
238
242
|
let axiomLemmaTheoremOrConjectureUnifies = false;
|
|
239
243
|
|
|
240
|
-
const
|
|
244
|
+
const node = this.getNode(),
|
|
245
|
+
axiomString = this.getString(),
|
|
241
246
|
axiomLemmaTheoremOrConjectureString = axiomLemmaTheoremOrConjecture.getString();
|
|
242
247
|
|
|
243
|
-
context.trace(`Unifying the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom
|
|
248
|
+
context.trace(`Unifying the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom...`, node);
|
|
244
249
|
|
|
245
250
|
const hypothesesCorrelate = axiomLemmaTheoremOrConjecture.correlateHypotheses(context);
|
|
246
251
|
|
|
@@ -262,7 +267,7 @@ export default domAssigned(class Axiom extends TopLevelAssertion {
|
|
|
262
267
|
}
|
|
263
268
|
|
|
264
269
|
if (axiomLemmaTheoremOrConjectureUnifies) {
|
|
265
|
-
context.debug(`...unified the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom
|
|
270
|
+
context.debug(`...unified the '${axiomLemmaTheoremOrConjectureString}' axiom, lemma, theorem or conjecture with the '${axiomString}' axiom.`, node);
|
|
266
271
|
}
|
|
267
272
|
|
|
268
273
|
return axiomLemmaTheoremOrConjectureUnifies;
|
package/src/dom/conclusion.js
CHANGED
|
@@ -6,11 +6,16 @@ import { domAssigned } from "../dom";
|
|
|
6
6
|
import { statementFromJSON, statementToStatementJSON } from "../utilities/json";
|
|
7
7
|
|
|
8
8
|
export default domAssigned(class Conclusion {
|
|
9
|
-
constructor(string, statement) {
|
|
9
|
+
constructor(node, string, statement) {
|
|
10
|
+
this.node = node;
|
|
10
11
|
this.string = string;
|
|
11
12
|
this.statement = statement;
|
|
12
13
|
}
|
|
13
14
|
|
|
15
|
+
getNode() {
|
|
16
|
+
return this.node;
|
|
17
|
+
}
|
|
18
|
+
|
|
14
19
|
getString() {
|
|
15
20
|
return this.string;
|
|
16
21
|
}
|
|
@@ -24,7 +29,7 @@ export default domAssigned(class Conclusion {
|
|
|
24
29
|
|
|
25
30
|
const conclusionString = this.string; ///
|
|
26
31
|
|
|
27
|
-
context.trace(`Verifying the '${conclusionString}' conclusion
|
|
32
|
+
context.trace(`Verifying the '${conclusionString}' conclusion...`, this.node);
|
|
28
33
|
|
|
29
34
|
if (this.statement !== null) {
|
|
30
35
|
const stated = true,
|
|
@@ -34,11 +39,11 @@ export default domAssigned(class Conclusion {
|
|
|
34
39
|
verifies = statementVerifies; ///
|
|
35
40
|
|
|
36
41
|
} else {
|
|
37
|
-
context.debug(`Unable to verify the '${conclusionString}' conclusion because it is nonsense
|
|
42
|
+
context.debug(`Unable to verify the '${conclusionString}' conclusion because it is nonsense.`, this.node);
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
if (verifies) {
|
|
41
|
-
context.debug(`...verified the '${conclusionString}' conclusion
|
|
46
|
+
context.debug(`...verified the '${conclusionString}' conclusion.`, this.node);
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
return verifies;
|
|
@@ -51,12 +56,12 @@ export default domAssigned(class Conclusion {
|
|
|
51
56
|
statementString = statement.getString(),
|
|
52
57
|
conclusionString = conclusion.getString();
|
|
53
58
|
|
|
54
|
-
specificContext.trace(`Unifying the '${statementString}' statement with the '${conclusionString}' conclusion
|
|
59
|
+
specificContext.trace(`Unifying the '${statementString}' statement with the '${conclusionString}' conclusion...`, this.node);
|
|
55
60
|
|
|
56
61
|
statementUnifies = this.statement.unifyStatement(statement, substitutions, generalContext, specificContext);
|
|
57
62
|
|
|
58
63
|
if (statementUnifies) {
|
|
59
|
-
specificContext.debug(`...unified the '${statementString}' statement with the '${conclusionString}' conclusion
|
|
64
|
+
specificContext.debug(`...unified the '${statementString}' statement with the '${conclusionString}' conclusion.`, this.node);
|
|
60
65
|
}
|
|
61
66
|
|
|
62
67
|
return statementUnifies;
|
|
@@ -76,8 +81,9 @@ export default domAssigned(class Conclusion {
|
|
|
76
81
|
|
|
77
82
|
static fromJSON(json, context) {
|
|
78
83
|
const statement = statementFromJSON(json, context),
|
|
84
|
+
node = null,
|
|
79
85
|
string = statement.getString(),
|
|
80
|
-
conclusion = new Conclusion(string, statement);
|
|
86
|
+
conclusion = new Conclusion(node, string, statement);
|
|
81
87
|
|
|
82
88
|
return conclusion;
|
|
83
89
|
}
|
|
@@ -87,7 +93,7 @@ export default domAssigned(class Conclusion {
|
|
|
87
93
|
node = conclusionNode, ///
|
|
88
94
|
string = context.nodeAsString(node),
|
|
89
95
|
statement = Statement.fromConclusionNode(conclusionNode, context),
|
|
90
|
-
conclusion = new Conclusion(string, statement);
|
|
96
|
+
conclusion = new Conclusion(node, string, statement);
|
|
91
97
|
|
|
92
98
|
return conclusion;
|
|
93
99
|
}
|
package/src/dom/conjecture.js
CHANGED
|
@@ -8,11 +8,12 @@ export default domAssigned(class Conjecture extends TopLevelAssertion {
|
|
|
8
8
|
verify() {
|
|
9
9
|
let verifies;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const node = this.getNode(),
|
|
12
|
+
context = this.getContext(),
|
|
12
13
|
conjecture = this, ///
|
|
13
14
|
conjectureString = conjecture.getString();
|
|
14
15
|
|
|
15
|
-
context.trace(`Verifying the '${conjectureString}' conjecture
|
|
16
|
+
context.trace(`Verifying the '${conjectureString}' conjecture...`, node);
|
|
16
17
|
|
|
17
18
|
verifies = super.verify();
|
|
18
19
|
|
|
@@ -21,7 +22,7 @@ export default domAssigned(class Conjecture extends TopLevelAssertion {
|
|
|
21
22
|
|
|
22
23
|
context.addConjecture(conjecture);
|
|
23
24
|
|
|
24
|
-
context.debug(`...verified the '${conjectureString}' conjecture
|
|
25
|
+
context.debug(`...verified the '${conjectureString}' conjecture.`, node);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
return verifies;
|
|
@@ -12,7 +12,7 @@ export default domAssigned(class BracketedConstructor extends Constructor {
|
|
|
12
12
|
|
|
13
13
|
const termString = term.getString();
|
|
14
14
|
|
|
15
|
-
context.trace(`Unifying the '${termString}' term with the bracketed constructor
|
|
15
|
+
context.trace(`Unifying the '${termString}' term with the bracketed constructor...`);
|
|
16
16
|
|
|
17
17
|
termUnifies = super.unifyTerm(term, context, () => {
|
|
18
18
|
let verifiesAhead = false;
|
|
@@ -46,7 +46,7 @@ export default domAssigned(class BracketedConstructor extends Constructor {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
if (termUnifies) {
|
|
49
|
-
context.debug(`...unified the '${termString}' term with the bracketed constructor
|
|
49
|
+
context.debug(`...unified the '${termString}' term with the bracketed constructor.`);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
return termUnifies;
|
package/src/dom/constructor.js
CHANGED
|
@@ -34,7 +34,7 @@ export default domAssigned(class Constructor {
|
|
|
34
34
|
termString = term.getString(),
|
|
35
35
|
constructorString = constructor.getString();
|
|
36
36
|
|
|
37
|
-
context.trace(`Unifying the '${termString}' term with the '${constructorString}' constructor
|
|
37
|
+
context.trace(`Unifying the '${termString}' term with the '${constructorString}' constructor...`);
|
|
38
38
|
|
|
39
39
|
const termUnifiesWithConstructor = unifyTermWithConstructor(term, constructor, context);
|
|
40
40
|
|
|
@@ -51,7 +51,7 @@ export default domAssigned(class Constructor {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (termUnifies) {
|
|
54
|
-
context.debug(`...unified the '${termString}' term with the '${constructorString}' constructor
|
|
54
|
+
context.debug(`...unified the '${termString}' term with the '${constructorString}' constructor.`);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
return termUnifies;
|
|
@@ -7,8 +7,9 @@ import { domAssigned } from "../../dom";
|
|
|
7
7
|
import combinatorVerifier from "../../verifier/combinator";
|
|
8
8
|
|
|
9
9
|
export default domAssigned(class CombinatorDeclaration {
|
|
10
|
-
constructor(context, string, combinator) {
|
|
10
|
+
constructor(context, node, string, combinator) {
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.combinator = combinator;
|
|
14
15
|
}
|
|
@@ -17,6 +18,10 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
17
18
|
return this.context;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
getNode() {
|
|
22
|
+
return this.node;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
getString() {
|
|
21
26
|
return this.string;
|
|
22
27
|
}
|
|
@@ -30,7 +35,7 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
30
35
|
|
|
31
36
|
const combinatorDeclarationString = this.getString(); ///
|
|
32
37
|
|
|
33
|
-
this.context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration
|
|
38
|
+
this.context.trace(`Verifying the '${combinatorDeclarationString}' combinator declaration...`, this.node);
|
|
34
39
|
|
|
35
40
|
const combinatorVerifies = this.verifyCombinator();
|
|
36
41
|
|
|
@@ -41,7 +46,7 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
if (verifies) {
|
|
44
|
-
this.context.debug(`...verified the '${combinatorDeclarationString}' combinator declaration
|
|
49
|
+
this.context.debug(`...verified the '${combinatorDeclarationString}' combinator declaration.`, this.node);
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
return verifies;
|
|
@@ -52,7 +57,7 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
52
57
|
|
|
53
58
|
const combinatorString = this.combinator.getString();
|
|
54
59
|
|
|
55
|
-
this.context.trace(`Verifying the '${combinatorString}' combinator
|
|
60
|
+
this.context.trace(`Verifying the '${combinatorString}' combinator...`, this.node);
|
|
56
61
|
|
|
57
62
|
const statement = this.combinator.getStatement(),
|
|
58
63
|
statementNode = statement.getNode();
|
|
@@ -60,7 +65,7 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
60
65
|
statementVerifies = combinatorVerifier.verifyStatement(statementNode, this.context);
|
|
61
66
|
|
|
62
67
|
if (statementVerifies) {
|
|
63
|
-
this.context.debug(`...verified the '${combinatorString}' combinator
|
|
68
|
+
this.context.debug(`...verified the '${combinatorString}' combinator.`, this.node);
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
return statementVerifies;
|
|
@@ -73,7 +78,7 @@ export default domAssigned(class CombinatorDeclaration {
|
|
|
73
78
|
node = combinatorDeclarationNode, ///
|
|
74
79
|
string = context.nodeAsString(node),
|
|
75
80
|
combinator = Combinator.fromCombinatorDeclarationNode(combinatorDeclarationNode, context),
|
|
76
|
-
combinatorDeclaration = new CombinatorDeclaration(context, string, combinator);
|
|
81
|
+
combinatorDeclaration = new CombinatorDeclaration(context, node, string, combinator);
|
|
77
82
|
|
|
78
83
|
return combinatorDeclaration;
|
|
79
84
|
}
|
|
@@ -7,8 +7,9 @@ import { domAssigned } from "../../dom";
|
|
|
7
7
|
import { stringFromTypeNameNameAndSuperTypes } from "../../utilities/type";
|
|
8
8
|
|
|
9
9
|
export default domAssigned(class ComplexTypeDeclaration {
|
|
10
|
-
constructor(context, string, type) {
|
|
10
|
+
constructor(context, node, string, type) {
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.type = type;
|
|
14
15
|
}
|
|
@@ -17,6 +18,10 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
17
18
|
return this.context;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
getNode() {
|
|
22
|
+
return this.node;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
getString() {
|
|
21
26
|
return this.string;
|
|
22
27
|
}
|
|
@@ -46,7 +51,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
46
51
|
|
|
47
52
|
const complexTypeDeclarationString = this.getString();
|
|
48
53
|
|
|
49
|
-
this.context.trace(`Verifying the '${complexTypeDeclarationString}' complex type declaration
|
|
54
|
+
this.context.trace(`Verifying the '${complexTypeDeclarationString}' complex type declaration...`, this.node);
|
|
50
55
|
|
|
51
56
|
const typeVerifies = this.verifyType();
|
|
52
57
|
|
|
@@ -65,7 +70,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
if (verifies) {
|
|
68
|
-
this.context.debug(`...verified the '${complexTypeDeclarationString}' complex type declaration
|
|
73
|
+
this.context.debug(`...verified the '${complexTypeDeclarationString}' complex type declaration.`, this.node);
|
|
69
74
|
}
|
|
70
75
|
|
|
71
76
|
return verifies;
|
|
@@ -76,7 +81,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
76
81
|
|
|
77
82
|
const complexTypeString = this.type.getString();
|
|
78
83
|
|
|
79
|
-
this.context.trace(`Verifying the '${complexTypeString}' complex type
|
|
84
|
+
this.context.trace(`Verifying the '${complexTypeString}' complex type...`, this.node);
|
|
80
85
|
|
|
81
86
|
const typeName = this.type.getName(),
|
|
82
87
|
releaseTypes = this.getReleaseTypes(),
|
|
@@ -89,13 +94,13 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
89
94
|
});
|
|
90
95
|
|
|
91
96
|
if (typePresent) {
|
|
92
|
-
this.context.debug(`The type '${complexTypeString}' is already present in the package
|
|
97
|
+
this.context.debug(`The type '${complexTypeString}' is already present in the package.`, this.node);
|
|
93
98
|
} else {
|
|
94
99
|
typeVerifies = true;
|
|
95
100
|
}
|
|
96
101
|
|
|
97
102
|
if (typeVerifies) {
|
|
98
|
-
this.context.debug(`...verified the '${complexTypeString}' complex type
|
|
103
|
+
this.context.debug(`...verified the '${complexTypeString}' complex type.`, this.node);
|
|
99
104
|
}
|
|
100
105
|
|
|
101
106
|
return typeVerifies;
|
|
@@ -106,7 +111,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
106
111
|
|
|
107
112
|
const superTypeString = superType.getString();
|
|
108
113
|
|
|
109
|
-
this.context.trace(`Verifying the '${superTypeString}' super-type
|
|
114
|
+
this.context.trace(`Verifying the '${superTypeString}' super-type...`, this.node);
|
|
110
115
|
|
|
111
116
|
const superTypeName = superType.getName(),
|
|
112
117
|
superTypePresent = this.context.isTypePresentByTypeName(superTypeName);
|
|
@@ -116,7 +121,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
116
121
|
}
|
|
117
122
|
|
|
118
123
|
if (superTypeVerifies) {
|
|
119
|
-
this.context.debug(`...verified the '${superTypeString}' super-type
|
|
124
|
+
this.context.debug(`...verified the '${superTypeString}' super-type.`, this.node);
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
return superTypeVerifies;
|
|
@@ -125,7 +130,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
125
130
|
verifySuperTypes() {
|
|
126
131
|
let superTypesVerify = false;
|
|
127
132
|
|
|
128
|
-
this.context.trace(`Verifying the super-types
|
|
133
|
+
this.context.trace(`Verifying the super-types...`, this.node);
|
|
129
134
|
|
|
130
135
|
let superTypes;
|
|
131
136
|
|
|
@@ -150,7 +155,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
150
155
|
if (typeBasic) {
|
|
151
156
|
superTypesVerify = true;
|
|
152
157
|
|
|
153
|
-
this.context.trace(`The '${typeString}' type is basic
|
|
158
|
+
this.context.trace(`The '${typeString}' type is basic., this.node`)
|
|
154
159
|
} else {
|
|
155
160
|
const superTypeNames = superTypes.map((superType) => {
|
|
156
161
|
const superTypeName = superType.getName();
|
|
@@ -160,7 +165,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
160
165
|
superTypeNamesIncludesTypeName = superTypeNames.includes(typeName);
|
|
161
166
|
|
|
162
167
|
if (superTypeNamesIncludesTypeName) {
|
|
163
|
-
this.context.trace(`The '${typeName}' type cannot be a super-type
|
|
168
|
+
this.context.trace(`The '${typeName}' type cannot be a super-type `, this.node);
|
|
164
169
|
} else {
|
|
165
170
|
if (superTypesLength === 0) {
|
|
166
171
|
const type = this.context.findTypeByTypeName(typeName),
|
|
@@ -197,7 +202,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
197
202
|
}
|
|
198
203
|
|
|
199
204
|
if (superTypesVerify) {
|
|
200
|
-
this.context.debug(`...verified the super-types
|
|
205
|
+
this.context.debug(`...verified the super-types.`, this.node);
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
return superTypesVerify;
|
|
@@ -208,7 +213,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
208
213
|
|
|
209
214
|
const propertyString = property.getString();
|
|
210
215
|
|
|
211
|
-
this.context.trace(`Verifying the '${propertyString}' property
|
|
216
|
+
this.context.trace(`Verifying the '${propertyString}' property...`, this.node);
|
|
212
217
|
|
|
213
218
|
const propertyIdentifier = property.getIdentifier(),
|
|
214
219
|
count = properties.reduce((count, property) => {
|
|
@@ -222,7 +227,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
222
227
|
}, 0);
|
|
223
228
|
|
|
224
229
|
if (count > 1) {
|
|
225
|
-
this.context.debug(`The '${propertyString}' property appears more than once
|
|
230
|
+
this.context.debug(`The '${propertyString}' property appears more than once.`, this.node);
|
|
226
231
|
} else {
|
|
227
232
|
const superTypeProperty = superTypeProperties.find((superTypeProperty) => {
|
|
228
233
|
const propertyIdentifierMatches = superTypeProperty.matchPropertyIdentifier(propertyIdentifier);
|
|
@@ -235,7 +240,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
235
240
|
if (superTypeProperty !== null) {
|
|
236
241
|
const superTypePropertyString = superTypeProperty.getString();
|
|
237
242
|
|
|
238
|
-
this.context.debug(`The '${propertyString}' property matches the super-type's '${superTypePropertyString}' property
|
|
243
|
+
this.context.debug(`The '${propertyString}' property matches the super-type's '${superTypePropertyString}' property.`, this.node);
|
|
239
244
|
} else {
|
|
240
245
|
let propertyType;
|
|
241
246
|
|
|
@@ -265,7 +270,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
265
270
|
property.setType(this.type);
|
|
266
271
|
}
|
|
267
272
|
|
|
268
|
-
this.context.debug(`verifies the '${propertyString}' property
|
|
273
|
+
this.context.debug(`verifies the '${propertyString}' property.`, this.node);
|
|
269
274
|
}
|
|
270
275
|
|
|
271
276
|
return propertyVerifies;
|
|
@@ -306,7 +311,7 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
306
311
|
} else {
|
|
307
312
|
const propertyTypeString = propertyType.getString(); ///
|
|
308
313
|
|
|
309
|
-
this.context.trace(`Verifying the '${propertyTypeString}' property type
|
|
314
|
+
this.context.trace(`Verifying the '${propertyTypeString}' property type...`, this.node);
|
|
310
315
|
|
|
311
316
|
const propertyTypeName = propertyType.getName(),
|
|
312
317
|
propertyTypePresent = this.context.isTypePresentByTypeName(propertyTypeName);
|
|
@@ -314,13 +319,13 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
314
319
|
if (!propertyTypePresent) {
|
|
315
320
|
const propertyTypeString = propertyType.getString();
|
|
316
321
|
|
|
317
|
-
this.context.debug(`The '${propertyTypeString}' property type is not present
|
|
322
|
+
this.context.debug(`The '${propertyTypeString}' property type is not present.`, this.node);
|
|
318
323
|
} else {
|
|
319
324
|
propertyTypeVerifies = true;
|
|
320
325
|
}
|
|
321
326
|
|
|
322
327
|
if (propertyTypeVerifies) {
|
|
323
|
-
this.context.debug(`...verified the '${propertyTypeString}' property type
|
|
328
|
+
this.context.debug(`...verified the '${propertyTypeString}' property type.`, this.node);
|
|
324
329
|
}
|
|
325
330
|
}
|
|
326
331
|
|
|
@@ -331,11 +336,12 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
331
336
|
|
|
332
337
|
static fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context) {
|
|
333
338
|
const { Type } = dom,
|
|
339
|
+
node = complexTypeDeclarationNode, ///
|
|
334
340
|
type = Type.fromComplexTypeDeclarationNode(complexTypeDeclarationNode, context),
|
|
335
341
|
typeName = type.getName(),
|
|
336
342
|
superTypes = type.getSuperTypes(),
|
|
337
343
|
string = stringFromTypeNameNameAndSuperTypes(typeName, superTypes),
|
|
338
|
-
complexTypeDeclaration = new ComplexTypeDeclaration(context, string, type);
|
|
344
|
+
complexTypeDeclaration = new ComplexTypeDeclaration(context, node, string, type);
|
|
339
345
|
|
|
340
346
|
return complexTypeDeclaration;
|
|
341
347
|
}
|
|
@@ -7,8 +7,9 @@ import constructorVerifier from "../../verifier/constructor";
|
|
|
7
7
|
import { domAssigned } from "../../dom";
|
|
8
8
|
|
|
9
9
|
export default domAssigned(class ConstructorDeclaration {
|
|
10
|
-
constructor(context, string, constructor) {
|
|
10
|
+
constructor(context, node, string, constructor) {
|
|
11
11
|
this.context = context;
|
|
12
|
+
this.node = node;
|
|
12
13
|
this.string = string;
|
|
13
14
|
this.constructor = constructor;
|
|
14
15
|
}
|
|
@@ -17,6 +18,10 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
17
18
|
return this.context;
|
|
18
19
|
}
|
|
19
20
|
|
|
21
|
+
getNode() {
|
|
22
|
+
return this.node;
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
getString() {
|
|
21
26
|
return this.string;
|
|
22
27
|
}
|
|
@@ -30,7 +35,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
30
35
|
|
|
31
36
|
const constructorDeclarationString = this.getString(); ///
|
|
32
37
|
|
|
33
|
-
this.context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration
|
|
38
|
+
this.context.trace(`Verifying the '${constructorDeclarationString}' constructor declaration...`, this.node);
|
|
34
39
|
|
|
35
40
|
const constructorTypeVerifies = this.verifyConstructorType();
|
|
36
41
|
|
|
@@ -45,7 +50,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
if (verifies) {
|
|
48
|
-
this.context.debug(`...verified the '${constructorDeclarationString}' constructor declaration
|
|
53
|
+
this.context.debug(`...verified the '${constructorDeclarationString}' constructor declaration.`, this.node);
|
|
49
54
|
}
|
|
50
55
|
|
|
51
56
|
return verifies;
|
|
@@ -56,7 +61,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
56
61
|
|
|
57
62
|
const constructorString = this.constructor.getString();
|
|
58
63
|
|
|
59
|
-
this.context.trace(`Verifying the '${constructorString}' constructor
|
|
64
|
+
this.context.trace(`Verifying the '${constructorString}' constructor...`, this.node);
|
|
60
65
|
|
|
61
66
|
const term = this.constructor.getTerm(),
|
|
62
67
|
termNode = term.getNode();
|
|
@@ -64,7 +69,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
64
69
|
constructorVerifies = constructorVerifier.verifyTerm(termNode, this.context);
|
|
65
70
|
|
|
66
71
|
if (constructorVerifies) {
|
|
67
|
-
this.context.debug(`...verified the '${constructorString}' constructor
|
|
72
|
+
this.context.debug(`...verified the '${constructorString}' constructor.`, this.node);
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
return constructorVerifies;
|
|
@@ -80,7 +85,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
80
85
|
const typeName = type.getName(),
|
|
81
86
|
typeString = type.getString();
|
|
82
87
|
|
|
83
|
-
this.context.trace(`Verifying the '${typeString}' type
|
|
88
|
+
this.context.trace(`Verifying the '${typeString}' type...`, this.node);
|
|
84
89
|
|
|
85
90
|
const includeSupertypes = false,
|
|
86
91
|
provisional = type.isProvisional(includeSupertypes);
|
|
@@ -90,14 +95,14 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
90
95
|
const typePresent = (type !== null)
|
|
91
96
|
|
|
92
97
|
if (!typePresent) {
|
|
93
|
-
this.context.debug(`The '${typeString}' type is not present
|
|
98
|
+
this.context.debug(`The '${typeString}' type is not present.`, this.node);
|
|
94
99
|
} else {
|
|
95
100
|
const provisionalMatches = type.matchProvisional(provisional);
|
|
96
101
|
|
|
97
102
|
if (!provisionalMatches) {
|
|
98
103
|
provisional ?
|
|
99
|
-
this.context.debug(`The '${typeString}' type is present but not provisional
|
|
100
|
-
this.context.debug(`The '${typeString}' type is present but provisional
|
|
104
|
+
this.context.debug(`The '${typeString}' type is present but not provisional.`, this.node) :
|
|
105
|
+
this.context.debug(`The '${typeString}' type is present but provisional.`, this.node);
|
|
101
106
|
} else {
|
|
102
107
|
this.constructor.setType(type);
|
|
103
108
|
|
|
@@ -106,7 +111,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
106
111
|
}
|
|
107
112
|
|
|
108
113
|
if (constructorTypeVerifies) {
|
|
109
|
-
this.context.debug(`...verified the '${typeString}' type
|
|
114
|
+
this.context.debug(`...verified the '${typeString}' type.`, this.node);
|
|
110
115
|
}
|
|
111
116
|
|
|
112
117
|
return constructorTypeVerifies;
|
|
@@ -119,7 +124,7 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
119
124
|
node = constructorDeclarationNode, ///
|
|
120
125
|
string = context.nodeAsString(node),
|
|
121
126
|
constructor = Constructor.fromConstructorDeclarationNode(constructorDeclarationNode, context),
|
|
122
|
-
constructorDeclaration = new ConstructorDeclaration(context, string, constructor);
|
|
127
|
+
constructorDeclaration = new ConstructorDeclaration(context, node, string, constructor);
|
|
123
128
|
|
|
124
129
|
return constructorDeclaration;
|
|
125
130
|
}
|