occam-verify-cli 0.0.540 → 0.0.542
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/bin/action/verify.js +4 -8
- package/bin/utilities/releaseContext.js +32 -42
- package/lib/context/file.js +72 -73
- package/lib/context/release.js +22 -16
- package/lib/index.js +1 -9
- package/lib/metaType.js +9 -7
- package/lib/metavariable.js +31 -6
- package/lib/type.js +8 -8
- package/lib/utilities/node.js +16 -2
- package/lib/utilities/releaseContext.js +8 -7
- package/lib/variable.js +31 -6
- package/lib/verify/file.js +2 -2
- package/package.json +1 -1
- package/src/context/file.js +13 -14
- package/src/context/release.js +26 -15
- package/src/index.js +0 -2
- package/src/metaType.js +8 -5
- package/src/metavariable.js +35 -3
- package/src/type.js +8 -8
- package/src/utilities/node.js +25 -0
- package/src/utilities/releaseContext.js +6 -4
- package/src/variable.js +34 -2
- package/src/verify/file.js +1 -1
package/src/variable.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
import Type from "./type";
|
|
4
|
+
|
|
5
|
+
import { VARIABLE_KIND } from "./kinds";
|
|
6
|
+
|
|
3
7
|
export default class Variable {
|
|
4
8
|
constructor(name, type) {
|
|
5
9
|
this.name = name;
|
|
@@ -27,8 +31,18 @@ export default class Variable {
|
|
|
27
31
|
return string;
|
|
28
32
|
}
|
|
29
33
|
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
toJSON(tokens) {
|
|
35
|
+
const typeJSON = this.type.toJSON(tokens),
|
|
36
|
+
kind = VARIABLE_KIND,
|
|
37
|
+
name = this.name, ///
|
|
38
|
+
type = typeJSON, ///
|
|
39
|
+
json = {
|
|
40
|
+
kind,
|
|
41
|
+
name,
|
|
42
|
+
type
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
return json;
|
|
32
46
|
}
|
|
33
47
|
|
|
34
48
|
static fromNameAndType(name, type) {
|
|
@@ -36,4 +50,22 @@ export default class Variable {
|
|
|
36
50
|
|
|
37
51
|
return variable;
|
|
38
52
|
}
|
|
53
|
+
|
|
54
|
+
static fromJSONAndFileContext(json, fileContext) {
|
|
55
|
+
const { name } = json;
|
|
56
|
+
|
|
57
|
+
let { type } = json;
|
|
58
|
+
|
|
59
|
+
json = type; ///
|
|
60
|
+
|
|
61
|
+
type = Type.fromJSONAndFileContext(json, fileContext);
|
|
62
|
+
|
|
63
|
+
const typeName = type.getName();
|
|
64
|
+
|
|
65
|
+
type = fileContext.findTypeByTypeName(typeName); ///
|
|
66
|
+
|
|
67
|
+
const variable = new Variable(name, type);
|
|
68
|
+
|
|
69
|
+
return variable;
|
|
70
|
+
}
|
|
39
71
|
}
|
package/src/verify/file.js
CHANGED
|
@@ -13,7 +13,7 @@ export default function verifyFile(filePath, releaseContext) {
|
|
|
13
13
|
|
|
14
14
|
releaseContext.debug(`Verifying the '${filePath}' file...`);
|
|
15
15
|
|
|
16
|
-
const fileContext = FileContext.
|
|
16
|
+
const fileContext = FileContext.fromFilePathAndReleaseContext(filePath, releaseContext),
|
|
17
17
|
node = fileContext.getNode();
|
|
18
18
|
|
|
19
19
|
if (node === null) {
|