occam-verify-cli 0.0.702 → 0.0.705

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.
@@ -9,17 +9,14 @@ function verifyMetastatement(metastatementNode, derived, localMetaContext) {
9
9
 
10
10
  localMetaContext.trace(`Verifying the '${metastatementString}' metastatement...`, metastatementNode);
11
11
 
12
- const verifyMetastatementFunctions = [
13
- verifyStandaloneMetastatement
14
- ];
12
+ const nonTerminalNode = metastatementNode, ///
13
+ nonTerminalNodeVerified = metastatementNodeVerifier.verifyNonTerminalNode(nonTerminalNode, localMetaContext, () => {
14
+ const verifiedAhead = true;
15
15
 
16
- metastatementVerified = verifyMetastatementFunctions.some((verifyMetastatementFunction) => {
17
- const metastatementVerified = verifyMetastatementFunction(metastatementNode, derived, localMetaContext);
16
+ return verifiedAhead;
17
+ });
18
18
 
19
- if (metastatementVerified) {
20
- return true;
21
- }
22
- });
19
+ metastatementVerified = nonTerminalNodeVerified; ///
23
20
 
24
21
  if (metastatementVerified) {
25
22
  localMetaContext.debug(`...verified the '${metastatementString}' metastatement.`, metastatementNode);
@@ -33,27 +30,3 @@ Object.assign(metastatementNodeVerifier, {
33
30
  });
34
31
 
35
32
  export default verifyMetastatement;
36
-
37
- function verifyStandaloneMetastatement(metastatementNode, derived, localMetaContext) {
38
- let standaloneMetastatementVerified;
39
-
40
- const metastatementString = localMetaContext.nodeAsString(metastatementNode);
41
-
42
- localMetaContext.trace(`Verifying the '${metastatementString}' standalone metastatement...`, metastatementNode);
43
-
44
- const nonTerminalNode = metastatementNode, ///
45
- nonTerminalNodeVerified = metastatementNodeVerifier.verifyNonTerminalNode(nonTerminalNode, localMetaContext, () => {
46
- const verifiedAhead = true;
47
-
48
- return verifiedAhead;
49
- });
50
-
51
- standaloneMetastatementVerified = nonTerminalNodeVerified; ///
52
-
53
- if (standaloneMetastatementVerified) {
54
- localMetaContext.debug(`...verified the '${metastatementString}' standalone metastatement.`, metastatementNode);
55
- }
56
-
57
- return standaloneMetastatementVerified;
58
-
59
- }
@@ -38,6 +38,27 @@ function verifyStatement(statementNode, assignments, derived, context, verifyAhe
38
38
  return statementVerified;
39
39
  }
40
40
 
41
+ export function verifyStandaloneStatement(statementNode, fileContext, verifyAhead) {
42
+ let standaloneStatementVerified;
43
+
44
+ const statementString = fileContext.nodeAsString(statementNode);
45
+
46
+ fileContext.trace(`Verifying the '${statementString}' standalone statement...`, statementNode);
47
+
48
+ const context = fileContext, ///
49
+ derived = false,
50
+ assignments = [],
51
+ statementVerified = verifyStatement(statementNode, assignments, derived, context, verifyAhead);
52
+
53
+ standaloneStatementVerified = statementVerified; ///
54
+
55
+ if (standaloneStatementVerified) {
56
+ fileContext.debug(`...verified the '${statementString}' standalone statement.`, statementNode);
57
+ }
58
+
59
+ return standaloneStatementVerified;
60
+ }
61
+
41
62
  Object.assign(statementNodesVerifier, {
42
63
  verifyStatement
43
64
  });
@@ -33,6 +33,26 @@ function verifyTerm(termNode, terms, context, verifyAhead) {
33
33
  return termVerified;
34
34
  }
35
35
 
36
+ export function verifyStandaloneTerm(termNode, fileContext, verifyAhead) {
37
+ let standaloneTermVerified;
38
+
39
+ const termString = fileContext.nodeAsString(termNode);
40
+
41
+ fileContext.trace(`Verifying the '${termString}' standalone term...`, termNode);
42
+
43
+ const terms = [],
44
+ context = fileContext, ///
45
+ termVerified = verifyTerm(termNode, terms, context, verifyAhead);
46
+
47
+ standaloneTermVerified = termVerified; ///
48
+
49
+ if (standaloneTermVerified) {
50
+ fileContext.debug(`...verified the '${termString}' standalone term.`, termNode);
51
+ }
52
+
53
+ return standaloneTermVerified;
54
+ }
55
+
36
56
  Object.assign(termNodesVerifier, {
37
57
  verifyTerm
38
58
  });
@@ -46,3 +46,29 @@ export default function verifyType(typeNode, superTypeNode, fileContext) {
46
46
 
47
47
  return typeVerified;
48
48
  }
49
+
50
+ export function verifyStandaloneType(typeNode, fileContext, verifyAhead) {
51
+ let standaloneTypeVerified = false;
52
+
53
+ const typeString = fileContext.nodeAsString(typeNode);
54
+
55
+ fileContext.trace(`Verifying the '${typeString}' standalone type...`, typeNode);
56
+
57
+ const typeName = typeNameFromTypeNode(typeNode),
58
+ typePresent = fileContext.isTypePresentByTypeName(typeName);
59
+
60
+ if (!typePresent) {
61
+ fileContext.debug(`The type '${typeName}' is not present.`, typeNode);
62
+ } else {
63
+ const verifiedAhead = verifyAhead();
64
+
65
+ standaloneTypeVerified = verifiedAhead; ///
66
+
67
+ }
68
+
69
+ if (standaloneTypeVerified) {
70
+ fileContext.debug(`...verified the '${typeString}' standalone type.`, typeNode);
71
+ }
72
+
73
+ return standaloneTypeVerified;
74
+ }