occam-verify-cli 1.0.457 → 1.0.473
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/constants.js +13 -1
- package/lib/context/ephemeral.js +270 -0
- package/lib/context/file.js +102 -66
- package/lib/context/liminal.js +120 -0
- package/lib/context/literal.js +92 -0
- package/lib/context/nominal.js +15 -1
- package/lib/context/release.js +66 -7
- package/lib/context/scoped.js +48 -40
- package/lib/context/synthetic.js +133 -0
- package/lib/element/assertion/contained.js +66 -66
- package/lib/element/assertion/defined.js +32 -32
- package/lib/element/assertion/property.js +39 -39
- package/lib/element/assertion/satisfies.js +22 -22
- package/lib/element/assumption.js +5 -8
- package/lib/element/conclusion.js +14 -13
- package/lib/element/constructor.js +2 -2
- package/lib/element/deduction.js +14 -13
- package/lib/element/derivation.js +3 -3
- package/lib/element/equality.js +5 -5
- package/lib/element/equivalence.js +112 -107
- package/lib/element/equivalences.js +24 -10
- package/lib/element/error.js +3 -3
- package/lib/element/frame.js +38 -21
- package/lib/element/hypothesis.js +2 -2
- package/lib/element/judgement.js +6 -5
- package/lib/element/metaType.js +1 -2
- package/lib/element/metavariable.js +46 -35
- package/lib/element/parameter.js +13 -5
- package/lib/element/procedureCall.js +16 -16
- package/lib/element/proof.js +14 -13
- package/lib/element/proofAssertion/premise.js +41 -30
- package/lib/element/proofAssertion/step.js +39 -35
- package/lib/element/proofAssertion/supposition.js +43 -32
- package/lib/element/proofAssertion.js +19 -5
- package/lib/element/propertyRelation.js +2 -2
- package/lib/element/reference.js +50 -9
- package/lib/element/rule.js +26 -28
- package/lib/element/section.js +2 -2
- package/lib/element/signature.js +9 -6
- package/lib/element/statement.js +44 -31
- package/lib/element/subproof.js +18 -17
- package/lib/element/substitution/frame.js +83 -46
- package/lib/element/substitution/reference.js +101 -19
- package/lib/element/substitution/statement.js +122 -75
- package/lib/element/substitution/term.js +93 -57
- package/lib/element/substitution.js +20 -69
- package/lib/element/substitutions.js +49 -34
- package/lib/element/term.js +30 -21
- package/lib/element/topLevelAssertion/axiom.js +8 -6
- package/lib/element/topLevelAssertion/conjecture.js +4 -4
- package/lib/element/topLevelAssertion/lemma.js +4 -4
- package/lib/element/topLevelAssertion/theorem.js +2 -2
- package/lib/element/topLevelAssertion.js +30 -23
- package/lib/element/topLevelMetaAssertion/metaLemma.js +2 -2
- package/lib/element/topLevelMetaAssertion/metatheorem.js +2 -2
- package/lib/element/topLevelMetaAssertion.js +16 -12
- package/lib/element/variable.js +30 -22
- package/lib/index.js +3 -3
- package/lib/main.js +3 -3
- package/lib/node/frame.js +2 -2
- package/lib/node/metavariable.js +4 -4
- package/lib/node/parameter.js +28 -7
- package/lib/node/substitution/frame.js +9 -31
- package/lib/node/substitution/reference.js +137 -0
- package/lib/node/substitution/statement.js +9 -31
- package/lib/node/substitution/term.js +9 -23
- package/lib/nonTerminalNodeMap.js +3 -2
- package/lib/process/instantiate.js +2 -14
- package/lib/process/unify.js +5 -5
- package/lib/tokenTypes.js +22 -0
- package/lib/utilities/context.js +54 -19
- package/lib/utilities/element.js +161 -336
- package/lib/utilities/instance.js +4 -4
- package/lib/utilities/string.js +18 -4
- package/lib/utilities/unification.js +24 -18
- package/lib/utilities/validation.js +31 -31
- package/package.json +2 -2
- package/src/constants.js +12 -0
- package/src/context/{transient.js → ephemeral.js} +15 -112
- package/src/context/file.js +66 -67
- package/src/context/liminal.js +67 -0
- package/src/context/{fragment.js → literal.js} +17 -4
- package/src/context/nominal.js +12 -0
- package/src/context/release.js +44 -6
- package/src/context/scoped.js +41 -31
- package/src/context/synthetic.js +60 -0
- package/src/element/assertion/contained.js +49 -47
- package/src/element/assertion/defined.js +29 -27
- package/src/element/assertion/property.js +35 -35
- package/src/element/assertion/satisfies.js +19 -18
- package/src/element/assumption.js +4 -10
- package/src/element/conclusion.js +16 -19
- package/src/element/constructor.js +1 -1
- package/src/element/deduction.js +16 -21
- package/src/element/derivation.js +2 -2
- package/src/element/equality.js +4 -4
- package/src/element/equivalence.js +115 -135
- package/src/element/equivalences.js +9 -7
- package/src/element/error.js +4 -2
- package/src/element/frame.js +50 -23
- package/src/element/hypothesis.js +1 -1
- package/src/element/judgement.js +9 -4
- package/src/element/metaType.js +0 -1
- package/src/element/metavariable.js +54 -53
- package/src/element/parameter.js +10 -5
- package/src/element/procedureCall.js +20 -18
- package/src/element/proof.js +14 -16
- package/src/element/proofAssertion/premise.js +46 -42
- package/src/element/proofAssertion/step.js +45 -40
- package/src/element/proofAssertion/supposition.js +56 -45
- package/src/element/proofAssertion.js +23 -5
- package/src/element/propertyRelation.js +1 -1
- package/src/element/reference.js +64 -16
- package/src/element/rule.js +31 -37
- package/src/element/section.js +1 -1
- package/src/element/signature.js +8 -8
- package/src/element/statement.js +51 -40
- package/src/element/subproof.js +16 -18
- package/src/element/substitution/frame.js +99 -42
- package/src/element/substitution/reference.js +120 -20
- package/src/element/substitution/statement.js +160 -89
- package/src/element/substitution/term.js +104 -63
- package/src/element/substitution.js +16 -58
- package/src/element/substitutions.js +43 -41
- package/src/element/term.js +37 -32
- package/src/element/topLevelAssertion/axiom.js +8 -6
- package/src/element/topLevelAssertion/conjecture.js +1 -2
- package/src/element/topLevelAssertion/lemma.js +2 -3
- package/src/element/topLevelAssertion/theorem.js +1 -1
- package/src/element/topLevelAssertion.js +31 -27
- package/src/element/topLevelMetaAssertion/metaLemma.js +1 -2
- package/src/element/topLevelMetaAssertion/metatheorem.js +1 -2
- package/src/element/topLevelMetaAssertion.js +15 -13
- package/src/element/variable.js +30 -31
- package/src/index.js +2 -1
- package/src/main.js +2 -1
- package/src/node/frame.js +1 -1
- package/src/node/metavariable.js +3 -3
- package/src/node/parameter.js +32 -5
- package/src/node/substitution/frame.js +6 -32
- package/src/node/substitution/reference.js +38 -0
- package/src/node/substitution/statement.js +6 -32
- package/src/node/substitution/term.js +6 -22
- package/src/nonTerminalNodeMap.js +3 -0
- package/src/process/instantiate.js +0 -8
- package/src/process/unify.js +4 -4
- package/src/tokenTypes.js +4 -0
- package/src/utilities/context.js +43 -17
- package/src/utilities/element.js +187 -401
- package/src/utilities/instance.js +3 -3
- package/src/utilities/string.js +21 -5
- package/src/utilities/unification.js +26 -23
- package/src/utilities/validation.js +47 -47
- package/lib/context/fragment.js +0 -77
- package/lib/context/transient.js +0 -371
- package/lib/log.js +0 -150
- package/lib/utilities/fragment.js +0 -23
- package/lib/utilities/node.js +0 -71
- package/src/log.js +0 -118
- package/src/utilities/fragment.js +0 -11
- package/src/utilities/node.js +0 -85
|
@@ -3,79 +3,134 @@
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
|
-
import {
|
|
6
|
+
import { literally } from "../../utilities/context";
|
|
7
7
|
import { instantiateFrameSubstitution } from "../../process/instantiate";
|
|
8
8
|
import { frameSubstitutionStringFromFrameAndMetavariable } from "../../utilities/string";
|
|
9
|
-
import {
|
|
9
|
+
import { frameSubstitutionFromStatementNode, frameSubstitutionFromFrameSubstitutionNode } from "../../utilities/element";
|
|
10
10
|
|
|
11
11
|
export default define(class FrameSubstitution extends Substitution {
|
|
12
|
-
constructor(context, string, node,
|
|
12
|
+
constructor(context, string, node, targetFrame, replacementFrame) {
|
|
13
13
|
super(context, string, node);
|
|
14
14
|
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
15
|
+
this.targetFrame = targetFrame;
|
|
16
|
+
this.replacementFrame = replacementFrame;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
return this.
|
|
19
|
+
getTargetFrame() {
|
|
20
|
+
return this.targetFrame;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
return this.
|
|
23
|
+
getReplacementFrame() {
|
|
24
|
+
return this.replacementFrame;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getTargetNode() {
|
|
28
|
+
const targetFrameNode = this.targetFrame.getNode(),
|
|
29
|
+
tergetNode = targetFrameNode; ///
|
|
30
|
+
|
|
31
|
+
return tergetNode;
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
getReplacementNode() {
|
|
28
|
-
const
|
|
29
|
-
replacementNode =
|
|
35
|
+
const replacementFrameNode = this.replacementFrame.getNode(),
|
|
36
|
+
replacementNode = replacementFrameNode; ///
|
|
30
37
|
|
|
31
38
|
return replacementNode;
|
|
32
39
|
}
|
|
33
40
|
|
|
34
|
-
|
|
41
|
+
isTrivial() {
|
|
42
|
+
const targetFrameEqualToReplacementFrame = this.targetFrame.isEqualTo(this.replacementFrame),
|
|
43
|
+
trivial = targetFrameEqualToReplacementFrame; ///
|
|
44
|
+
|
|
45
|
+
return trivial;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
compareFrame(frame, context) {
|
|
49
|
+
const frameEqualToReplacementFrame = this.replacementFrame.isEqualTo(frame),
|
|
50
|
+
comparedToFrame = frameEqualToReplacementFrame; ///
|
|
51
|
+
|
|
52
|
+
return comparedToFrame;
|
|
53
|
+
}
|
|
35
54
|
|
|
36
|
-
|
|
55
|
+
compareParameter(parameter) {
|
|
56
|
+
const targetFrameComparesToParameter = this.targetFrame.compareParameter(parameter),
|
|
57
|
+
comparesToParameter = targetFrameComparesToParameter; ///
|
|
37
58
|
|
|
38
|
-
|
|
39
|
-
|
|
59
|
+
return comparesToParameter;
|
|
60
|
+
}
|
|
40
61
|
|
|
41
|
-
|
|
62
|
+
validate(context) {
|
|
63
|
+
let validates = false;
|
|
42
64
|
|
|
43
|
-
|
|
65
|
+
const frameSubstitutionString = this.getString(); ///
|
|
44
66
|
|
|
45
|
-
|
|
67
|
+
context.trace(`Validating the '${frameSubstitutionString}' frame substitution...`);
|
|
46
68
|
|
|
47
|
-
|
|
48
|
-
if (this.metavariable !== null) {
|
|
49
|
-
const metavariablePresent = context.isMetavariablePresent(this.metavariable);
|
|
69
|
+
const targetFrameValidates = this.validateTargetFrame(context);
|
|
50
70
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
frameMetavariablePresent = context.isMetavariablePresent(frameMetavariable);
|
|
71
|
+
if (targetFrameValidates) {
|
|
72
|
+
const replacementFrameValidates = this.validateReplacementFrame(context);
|
|
54
73
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else {
|
|
58
|
-
context.debug(`The '${frameSubstitutionString}' frame substitution's general frame's metavariable is not present.`);
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
context.debug(`The '${frameSubstitutionString}' frame substitution's specific frame's metavariable is not present.`);
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
context.debug(`The '${frameSubstitutionString}' frame substitution's general frame is not singular.`);
|
|
74
|
+
if (replacementFrameValidates) {
|
|
75
|
+
validates = true;
|
|
65
76
|
}
|
|
66
|
-
} else {
|
|
67
|
-
context.debug(`The '${frameSubstitutionString}' frame substitution's specific frame is not singular.`);
|
|
68
77
|
}
|
|
69
78
|
|
|
70
|
-
if (
|
|
79
|
+
if (validates) {
|
|
71
80
|
const substititoin = this; ///
|
|
72
81
|
|
|
73
82
|
context.addSubstitution(substititoin);
|
|
74
83
|
|
|
75
|
-
context.debug(`...
|
|
84
|
+
context.debug(`...validated the '${frameSubstitutionString}' frame substitution.`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return validates;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
validateTargetFrame(context) {
|
|
91
|
+
let targetFrameValidates = false;
|
|
92
|
+
|
|
93
|
+
const targetFrameString = this.targetFrame.getString(),
|
|
94
|
+
frameSubstitutionString = this.getString(); ///
|
|
95
|
+
|
|
96
|
+
context.trace(`Validating the '${frameSubstitutionString}' frame subtitution's '${targetFrameString}' target frame...`);
|
|
97
|
+
|
|
98
|
+
const targetFrameSingular = this.targetFrame.isSingular();
|
|
99
|
+
|
|
100
|
+
if (targetFrameSingular) {
|
|
101
|
+
const stated = true,
|
|
102
|
+
assignments = null;
|
|
103
|
+
|
|
104
|
+
targetFrameValidates = this.targetFrame.validate(assignments, stated, context);
|
|
105
|
+
} else {
|
|
106
|
+
context.debug(`The '${frameSubstitutionString}' frame subtitution's '${targetFrameString}' target frame is not singular.`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (targetFrameValidates) {
|
|
110
|
+
context.debug(`...validated the '${frameSubstitutionString}' frame subtitution's '${targetFrameString}' target frame...`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
return targetFrameValidates;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
validateReplacementFrame(context) {
|
|
117
|
+
let replacementFrameValidates;
|
|
118
|
+
|
|
119
|
+
const replacementFrameString = this.replacementFrame.getString(),
|
|
120
|
+
frameSubstitutionString = this.getString(); ///
|
|
121
|
+
|
|
122
|
+
context.trace(`Validating the '${frameSubstitutionString}' frame subtitution's '${replacementFrameString}' replacement frame...`);
|
|
123
|
+
|
|
124
|
+
const stated = true,
|
|
125
|
+
assignments = null;
|
|
126
|
+
|
|
127
|
+
replacementFrameValidates = this.replacementFrame.validate(assignments, stated, context);
|
|
128
|
+
|
|
129
|
+
if (replacementFrameValidates) {
|
|
130
|
+
context.debug(`...validated the '${frameSubstitutionString}' frame subtitution's '${replacementFrameString}' replacement frame...`);
|
|
76
131
|
}
|
|
77
132
|
|
|
78
|
-
return
|
|
133
|
+
return replacementFrameValidates;
|
|
79
134
|
}
|
|
80
135
|
|
|
81
136
|
static name = "FrameSubstitution";
|
|
@@ -88,12 +143,14 @@ export default define(class FrameSubstitution extends Substitution {
|
|
|
88
143
|
}
|
|
89
144
|
|
|
90
145
|
static fromFrameAndMetavariable(frame, metavariable, context) {
|
|
91
|
-
return
|
|
92
|
-
const
|
|
93
|
-
string =
|
|
146
|
+
return literally((context) => {
|
|
147
|
+
const frameSubstitutionString = frameSubstitutionStringFromFrameAndMetavariable(frame, metavariable),
|
|
148
|
+
string = frameSubstitutionString, ///
|
|
94
149
|
frameSubstitutionNode = instantiateFrameSubstitution(string, context),
|
|
95
150
|
frameSubstitution = frameSubstitutionFromFrameSubstitutionNode(frameSubstitutionNode, context);
|
|
96
151
|
|
|
152
|
+
frameSubstitution.validate(context);
|
|
153
|
+
|
|
97
154
|
return frameSubstitution;
|
|
98
155
|
}, context);
|
|
99
156
|
}
|
|
@@ -3,42 +3,142 @@
|
|
|
3
3
|
import Substitution from "../substitution";
|
|
4
4
|
|
|
5
5
|
import { define } from "../../elements";
|
|
6
|
+
import { literally } from "../../utilities/context";
|
|
6
7
|
import { instantiateReferenceSubstitution } from "../../process/instantiate";
|
|
7
8
|
import { referenceSubstitutionFromReferenceSubstitutionNode } from "../../utilities/element";
|
|
9
|
+
import { referenceSubstitutionStringFromReferenceAndMetavariable } from "../../utilities/string";
|
|
8
10
|
|
|
9
11
|
export default define(class ReferenceSubstitution extends Substitution {
|
|
10
|
-
constructor(context, string, node,
|
|
12
|
+
constructor(context, string, node, targetReference, replacementReference) {
|
|
11
13
|
super(context, string, node);
|
|
12
14
|
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
+
this.targetReference = targetReference;
|
|
16
|
+
this.replacementReference = replacementReference;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
return this.
|
|
19
|
+
getTargetReference() {
|
|
20
|
+
return this.targetReference;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
return this.
|
|
23
|
+
getReplacementReference() {
|
|
24
|
+
return this.replacementReference;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
|
|
27
|
+
getTargetNode() {
|
|
28
|
+
const targetReferenceNode = this.targetReference.getNode(),
|
|
29
|
+
tergetNode = targetReferenceNode; ///
|
|
30
|
+
|
|
31
|
+
return tergetNode;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
getReplacementNode() {
|
|
35
|
+
const replacementReferenceNode = this.replacementReference.getNode(),
|
|
36
|
+
replacementNode = replacementReferenceNode; ///
|
|
37
|
+
|
|
38
|
+
return replacementNode;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
isTrivial() {
|
|
42
|
+
const targetReferenceEqualToReplacementReference = this.targetReference.isEqualTo(this.replacementReference),
|
|
43
|
+
trivial = targetReferenceEqualToReplacementReference; ///
|
|
44
|
+
|
|
45
|
+
return trivial;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
compareReference(reference, context) {
|
|
49
|
+
const referenceEqualToReplacementReference = this.replacementReference.isEqualTo(reference),
|
|
50
|
+
comparedToReference = referenceEqualToReplacementReference; ///
|
|
51
|
+
|
|
52
|
+
return comparedToReference;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
compareParameter(parameter) {
|
|
56
|
+
const targetReferenceComparesToParameter = this.targetReference.compareParameter(parameter),
|
|
57
|
+
comparesToParameter = targetReferenceComparesToParameter; ///
|
|
58
|
+
|
|
59
|
+
return comparesToParameter;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
validate(context) {
|
|
63
|
+
let validates = false;
|
|
64
|
+
|
|
65
|
+
const referenceSubstitutionString = this.getString(); ///
|
|
66
|
+
|
|
67
|
+
context.trace(`Validating the '${referenceSubstitutionString}' reference substitution...`);
|
|
68
|
+
|
|
69
|
+
const targetReferenceValidates = this.validateTargetReference(context);
|
|
70
|
+
|
|
71
|
+
if (targetReferenceValidates) {
|
|
72
|
+
const replacementReferenceValidates = this.validateReplacementReference(context);
|
|
73
|
+
|
|
74
|
+
if (replacementReferenceValidates) {
|
|
75
|
+
validates = true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (validates) {
|
|
80
|
+
const substititoin = this; ///
|
|
81
|
+
|
|
82
|
+
context.addSubstitution(substititoin);
|
|
83
|
+
|
|
84
|
+
context.debug(`...validated the '${referenceSubstitutionString}' reference substitution.`);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return validates;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
validateTargetReference(context) {
|
|
91
|
+
let targetReferenceValidates = false;
|
|
92
|
+
|
|
93
|
+
const targetReferenceString = this.targetReference.getString(),
|
|
94
|
+
referenceSubstitutionString = this.getString(); ///
|
|
95
|
+
|
|
96
|
+
context.trace(`Validating the '${referenceSubstitutionString}' reference subtitution's '${targetReferenceString}' target reference...`);
|
|
97
|
+
|
|
98
|
+
const targetReferenceSingular = this.targetReference.isSingular();
|
|
99
|
+
|
|
100
|
+
if (targetReferenceSingular) {
|
|
101
|
+
targetReferenceValidates = this.targetReference.validate(context);
|
|
102
|
+
} else {
|
|
103
|
+
context.debug(`The '${referenceSubstitutionString}' reference subtitution's '${targetReferenceString}' target reference is not singular.`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (targetReferenceValidates) {
|
|
107
|
+
context.debug(`...validated the '${referenceSubstitutionString}' reference subtitution's '${targetReferenceString}' target reference...`);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return targetReferenceValidates;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
validateReplacementReference(context) {
|
|
114
|
+
let replacementReferenceValidates;
|
|
115
|
+
|
|
116
|
+
const replacementReferenceString = this.replacementReference.getString(),
|
|
117
|
+
referenceSubstitutionString = this.getString(); ///
|
|
118
|
+
|
|
119
|
+
context.trace(`Validating the '${referenceSubstitutionString}' reference subtitution's '${replacementReferenceString}' replacement reference...`);
|
|
120
|
+
|
|
121
|
+
replacementReferenceValidates = this.replacementReference.validate(context);
|
|
122
|
+
|
|
123
|
+
if (replacementReferenceValidates) {
|
|
124
|
+
context.debug(`...validated the '${referenceSubstitutionString}' reference subtitution's '${replacementReferenceString}' replacement reference...`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return replacementReferenceValidates;
|
|
128
|
+
}
|
|
26
129
|
|
|
27
130
|
static name = "ReferenceSubstitution";
|
|
28
131
|
|
|
29
132
|
static fromReferenceAndMetavariable(reference, metavariable, context) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
133
|
+
return literally((context) => {
|
|
134
|
+
const referenceSubstitutionString = referenceSubstitutionStringFromReferenceAndMetavariable(reference, metavariable),
|
|
135
|
+
string = referenceSubstitutionString, ///
|
|
136
|
+
referenceSubstitutionNode = instantiateReferenceSubstitution(string, context),
|
|
137
|
+
referenceSubstitution = referenceSubstitutionFromReferenceSubstitutionNode(referenceSubstitutionNode, context);
|
|
138
|
+
|
|
139
|
+
referenceSubstitution.validate(context);
|
|
33
140
|
|
|
34
|
-
|
|
141
|
+
return referenceSubstitution;
|
|
142
|
+
}, context);
|
|
35
143
|
}
|
|
36
144
|
});
|
|
37
|
-
|
|
38
|
-
function stringFromReferenceAndMetavariable(reference, metavariable) {
|
|
39
|
-
const referenceString = reference.getString(),
|
|
40
|
-
metavariableString = metavariable.getString(),
|
|
41
|
-
string = `[${referenceString} for ${metavariableString}]`;
|
|
42
|
-
|
|
43
|
-
return string;
|
|
44
|
-
}
|