occam-verify-cli 1.0.166 → 1.0.168
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/assignment/variable.js +3 -3
- package/lib/context/file.js +6 -4
- package/lib/context/release.js +32 -3
- package/lib/dom/assertion/type.js +10 -15
- package/lib/dom/combinator/bracketed.js +25 -4
- package/lib/dom/constructor.js +6 -29
- package/lib/dom/declaration/complexType.js +26 -60
- package/lib/dom/declaration/constructor.js +10 -15
- package/lib/dom/declaration/metavariable.js +10 -15
- package/lib/dom/declaration/type.js +20 -46
- package/lib/dom/declaration/variable.js +19 -19
- package/lib/dom/property.js +3 -3
- package/lib/dom/propertyRelation.js +3 -3
- package/lib/dom/term.js +4 -4
- package/lib/dom/type.js +80 -68
- package/lib/dom/variable.js +24 -52
- package/lib/equivalence.js +3 -3
- package/lib/node/assertion/contained.js +131 -0
- package/lib/node/assertion/defined.js +131 -0
- package/lib/node/assertion/property.js +131 -0
- package/lib/node/assertion/satisfies.js +131 -0
- package/lib/node/assertion/subproof.js +131 -0
- package/lib/node/assertion/type.js +131 -0
- package/lib/node/axiom.js +131 -0
- package/lib/node/combinator.js +131 -0
- package/lib/node/conclusion.js +131 -0
- package/lib/node/conjecture.js +131 -0
- package/lib/node/constructor.js +131 -0
- package/lib/node/declaration/combinator.js +131 -0
- package/lib/node/declaration/complexType.js +131 -0
- package/lib/node/declaration/constructor.js +131 -0
- package/lib/node/declaration/metavariable.js +131 -0
- package/lib/node/declaration/type.js +131 -0
- package/lib/node/declaration/variable.js +131 -0
- package/lib/node/declaration.js +131 -0
- package/lib/node/deduction.js +131 -0
- package/lib/node/derivation.js +131 -0
- package/lib/node/equality.js +131 -0
- package/lib/node/error.js +131 -0
- package/lib/node/frame.js +131 -0
- package/lib/node/judgement.js +131 -0
- package/lib/node/label.js +131 -0
- package/lib/node/lemma.js +131 -0
- package/lib/node/metaLemma.js +131 -0
- package/lib/node/metaType.js +131 -0
- package/lib/node/metatheorem.js +131 -0
- package/lib/node/metavariable.js +131 -0
- package/lib/node/parameter.js +131 -0
- package/lib/node/premise.js +131 -0
- package/lib/node/procedureCall.js +131 -0
- package/lib/node/proof.js +131 -0
- package/lib/node/property.js +131 -0
- package/lib/node/propertyRelation.js +131 -0
- package/lib/node/reference.js +131 -0
- package/lib/node/rule.js +131 -0
- package/lib/node/statement.js +131 -0
- package/lib/node/step.js +131 -0
- package/lib/node/subDerivation.js +131 -0
- package/lib/node/subproof.js +131 -0
- package/lib/node/supposition.js +131 -0
- package/lib/node/term.js +131 -0
- package/lib/node/theorem.js +131 -0
- package/lib/node/topLevelAssertion.js +131 -0
- package/lib/node/topLevelMetaAssertion.js +131 -0
- package/lib/node/type.js +131 -0
- package/lib/node/variable.js +131 -0
- package/lib/node.js +80 -0
- package/lib/nodeMap.js +80 -0
- package/lib/nominal/lexer.js +114 -0
- package/lib/nominal/parser.js +128 -0
- package/lib/ruleNames.js +198 -0
- package/lib/utilities/parser.js +21 -0
- package/lib/utilities/type.js +23 -0
- package/package.json +3 -2
- package/src/assignment/variable.js +4 -4
- package/src/context/file.js +10 -7
- package/src/context/release.js +8 -3
- package/src/dom/assertion/type.js +11 -16
- package/src/dom/combinator/bracketed.js +1 -6
- package/src/dom/constructor.js +5 -36
- package/src/dom/declaration/complexType.js +41 -52
- package/src/dom/declaration/constructor.js +11 -15
- package/src/dom/declaration/metavariable.js +11 -15
- package/src/dom/declaration/type.js +19 -44
- package/src/dom/declaration/variable.js +29 -21
- package/src/dom/property.js +2 -2
- package/src/dom/propertyRelation.js +2 -2
- package/src/dom/term.js +3 -3
- package/src/dom/type.js +120 -89
- package/src/dom/variable.js +27 -64
- package/src/equivalence.js +2 -2
- package/src/node/assertion/contained.js +5 -0
- package/src/node/assertion/defined.js +5 -0
- package/src/node/assertion/property.js +5 -0
- package/src/node/assertion/satisfies.js +5 -0
- package/src/node/assertion/subproof.js +5 -0
- package/src/node/assertion/type.js +5 -0
- package/src/node/axiom.js +5 -0
- package/src/node/combinator.js +5 -0
- package/src/node/conclusion.js +5 -0
- package/src/node/conjecture.js +5 -0
- package/src/node/constructor.js +5 -0
- package/src/node/declaration/combinator.js +5 -0
- package/src/node/declaration/complexType.js +5 -0
- package/src/node/declaration/constructor.js +5 -0
- package/src/node/declaration/metavariable.js +5 -0
- package/src/node/declaration/type.js +5 -0
- package/src/node/declaration/variable.js +5 -0
- package/src/node/declaration.js +5 -0
- package/src/node/deduction.js +5 -0
- package/src/node/derivation.js +5 -0
- package/src/node/equality.js +5 -0
- package/src/node/error.js +5 -0
- package/src/node/frame.js +5 -0
- package/src/node/judgement.js +5 -0
- package/src/node/label.js +5 -0
- package/src/node/lemma.js +5 -0
- package/src/node/metaLemma.js +5 -0
- package/src/node/metaType.js +5 -0
- package/src/node/metatheorem.js +5 -0
- package/src/node/metavariable.js +5 -0
- package/src/node/parameter.js +5 -0
- package/src/node/premise.js +5 -0
- package/src/node/procedureCall.js +5 -0
- package/src/node/proof.js +5 -0
- package/src/node/property.js +5 -0
- package/src/node/propertyRelation.js +5 -0
- package/src/node/reference.js +5 -0
- package/src/node/rule.js +5 -0
- package/src/node/statement.js +5 -0
- package/src/node/step.js +5 -0
- package/src/node/subDerivation.js +5 -0
- package/src/node/subproof.js +5 -0
- package/src/node/supposition.js +5 -0
- package/src/node/term.js +5 -0
- package/src/node/theorem.js +5 -0
- package/src/node/topLevelAssertion.js +5 -0
- package/src/node/topLevelMetaAssertion.js +5 -0
- package/src/node/type.js +5 -0
- package/src/node/variable.js +5 -0
- package/src/node.js +5 -0
- package/src/nodeMap.js +146 -0
- package/src/nominal/lexer.js +11 -0
- package/src/nominal/parser.js +37 -0
- package/src/ruleNames.js +48 -0
- package/src/utilities/parser.js +18 -0
- package/src/utilities/type.js +19 -0
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
|
-
import { objectType } from "../type";
|
|
6
5
|
import { domAssigned } from "../../dom";
|
|
7
|
-
import {
|
|
6
|
+
import { superTypesStringFromSuperTypes } from "../../utilities/type";
|
|
8
7
|
|
|
9
8
|
export default domAssigned(class ComplexTypeDeclaration {
|
|
10
9
|
constructor(fileContext, string, type) {
|
|
@@ -74,26 +73,21 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
74
73
|
verifyType() {
|
|
75
74
|
let typeVerified = false;
|
|
76
75
|
|
|
77
|
-
const typeName = this.type.getName()
|
|
76
|
+
const typeName = this.type.getName(),
|
|
77
|
+
typeString = this.type.getString();
|
|
78
78
|
|
|
79
|
-
this.fileContext.trace(`Verifying the '${
|
|
79
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
80
80
|
|
|
81
81
|
const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
|
|
82
82
|
|
|
83
83
|
if (typePresent) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (typeRefined) {
|
|
87
|
-
typeVerified = true;
|
|
88
|
-
} else {
|
|
89
|
-
this.fileContext.debug(`The type '${typeName}' is already present.`);
|
|
90
|
-
}
|
|
84
|
+
this.fileContext.debug(`The type '${typeString}' is already present.`);
|
|
91
85
|
} else {
|
|
92
86
|
typeVerified = true;
|
|
93
87
|
}
|
|
94
88
|
|
|
95
89
|
if (typeVerified) {
|
|
96
|
-
this.fileContext.debug(`...verified the '${
|
|
90
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
97
91
|
}
|
|
98
92
|
|
|
99
93
|
return typeVerified;
|
|
@@ -102,58 +96,57 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
102
96
|
verifySuperTypes() {
|
|
103
97
|
let superTypesVerified;
|
|
104
98
|
|
|
105
|
-
const typeBasic = this.type.isBasic()
|
|
106
|
-
typeRefined = this.type.isRefined();
|
|
99
|
+
const typeBasic = this.type.isBasic();
|
|
107
100
|
|
|
108
|
-
if (typeBasic
|
|
101
|
+
if (typeBasic) {
|
|
109
102
|
superTypesVerified = true;
|
|
110
103
|
} else {
|
|
111
|
-
const
|
|
104
|
+
const typeString = this.type.getString(),
|
|
112
105
|
superTypes = this.type.getSuperTypes(),
|
|
113
106
|
superTypesString = superTypesStringFromSuperTypes(superTypes);
|
|
114
107
|
|
|
115
|
-
this.fileContext.trace(`Verifying the '${
|
|
108
|
+
this.fileContext.trace(`Verifying the '${typeString}' type's ${superTypesString} super-types...`);
|
|
116
109
|
|
|
117
110
|
superTypesVerified = superTypes.every((superType) => {
|
|
118
|
-
const
|
|
111
|
+
const superTypesVerified = this.verifySuperTypes(superType);
|
|
119
112
|
|
|
120
|
-
if (
|
|
113
|
+
if (superTypesVerified) {
|
|
121
114
|
return true;
|
|
122
115
|
}
|
|
123
116
|
});
|
|
124
117
|
|
|
125
118
|
if (superTypesVerified) {
|
|
126
|
-
this.fileContext.debug(`...verified the '${
|
|
119
|
+
this.fileContext.debug(`...verified the '${typeString}' type's ${superTypesString} super-types.`);
|
|
127
120
|
}
|
|
128
121
|
}
|
|
129
122
|
|
|
130
123
|
return superTypesVerified;
|
|
131
124
|
}
|
|
132
125
|
|
|
133
|
-
|
|
134
|
-
let
|
|
126
|
+
verifySuperTypes(superType) {
|
|
127
|
+
let superTypesVerified;
|
|
135
128
|
|
|
136
|
-
const
|
|
129
|
+
const typeBasic = this.type.isBasic();
|
|
137
130
|
|
|
138
|
-
if (
|
|
139
|
-
|
|
131
|
+
if (typeBasic) {
|
|
132
|
+
superTypesVerified = true;
|
|
140
133
|
} else {
|
|
141
|
-
const
|
|
142
|
-
superTypeString =
|
|
134
|
+
const typeString = this.type.getString(),
|
|
135
|
+
superTypeString = superType.getString();
|
|
143
136
|
|
|
144
|
-
this.fileContext.trace(`Verifying the '${
|
|
137
|
+
this.fileContext.trace(`Verifying the '${typeString}' type's '${superTypeString}' super-type...`);
|
|
145
138
|
|
|
146
139
|
const superTypeName = superType.getName(),
|
|
147
140
|
superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
|
|
148
141
|
|
|
149
|
-
|
|
142
|
+
superTypesVerified = superTypePresent; ///
|
|
150
143
|
|
|
151
|
-
if (
|
|
152
|
-
this.fileContext.debug(`...verified the '${
|
|
144
|
+
if (superTypesVerified) {
|
|
145
|
+
this.fileContext.debug(`...verified the '${typeString}' type's '${superTypeString}' super-type.`);
|
|
153
146
|
}
|
|
154
147
|
}
|
|
155
148
|
|
|
156
|
-
return
|
|
149
|
+
return superTypesVerified;
|
|
157
150
|
}
|
|
158
151
|
|
|
159
152
|
verifyProperty(property, properties, superTypeProperties) {
|
|
@@ -243,32 +236,28 @@ export default domAssigned(class ComplexTypeDeclaration {
|
|
|
243
236
|
verifyPropertyType(propertyType) {
|
|
244
237
|
let propertyTypeVerified = false;
|
|
245
238
|
|
|
246
|
-
|
|
247
|
-
propertyTypeVerified = true;
|
|
248
|
-
} else {
|
|
249
|
-
const typeName = this.type.getName(),
|
|
250
|
-
propertyTypeName = propertyType.getName();
|
|
239
|
+
const typeEqualToPropertyType = this.type.isEqualTo(propertyType);
|
|
251
240
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
241
|
+
if (typeEqualToPropertyType) {
|
|
242
|
+
propertyTypeVerified = true;
|
|
243
|
+
} else {
|
|
244
|
+
const propertyTypeString = propertyType.getString(); ///
|
|
256
245
|
|
|
257
|
-
|
|
246
|
+
this.fileContext.trace(`Verifying the '${propertyTypeString}' property type...`);
|
|
258
247
|
|
|
259
|
-
|
|
248
|
+
const propertyTypeName = propertyType.getName(),
|
|
249
|
+
propertyTypePresent = this.fileContext.isTypePresentByTypeName(propertyTypeName);
|
|
260
250
|
|
|
261
|
-
|
|
262
|
-
|
|
251
|
+
if (!propertyTypePresent) {
|
|
252
|
+
const propertyTypeString = propertyType.getString();
|
|
263
253
|
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
254
|
+
this.fileContext.debug(`The '${propertyTypeString}' property type is not present.`);
|
|
255
|
+
} else {
|
|
256
|
+
propertyTypeVerified = true;
|
|
257
|
+
}
|
|
268
258
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
259
|
+
if (propertyTypeVerified) {
|
|
260
|
+
this.fileContext.debug(`...verified the '${propertyTypeString}' property type.`);
|
|
272
261
|
}
|
|
273
262
|
}
|
|
274
263
|
|
|
@@ -4,7 +4,6 @@ import dom from "../../dom";
|
|
|
4
4
|
|
|
5
5
|
import constructorVerifier from "../../verifier/constructor";
|
|
6
6
|
|
|
7
|
-
import { objectType } from "../type";
|
|
8
7
|
import { domAssigned } from "../../dom";
|
|
9
8
|
|
|
10
9
|
export default domAssigned(class ConstructorDeclaration {
|
|
@@ -83,24 +82,21 @@ export default domAssigned(class ConstructorDeclaration {
|
|
|
83
82
|
|
|
84
83
|
const type = this.constructor.getType();
|
|
85
84
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
} else {
|
|
89
|
-
const typeName = type.getName();
|
|
85
|
+
const typeName = type.getName(),
|
|
86
|
+
typeString = type.getString();
|
|
90
87
|
|
|
91
|
-
|
|
88
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
92
89
|
|
|
93
|
-
|
|
90
|
+
const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
92
|
+
if (!typePresent) {
|
|
93
|
+
this.fileContext.debug(`The '${typeString}' type is not present.`);
|
|
94
|
+
} else {
|
|
95
|
+
typeVerified = true;
|
|
96
|
+
}
|
|
100
97
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
98
|
+
if (typeVerified) {
|
|
99
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
104
100
|
}
|
|
105
101
|
|
|
106
102
|
return typeVerified;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
|
-
import { objectType } from "../type";
|
|
6
5
|
import { nodeQuery } from "../../utilities/query";
|
|
7
6
|
import { domAssigned } from "../../dom";
|
|
8
7
|
|
|
@@ -56,24 +55,21 @@ export default domAssigned(class MetavariableDeclaration {
|
|
|
56
55
|
if (type === null) {
|
|
57
56
|
typeVerified = true;
|
|
58
57
|
} else {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} else {
|
|
62
|
-
const typeName = type.getName();
|
|
58
|
+
const typeName = type.getName(),
|
|
59
|
+
typeString = type.getString();
|
|
63
60
|
|
|
64
|
-
|
|
61
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
|
|
67
64
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
if (!typePresent) {
|
|
66
|
+
this.fileContext.debug(`The '${typeString}' type is not present.`);
|
|
67
|
+
} else {
|
|
68
|
+
typeVerified = true;
|
|
69
|
+
}
|
|
73
70
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
71
|
+
if (typeVerified) {
|
|
72
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
77
73
|
}
|
|
78
74
|
}
|
|
79
75
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
|
-
import { objectType } from "../type";
|
|
6
5
|
import { domAssigned } from "../../dom";
|
|
6
|
+
import { superTypesStringFromSuperTypes } from "../../utilities/type";
|
|
7
7
|
|
|
8
8
|
export default domAssigned(class TypeDeclaration {
|
|
9
9
|
constructor(fileContext, string, type) {
|
|
@@ -67,18 +67,21 @@ export default domAssigned(class TypeDeclaration {
|
|
|
67
67
|
verifyType() {
|
|
68
68
|
let typeVerified = false;
|
|
69
69
|
|
|
70
|
-
const typeName = this.type.getName()
|
|
70
|
+
const typeName = this.type.getName(),
|
|
71
|
+
typeString = this.type.getString();
|
|
71
72
|
|
|
72
|
-
this.fileContext.trace(`Verifying the '${
|
|
73
|
+
this.fileContext.trace(`Verifying the '${typeString}' type...`);
|
|
73
74
|
|
|
74
75
|
const typePresent = this.fileContext.isTypePresentByTypeName(typeName);
|
|
75
76
|
|
|
76
|
-
if (
|
|
77
|
+
if (typePresent) {
|
|
78
|
+
this.fileContext.debug(`The type '${typeString}' is already present.`);
|
|
79
|
+
} else {
|
|
77
80
|
typeVerified = true;
|
|
78
81
|
}
|
|
79
82
|
|
|
80
83
|
if (typeVerified) {
|
|
81
|
-
this.fileContext.debug(`...verified the '${
|
|
84
|
+
this.fileContext.debug(`...verified the '${typeString}' type.`);
|
|
82
85
|
}
|
|
83
86
|
|
|
84
87
|
return typeVerified;
|
|
@@ -92,11 +95,11 @@ export default domAssigned(class TypeDeclaration {
|
|
|
92
95
|
if (typeBasic) {
|
|
93
96
|
superTypesVerified = true;
|
|
94
97
|
} else {
|
|
95
|
-
const
|
|
98
|
+
const typeString = this.type.getString(),
|
|
96
99
|
superTypes = this.type.getSuperTypes(),
|
|
97
100
|
superTypesString = superTypesStringFromSuperTypes(superTypes);
|
|
98
101
|
|
|
99
|
-
this.fileContext.trace(`Verifying the '${
|
|
102
|
+
this.fileContext.trace(`Verifying the '${typeString}' type's ${superTypesString} super-types...`);
|
|
100
103
|
|
|
101
104
|
superTypesVerified = superTypes.every((superType) => {
|
|
102
105
|
const superTypeVerified = this.verifySuperType(superType);
|
|
@@ -107,7 +110,7 @@ export default domAssigned(class TypeDeclaration {
|
|
|
107
110
|
});
|
|
108
111
|
|
|
109
112
|
if (superTypesVerified) {
|
|
110
|
-
this.fileContext.debug(`...verified the '${
|
|
113
|
+
this.fileContext.debug(`...verified the '${typeString}' type's ${superTypesString} super-types.`);
|
|
111
114
|
}
|
|
112
115
|
}
|
|
113
116
|
|
|
@@ -117,24 +120,18 @@ export default domAssigned(class TypeDeclaration {
|
|
|
117
120
|
verifySuperType(superType) {
|
|
118
121
|
let superTypeVerified;
|
|
119
122
|
|
|
120
|
-
const
|
|
121
|
-
|
|
122
|
-
if (superTypeObjectType) {
|
|
123
|
-
superTypeVerified = true;
|
|
124
|
-
} else {
|
|
125
|
-
const typeName = this.type.getString(),
|
|
126
|
-
superTypeString = superTypeStringFromSuperType(superType);
|
|
123
|
+
const typeString = this.type.getString(),
|
|
124
|
+
superTypeString = superType.getString();
|
|
127
125
|
|
|
128
|
-
|
|
126
|
+
this.fileContext.trace(`Verifying the '${typeString}' type's '${superTypeString}' super-type...`);
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
128
|
+
const superTypeName = superType.getName(),
|
|
129
|
+
superTypePresent = this.fileContext.isTypePresentByTypeName(superTypeName);
|
|
132
130
|
|
|
133
|
-
|
|
131
|
+
superTypeVerified = superTypePresent; ///
|
|
134
132
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
}
|
|
133
|
+
if (superTypeVerified) {
|
|
134
|
+
this.fileContext.debug(`...verified the '${typeString}' type's '${superTypeString}' super-type.`);
|
|
138
135
|
}
|
|
139
136
|
|
|
140
137
|
return superTypeVerified;
|
|
@@ -152,25 +149,3 @@ export default domAssigned(class TypeDeclaration {
|
|
|
152
149
|
return typeDeclaration;
|
|
153
150
|
}
|
|
154
151
|
});
|
|
155
|
-
|
|
156
|
-
export function superTypeStringFromSuperType(superType) {
|
|
157
|
-
const superTypeName = superType.getName(),
|
|
158
|
-
superTypeString = superTypeName; ///
|
|
159
|
-
|
|
160
|
-
return superTypeString;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export function superTypesStringFromSuperTypes(superTypes) {
|
|
164
|
-
const superTypesString = superTypes.reduce((superTypesString, superType) => {
|
|
165
|
-
const superTypeString = superTypeStringFromSuperType(superType);
|
|
166
|
-
|
|
167
|
-
superTypesString = (superTypesString === null) ?
|
|
168
|
-
`'${superTypeString}'` :
|
|
169
|
-
`${superTypesString}, '${superTypeString}'`;
|
|
170
|
-
|
|
171
|
-
return superTypesString;
|
|
172
|
-
}, null);
|
|
173
|
-
|
|
174
|
-
return superTypesString;
|
|
175
|
-
}
|
|
176
|
-
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import dom from "../../dom";
|
|
4
4
|
|
|
5
|
-
import { objectType } from "../type";
|
|
6
5
|
import { domAssigned } from "../../dom";
|
|
7
6
|
|
|
8
7
|
export default domAssigned(class VariableDeclaration {
|
|
@@ -41,13 +40,9 @@ export default domAssigned(class VariableDeclaration {
|
|
|
41
40
|
|
|
42
41
|
type = this.variable.getType();
|
|
43
42
|
|
|
44
|
-
const
|
|
43
|
+
const typeName = type.getName();
|
|
45
44
|
|
|
46
|
-
|
|
47
|
-
const typeName = type.getName();
|
|
48
|
-
|
|
49
|
-
type = this.fileContext.findTypeByTypeName(typeName);
|
|
50
|
-
}
|
|
45
|
+
type = this.fileContext.findTypeByTypeName(typeName);
|
|
51
46
|
|
|
52
47
|
const typeProvisional = type.isProvisional(),
|
|
53
48
|
variableProvisional = this.variable.isProvisional();
|
|
@@ -64,8 +59,6 @@ export default domAssigned(class VariableDeclaration {
|
|
|
64
59
|
this.fileContext.debug(`The '${typeString}' type is not provisional whilst the '${variableString}' variable's type is.`);
|
|
65
60
|
}
|
|
66
61
|
} else {
|
|
67
|
-
this.variable.setType(type);
|
|
68
|
-
|
|
69
62
|
this.fileContext.addVariable(this.variable);
|
|
70
63
|
|
|
71
64
|
verified = true;
|
|
@@ -83,26 +76,41 @@ export default domAssigned(class VariableDeclaration {
|
|
|
83
76
|
verifyVariableType() {
|
|
84
77
|
let typeVerified = false;
|
|
85
78
|
|
|
86
|
-
|
|
79
|
+
let type;
|
|
87
80
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
type = this.variable.getType();
|
|
82
|
+
|
|
83
|
+
const typeName = type.getName(),
|
|
84
|
+
typeString = type.getString(),
|
|
85
|
+
variableString = this.variable.getString();
|
|
86
|
+
|
|
87
|
+
this.fileContext.trace(`Verifying the '${variableString}' variable's '${typeString}' type...`);
|
|
92
88
|
|
|
93
|
-
|
|
89
|
+
const includeSupertypes = false,
|
|
90
|
+
provisional = type.isProvisional(includeSupertypes);
|
|
94
91
|
|
|
95
|
-
|
|
92
|
+
type = this.fileContext.findTypeByTypeName(typeName);
|
|
96
93
|
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
const typePresent = (type !== null)
|
|
95
|
+
|
|
96
|
+
if (!typePresent) {
|
|
97
|
+
this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is not present.`);
|
|
98
|
+
} else {
|
|
99
|
+
const provisionalMatches = type.matchProvisional(provisional);
|
|
100
|
+
|
|
101
|
+
if (!provisionalMatches) {
|
|
102
|
+
provisional ?
|
|
103
|
+
this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is present but it should be provisional.`) :
|
|
104
|
+
this.fileContext.debug(`The '${variableString}' variable's '${typeString}' type is present but it should not be provisional.`);
|
|
99
105
|
} else {
|
|
106
|
+
this.variable.setType(type);
|
|
107
|
+
|
|
100
108
|
typeVerified = true;
|
|
101
109
|
}
|
|
110
|
+
}
|
|
102
111
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}
|
|
112
|
+
if (typeVerified) {
|
|
113
|
+
this.fileContext.debug(`...verified the '${variableString}' variable's '${typeString}' type.`);
|
|
106
114
|
}
|
|
107
115
|
|
|
108
116
|
return typeVerified;
|
package/src/dom/property.js
CHANGED
|
@@ -117,9 +117,9 @@ function stringFromNamesAndType(names, type) {
|
|
|
117
117
|
if (type === objectType) {
|
|
118
118
|
string = namesString; ///
|
|
119
119
|
} else {
|
|
120
|
-
const
|
|
120
|
+
const typeString = type.getString();
|
|
121
121
|
|
|
122
|
-
string = `${namesString}:${
|
|
122
|
+
string = `${namesString}:${typeString}`;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
return string;
|
|
@@ -109,9 +109,9 @@ export default domAssigned(class PropertyRelation {
|
|
|
109
109
|
|
|
110
110
|
if (variableTypeProperty === null) {
|
|
111
111
|
const variableString = this.term.getString(),
|
|
112
|
-
|
|
112
|
+
variableTypeString = variableType.getString();
|
|
113
113
|
|
|
114
|
-
context.debug(`The '${propertyNames}' property is not a property of the '${variableString}' variable's '${
|
|
114
|
+
context.debug(`The '${propertyNames}' property is not a property of the '${variableString}' variable's '${variableTypeString}' type.`);
|
|
115
115
|
} else {
|
|
116
116
|
const type = variableType;
|
|
117
117
|
|
package/src/dom/term.js
CHANGED
|
@@ -152,10 +152,10 @@ export default domAssigned(class Term {
|
|
|
152
152
|
verifyGivenType(type, generalContext, specificContext) {
|
|
153
153
|
let verifiedGivenType;
|
|
154
154
|
|
|
155
|
-
const
|
|
155
|
+
const typeString = type.getString(),
|
|
156
156
|
termString = this.getString(); ///
|
|
157
157
|
|
|
158
|
-
specificContext.trace(`Verifying the '${termString}' term given the '${
|
|
158
|
+
specificContext.trace(`Verifying the '${termString}' term given the '${typeString}' type...`);
|
|
159
159
|
|
|
160
160
|
const context = specificContext, ///
|
|
161
161
|
verified = this.verify(context, () => {
|
|
@@ -173,7 +173,7 @@ export default domAssigned(class Term {
|
|
|
173
173
|
verifiedGivenType = verified; ///
|
|
174
174
|
|
|
175
175
|
if (verifiedGivenType) {
|
|
176
|
-
specificContext.debug(`...verified the '${termString}' term given the '${
|
|
176
|
+
specificContext.debug(`...verified the '${termString}' term given the '${typeString}' type.`);
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
return verifiedGivenType;
|