occam-furtle 3.0.237 → 3.0.239
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/element/assignment/array.js +10 -9
- package/lib/element/assignment/object.js +11 -10
- package/lib/element/every.js +4 -4
- package/lib/element/nodeQuery.js +7 -7
- package/lib/element/nodesQuery.js +7 -7
- package/lib/element/primitive.js +21 -45
- package/lib/element/procedure.js +4 -3
- package/lib/element/reduce.js +4 -4
- package/lib/element/some.js +5 -5
- package/lib/node/primitive.js +20 -25
- package/lib/nodeProperties.js +3 -3
- package/lib/types.js +7 -7
- package/lib/utilities/nominal.js +35 -0
- package/lib/utilities/primitive.js +13 -18
- package/lib/utilities/string.js +17 -20
- package/lib/utilities/term.js +17 -22
- package/lib/utilities/terms.js +8 -10
- package/package.json +2 -2
- package/src/element/assignment/array.js +15 -14
- package/src/element/assignment/object.js +14 -10
- package/src/element/every.js +3 -3
- package/src/element/nodeQuery.js +10 -8
- package/src/element/nodesQuery.js +8 -7
- package/src/element/primitive.js +30 -54
- package/src/element/procedure.js +5 -3
- package/src/element/reduce.js +3 -3
- package/src/element/some.js +7 -7
- package/src/node/primitive.js +28 -29
- package/src/nodeProperties.js +2 -2
- package/src/types.js +2 -2
- package/src/utilities/nominal.js +27 -0
- package/src/utilities/primitive.js +23 -28
- package/src/utilities/string.js +21 -18
- package/src/utilities/term.js +27 -32
- package/src/utilities/terms.js +9 -11
- package/lib/nullNode.js +0 -20
- package/src/nullNode.js +0 -13
package/lib/utilities/term.js
CHANGED
|
@@ -15,11 +15,11 @@ _export(exports, {
|
|
|
15
15
|
get termFromBoolean () {
|
|
16
16
|
return termFromBoolean;
|
|
17
17
|
},
|
|
18
|
-
get
|
|
19
|
-
return
|
|
18
|
+
get termFromNominalValue () {
|
|
19
|
+
return termFromNominalValue;
|
|
20
20
|
},
|
|
21
|
-
get
|
|
22
|
-
return
|
|
21
|
+
get termFromNominalValues () {
|
|
22
|
+
return termFromNominalValues;
|
|
23
23
|
},
|
|
24
24
|
get termFromPrimitive () {
|
|
25
25
|
return termFromPrimitive;
|
|
@@ -35,17 +35,8 @@ function _interop_require_default(obj) {
|
|
|
35
35
|
default: obj
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
|
-
function
|
|
39
|
-
const { Term } = _elements.default,
|
|
40
|
-
node = null;
|
|
41
|
-
context = null;
|
|
42
|
-
const term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
43
|
-
return term;
|
|
44
|
-
}
|
|
45
|
-
function termFromNodes(nodes, context) {
|
|
46
|
-
const { Term } = _elements.default, variable = null, primitive = (0, _primitive.primitiveFromNodes)(nodes, context), string = primitive.getString(), node = null, breakPoint = null;
|
|
47
|
-
context = null;
|
|
48
|
-
const term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
38
|
+
function termFromPrimitive(primitive) {
|
|
39
|
+
const { Term } = _elements.default, context = null, string = primitive.getString(), node = null, breakPoint = null, variable = null, term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
49
40
|
return term;
|
|
50
41
|
}
|
|
51
42
|
function termFromBoolean(boolean, context) {
|
|
@@ -54,22 +45,26 @@ function termFromBoolean(boolean, context) {
|
|
|
54
45
|
const term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
55
46
|
return term;
|
|
56
47
|
}
|
|
48
|
+
function termFromNominalValue(nominalValue) {
|
|
49
|
+
const { Term } = _elements.default, variable = null, primitive = (0, _primitive.primitiveFromNominalValue)(nominalValue), string = primitive.getString(), breakPoint = null, node = null, context = null, term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
50
|
+
return term;
|
|
51
|
+
}
|
|
52
|
+
function termFromNominalValues(nominalValues) {
|
|
53
|
+
const { Term } = _elements.default, variable = null, primitive = (0, _primitive.primitiveFromNominalValues)(nominalValues), string = primitive.getString(), node = null, breakPoint = null, context = null, term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
54
|
+
return term;
|
|
55
|
+
}
|
|
57
56
|
function termFromStringLiteral(stringLiteral, context) {
|
|
58
57
|
const { Term } = _elements.default, variable = null, primitive = (0, _primitive.primitiveFromStringLiteral)(stringLiteral, context), string = primitive.getString(), node = null, breakPoint = null;
|
|
59
58
|
context = null;
|
|
60
59
|
const term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
61
60
|
return term;
|
|
62
61
|
}
|
|
63
|
-
function termFromPrimitive(primitive) {
|
|
64
|
-
const { Term } = _elements.default, context = null, string = primitive.getString(), node = null, breakPoint = null, variable = null, term = new Term(context, string, node, breakPoint, variable, primitive);
|
|
65
|
-
return term;
|
|
66
|
-
}
|
|
67
62
|
const _default = {
|
|
68
|
-
termFromNode,
|
|
69
|
-
termFromNodes,
|
|
70
63
|
termFromBoolean,
|
|
64
|
+
termFromNominalValue,
|
|
65
|
+
termFromNominalValues,
|
|
71
66
|
termFromStringLiteral,
|
|
72
67
|
termFromPrimitive
|
|
73
68
|
};
|
|
74
69
|
|
|
75
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
70
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvdGVybS5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJcInVzZSBzdHJpY3RcIjtcblxuaW1wb3J0IGVsZW1lbnRzIGZyb20gXCIuLi9lbGVtZW50c1wiO1xuXG5pbXBvcnQgeyBwcmltaXRpdmVGcm9tQm9vbGVhbiwgcHJpbWl0aXZlRnJvbU5vbWluYWxWYWx1ZSwgcHJpbWl0aXZlRnJvbU5vbWluYWxWYWx1ZXMsIHByaW1pdGl2ZUZyb21TdHJpbmdMaXRlcmFsIH0gZnJvbSBcIi4uL3V0aWxpdGllcy9wcmltaXRpdmVcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIHRlcm1Gcm9tUHJpbWl0aXZlKHByaW1pdGl2ZSkge1xuICBjb25zdCB7IFRlcm0gfSA9IGVsZW1lbnRzLFxuICAgICAgICBjb250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25CTSxXQUFXLE1BQ1hSLFlBQVllLElBQUFBLHFDQUEwQixFQUFDRCxnQkFDdkNWLFNBQVNKLFVBQVVLLFNBQVMsSUFDNUJDLE9BQU8sTUFDUEMsYUFBYSxNQUNiSixVQUFVLE1BQ1ZNLE9BQU8sSUFBSVIsS0FBS0UsU0FBU0MsUUFBUUUsTUFBTUMsWUFBWUMsVUFBVVI7SUFFbkUsT0FBT1M7QUFDVDtBQUVPLFNBQVNWLHNCQUFzQmlCLGFBQWEsRUFBRWIsT0FBTztJQUMxRCxNQUFNLEVBQUVGLElBQUksRUFBRSxHQUFHQyxpQkFBUSxFQUNuQk0sV0FBVyxNQUNYUixZQUFZaUIsSUFBQUEscUNBQTBCLEVBQUNELGVBQWViLFVBQ3REQyxTQUFTSixVQUFVSyxTQUFTLElBQzVCQyxPQUFPLE1BQ1BDLGFBQWE7SUFFbkJKLFVBQVU7SUFFVixNQUFNTSxPQUFPLElBQUlSLEtBQUtFLFNBQVNDLFFBQVFFLE1BQU1DLFlBQVlDLFVBQVVSO0lBRW5FLE9BQU9TO0FBQ1Q7TUFFQSxXQUFlO0lBQ2JkO0lBQ0FDO0lBQ0FDO0lBQ0FFO0lBQ0FEO0FBQ0YifQ==
|
package/lib/utilities/terms.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
Object.defineProperty(exports, "
|
|
5
|
+
Object.defineProperty(exports, "termsFromNominalValues", {
|
|
6
6
|
enumerable: true,
|
|
7
7
|
get: function() {
|
|
8
|
-
return
|
|
8
|
+
return termsFromNominalValues;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
11
|
const _elements = /*#__PURE__*/ _interop_require_default(require("../elements"));
|
|
@@ -16,18 +16,16 @@ function _interop_require_default(obj) {
|
|
|
16
16
|
default: obj
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
const { Terms } = _elements.default, termsArray =
|
|
21
|
-
context = null;
|
|
22
|
-
const terms = new Terms(context, string, node, breakPoint, array);
|
|
19
|
+
function termsFromNominalValues(nominalValues) {
|
|
20
|
+
const { Terms } = _elements.default, termsArray = termsArrayFromNominalValues(nominalValues), termsString = (0, _string.termsStringFromTermsArray)(termsArray), string = termsString, array = termsArray, node = null, breakPoint = null, context = null, terms = new Terms(context, string, node, breakPoint, array);
|
|
23
21
|
return terms;
|
|
24
22
|
}
|
|
25
|
-
function
|
|
26
|
-
const termsArray =
|
|
27
|
-
const term = (0, _term.
|
|
23
|
+
function termsArrayFromNominalValues(nominalValues) {
|
|
24
|
+
const termsArray = nominalValues.map((nominalValue)=>{
|
|
25
|
+
const term = (0, _term.termFromNominalValue)(nominalValue);
|
|
28
26
|
return term;
|
|
29
27
|
});
|
|
30
28
|
return termsArray;
|
|
31
29
|
}
|
|
32
30
|
|
|
33
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsaXRpZXMvdGVybXMuanMiXSwic291cmNlc0NvbnRlbnQiOlsiXCJ1c2Ugc3RyaWN0XCI7XG5cbmltcG9ydCBlbGVtZW50cyBmcm9tIFwiLi4vZWxlbWVudHNcIjtcblxuaW1wb3J0IHsgdGVybUZyb21Ob21pbmFsVmFsdWUgfSBmcm9tIFwiLi4vdXRpbGl0aWVzL3Rlcm1cIjtcbmltcG9ydCB7IHRlcm1zU3RyaW5nRnJvbVRlcm1zQXJyYXkgfSBmcm9tIFwiLi4vdXRpbGl0aWVzL3N0cmluZ1wiO1xuXG5leHBvcnQgZnVuY3Rpb24gdGVybXNGcm9tTm9taW5hbFZhbHVlcyhub21pbmFsVmFsdWVzKSB7XG4gIGNvbnN0IHsgVGVybXMgfSA9IGVsZW1lbnRzLFxuICAgICAgICB0ZXJtc0FycmF5ID0gdGVybXNBcnJheUZyb21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BwaW5ncyI6IkFBQUE7Ozs7K0JBT2dCQTs7O2VBQUFBOzs7aUVBTEs7c0JBRWdCO3dCQUNLOzs7Ozs7QUFFbkMsU0FBU0EsdUJBQXVCQyxhQUFhO0lBQ2xELE1BQU0sRUFBRUMsS0FBSyxFQUFFLEdBQUdDLGlCQUFRLEVBQ3BCQyxhQUFhQyw0QkFBNEJKLGdCQUN6Q0ssY0FBY0MsSUFBQUEsaUNBQXlCLEVBQUNILGFBQ3hDSSxTQUFTRixhQUNURyxRQUFRTCxZQUNSTSxPQUFPLE1BQ1BDLGFBQWEsTUFDYkMsVUFBVSxNQUNWQyxRQUFRLElBQUlYLE1BQU1VLFNBQVNKLFFBQVFFLE1BQU1DLFlBQVlGO0lBRTNELE9BQU9JO0FBQ1Q7QUFFQSxTQUFTUiw0QkFBNEJKLGFBQWE7SUFDaEQsTUFBTUcsYUFBYUgsY0FBY2EsR0FBRyxDQUFDLENBQUNDO1FBQ3BDLE1BQU1DLE9BQU9DLElBQUFBLDBCQUFvQixFQUFDRjtRQUVsQyxPQUFPQztJQUNUO0lBRUEsT0FBT1o7QUFDVCJ9
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "occam-furtle",
|
|
3
3
|
"author": "James Smith",
|
|
4
|
-
"version": "3.0.
|
|
4
|
+
"version": "3.0.239",
|
|
5
5
|
"license": "MIT, Anti-996",
|
|
6
6
|
"homepage": "https://github.com/djalbat/occam-furtle",
|
|
7
7
|
"description": "Occam's Furtle language.",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"juxtapose": "^4.0.138",
|
|
29
29
|
"lively-cli": "^3.0.3",
|
|
30
30
|
"occam-model": "^1.0.516",
|
|
31
|
-
"occam-nominal": "^1.0.
|
|
31
|
+
"occam-nominal": "^1.0.152",
|
|
32
32
|
"occam-query": "^4.1.168",
|
|
33
33
|
"occam-server": "^7.0.17",
|
|
34
34
|
"watchful-cli": "^1.7.91"
|
|
@@ -6,8 +6,9 @@ import elements from "../../elements";
|
|
|
6
6
|
import Exception from "../../exception";
|
|
7
7
|
|
|
8
8
|
import { define } from "../../elements";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { termFromNominalValue } from "../../utilities/term";
|
|
10
|
+
import { primtiveStringFromNominalValues } from "../../utilities/string";
|
|
11
|
+
import { NOMINAL_VALUE_TYPE, NOMINAL_VALUES_TYPE } from "../../types";
|
|
11
12
|
|
|
12
13
|
export default define(class ArrayAssigment extends Element {
|
|
13
14
|
constructor(context, string, node, breakPoint, variable, parameters) {
|
|
@@ -33,23 +34,23 @@ export default define(class ArrayAssigment extends Element {
|
|
|
33
34
|
const term = this.variable.evaluate(context),
|
|
34
35
|
termType = term.getType();
|
|
35
36
|
|
|
36
|
-
if (termType !==
|
|
37
|
+
if (termType !== NOMINAL_VALUES_TYPE) {
|
|
37
38
|
const termString = term.getString(),
|
|
38
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
39
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUES_TYPE}'.`,
|
|
39
40
|
exception = Exception.fromMessage(message);
|
|
40
41
|
|
|
41
42
|
throw exception;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
const primitiveValue = term.getPrimitiveValue(),
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
nominalValues = primitiveValue, ///
|
|
47
|
+
parametersLength = this.parameters.getLength(),
|
|
48
|
+
nominalValuesLength = nominalValues.length;
|
|
48
49
|
|
|
49
|
-
if (parametersLength >
|
|
50
|
+
if (parametersLength > nominalValuesLength) {
|
|
50
51
|
const parametersString = this.parameters.getString(),
|
|
51
|
-
|
|
52
|
-
message = `The length of the '${parametersString}' parameters is greater than the length of the '${
|
|
52
|
+
primitiveString = primtiveStringFromNominalValues(nominalValues),
|
|
53
|
+
message = `The length of the '${parametersString}' parameters is greater than the length of the '${primitiveString}' nodes.`,
|
|
53
54
|
exception = Exception.fromMessage(message);
|
|
54
55
|
|
|
55
56
|
throw exception;
|
|
@@ -57,8 +58,8 @@ export default define(class ArrayAssigment extends Element {
|
|
|
57
58
|
|
|
58
59
|
this.parameters.forEachParameter((parameter, index) => {
|
|
59
60
|
if (parameter !== null) {
|
|
60
|
-
const
|
|
61
|
-
term =
|
|
61
|
+
const nominalValue = nominalValues[index],
|
|
62
|
+
term = termFromNominalValue(nominalValue);
|
|
62
63
|
|
|
63
64
|
this.evaluateParameter(parameter, term, context);
|
|
64
65
|
}
|
|
@@ -75,8 +76,8 @@ export default define(class ArrayAssigment extends Element {
|
|
|
75
76
|
|
|
76
77
|
const parameterType = parameter.getType();
|
|
77
78
|
|
|
78
|
-
if (parameterType !==
|
|
79
|
-
const message = `The type of the '${parameterString}' parameter should be '${
|
|
79
|
+
if (parameterType !== NOMINAL_VALUE_TYPE) {
|
|
80
|
+
const message = `The type of the '${parameterString}' parameter should be '${NOMINAL_VALUE_TYPE}'.`,
|
|
80
81
|
exception = Exception.fromMessage(message);
|
|
81
82
|
|
|
82
83
|
throw exception;
|
|
@@ -8,8 +8,9 @@ import nodeProperties from "../../nodeProperties";
|
|
|
8
8
|
|
|
9
9
|
import { define } from "../../elements";
|
|
10
10
|
import { stringLiteralFromString } from "../../utilities/stringLiteral";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { termFromNodesAndNominalValue } from "../../utilities/nominal";
|
|
12
|
+
import { termFromBoolean, termFromStringLiteral } from "../../utilities/term";
|
|
13
|
+
import { STRING_TYPE, BOOLEAN_TYPE, NOMINAL_VALUE_TYPE, NOMINAL_VALUES_TYPE } from "../../types";
|
|
13
14
|
import { CONTENT_PARAMETER_NAME, TERMINAL_PARAMETER_NAME, CHILD_NODES_PARAMETER_NAME } from "../../parameterNames";
|
|
14
15
|
|
|
15
16
|
export default define(class ObjectAssigment extends Element {
|
|
@@ -36,9 +37,9 @@ export default define(class ObjectAssigment extends Element {
|
|
|
36
37
|
const term = this.variable.evaluate(context),
|
|
37
38
|
termType = term.getType();
|
|
38
39
|
|
|
39
|
-
if (termType !==
|
|
40
|
+
if (termType !== NOMINAL_VALUE_TYPE) {
|
|
40
41
|
const termString = term.getString(),
|
|
41
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
42
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUE_TYPE}'.`,
|
|
42
43
|
exception = Exception.fromMessage(message);
|
|
43
44
|
|
|
44
45
|
throw exception;
|
|
@@ -104,7 +105,8 @@ export default define(class ObjectAssigment extends Element {
|
|
|
104
105
|
}
|
|
105
106
|
|
|
106
107
|
const primitiveValue = term.getPrimitiveValue(),
|
|
107
|
-
|
|
108
|
+
nominalValue = primitiveValue, ///
|
|
109
|
+
node = nominalValue.getNode(),
|
|
108
110
|
nodeTerminalNode = node.isTerminalNode();
|
|
109
111
|
|
|
110
112
|
if (!nodeTerminalNode) {
|
|
@@ -144,7 +146,8 @@ export default define(class ObjectAssigment extends Element {
|
|
|
144
146
|
}
|
|
145
147
|
|
|
146
148
|
const primitiveValue = term.getPrimitiveValue(),
|
|
147
|
-
|
|
149
|
+
nominalValue = primitiveValue, ///
|
|
150
|
+
node = nominalValue.getNode(),
|
|
148
151
|
nodeTerminalNode = node.isTerminalNode(),
|
|
149
152
|
terminal = nodeTerminalNode; ///
|
|
150
153
|
|
|
@@ -165,16 +168,17 @@ export default define(class ObjectAssigment extends Element {
|
|
|
165
168
|
|
|
166
169
|
context.trace(`Evaluating the child nodes '${namedParameterString}' named parameter...`);
|
|
167
170
|
|
|
168
|
-
if (type !==
|
|
171
|
+
if (type !== NOMINAL_VALUES_TYPE) {
|
|
169
172
|
const namedParameterString = namedParameter.getString(),
|
|
170
|
-
message = `The '${namedParameterString}' named parameter's type should be '${
|
|
173
|
+
message = `The '${namedParameterString}' named parameter's type should be '${NOMINAL_VALUES_TYPE}'.`,
|
|
171
174
|
exception = Exception.fromMessage(message);
|
|
172
175
|
|
|
173
176
|
throw exception;
|
|
174
177
|
}
|
|
175
178
|
|
|
176
179
|
const primitiveValue = term.getPrimitiveValue(),
|
|
177
|
-
|
|
180
|
+
nominalValue = primitiveValue, ///
|
|
181
|
+
node = nominalValue.getNode(),
|
|
178
182
|
nodeNonTerminalNode = node.isNonTerminalNode();
|
|
179
183
|
|
|
180
184
|
if (!nodeNonTerminalNode) {
|
|
@@ -189,7 +193,7 @@ export default define(class ObjectAssigment extends Element {
|
|
|
189
193
|
childNodes = nonTerminalNode.getChildNodes(),
|
|
190
194
|
nodes = childNodes; ///
|
|
191
195
|
|
|
192
|
-
term =
|
|
196
|
+
term = termFromNodesAndNominalValue(nodes, nominalValue);
|
|
193
197
|
|
|
194
198
|
const termSttring = term.getString();
|
|
195
199
|
|
package/src/element/every.js
CHANGED
|
@@ -6,8 +6,8 @@ import elements from "../elements";
|
|
|
6
6
|
import Exception from "../exception";
|
|
7
7
|
|
|
8
8
|
import { define } from "../elements";
|
|
9
|
-
import { NODES_TYPE, BOOLEAN_TYPE } from "../types";
|
|
10
9
|
import { termFromNode, termFromBoolean } from "../utilities/term";
|
|
10
|
+
import { BOOLEAN_TYPE, NOMINAL_VALUES_TYPE } from "../types";
|
|
11
11
|
|
|
12
12
|
const { asyncEvery } = asynchronousUtilities;
|
|
13
13
|
|
|
@@ -41,9 +41,9 @@ export default define(class Every extends Element {
|
|
|
41
41
|
|
|
42
42
|
const termType = term.getType();
|
|
43
43
|
|
|
44
|
-
if (termType !==
|
|
44
|
+
if (termType !== NOMINAL_VALUES_TYPE) {
|
|
45
45
|
const termString = term.getString(),
|
|
46
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
46
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUES_TYPE}'.`,
|
|
47
47
|
exception = Exception.fromMessage(message);
|
|
48
48
|
|
|
49
49
|
throw exception;
|
package/src/element/nodeQuery.js
CHANGED
|
@@ -6,8 +6,8 @@ import { arrayUtilities } from "necessary";
|
|
|
6
6
|
import Exception from "../exception";
|
|
7
7
|
|
|
8
8
|
import { define } from "../elements";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { NOMINAL_VALUE_TYPE } from "../types";
|
|
10
|
+
import { termFromNodeAndNominalValue } from "../utilities/nominal";
|
|
11
11
|
|
|
12
12
|
const { first } = arrayUtilities;
|
|
13
13
|
|
|
@@ -45,9 +45,9 @@ export default define(class NodeQuery extends Element {
|
|
|
45
45
|
|
|
46
46
|
const termType = term.getType();
|
|
47
47
|
|
|
48
|
-
if (termType !==
|
|
48
|
+
if (termType !== NOMINAL_VALUE_TYPE) {
|
|
49
49
|
const termString = term.getString(),
|
|
50
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
50
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUE_TYPE}'.`,
|
|
51
51
|
exception = Exception.fromMessage(message);
|
|
52
52
|
|
|
53
53
|
throw exception;
|
|
@@ -55,9 +55,10 @@ export default define(class NodeQuery extends Element {
|
|
|
55
55
|
|
|
56
56
|
let node;
|
|
57
57
|
|
|
58
|
-
const primitiveValue = term.getPrimitiveValue()
|
|
58
|
+
const primitiveValue = term.getPrimitiveValue(),
|
|
59
|
+
nominalValue = primitiveValue; ///
|
|
59
60
|
|
|
60
|
-
node =
|
|
61
|
+
node = nominalValue.getNode();
|
|
61
62
|
|
|
62
63
|
if (node === null) {
|
|
63
64
|
const termString = term.getString(),
|
|
@@ -77,11 +78,12 @@ export default define(class NodeQuery extends Element {
|
|
|
77
78
|
throw exception;
|
|
78
79
|
}
|
|
79
80
|
|
|
81
|
+
|
|
80
82
|
const firstNode = first(nodes);
|
|
81
83
|
|
|
82
|
-
node = firstNode
|
|
84
|
+
node = firstNode ///
|
|
83
85
|
|
|
84
|
-
term =
|
|
86
|
+
term = termFromNodeAndNominalValue(node, nominalValue);
|
|
85
87
|
|
|
86
88
|
const termString = term.getString();
|
|
87
89
|
|
|
@@ -5,8 +5,8 @@ import { Element } from "occam-languages";
|
|
|
5
5
|
import Exception from "../exception";
|
|
6
6
|
|
|
7
7
|
import { define } from "../elements";
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { NOMINAL_VALUE_TYPE } from "../types";
|
|
9
|
+
import { termFromNodesAndNominalValue } from "../utilities/nominal";
|
|
10
10
|
|
|
11
11
|
export default define(class NodesQuery extends Element {
|
|
12
12
|
constructor(context, string, node, breakPoint, variable, query) {
|
|
@@ -42,9 +42,9 @@ export default define(class NodesQuery extends Element {
|
|
|
42
42
|
|
|
43
43
|
const termType = term.getType();
|
|
44
44
|
|
|
45
|
-
if (termType !==
|
|
45
|
+
if (termType !== NOMINAL_VALUE_TYPE) {
|
|
46
46
|
const termString = term.getString(),
|
|
47
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
47
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUE_TYPE}'.`,
|
|
48
48
|
exception = Exception.fromMessage(message);
|
|
49
49
|
|
|
50
50
|
throw exception;
|
|
@@ -52,9 +52,10 @@ export default define(class NodesQuery extends Element {
|
|
|
52
52
|
|
|
53
53
|
let node;
|
|
54
54
|
|
|
55
|
-
const primitiveValue = term.getPrimitiveValue()
|
|
55
|
+
const primitiveValue = term.getPrimitiveValue(),
|
|
56
|
+
nominalValue = primitiveValue; ///
|
|
56
57
|
|
|
57
|
-
node =
|
|
58
|
+
node = nominalValue.getNode();
|
|
58
59
|
|
|
59
60
|
if (node === null) {
|
|
60
61
|
const termString = term.getString(),
|
|
@@ -66,7 +67,7 @@ export default define(class NodesQuery extends Element {
|
|
|
66
67
|
|
|
67
68
|
const nodes = this.query.execute(node);
|
|
68
69
|
|
|
69
|
-
term =
|
|
70
|
+
term = termFromNodesAndNominalValue(nodes, nominalValue);
|
|
70
71
|
|
|
71
72
|
const termString = term.getString();
|
|
72
73
|
|
package/src/element/primitive.js
CHANGED
|
@@ -4,10 +4,9 @@ import { Element } from "occam-languages";
|
|
|
4
4
|
import { arrayUtilities } from "necessary";
|
|
5
5
|
|
|
6
6
|
import elements from "../elements";
|
|
7
|
-
import nullNode from "../nullNode";
|
|
8
7
|
|
|
9
8
|
import { define } from "../elements";
|
|
10
|
-
import {
|
|
9
|
+
import { STRING_TYPE, NUMBER_TYPE, BOOLEAN_TYPE, NOMINAL_VALUE_TYPE, NOMINAL_VALUES_TYPE } from "../types";
|
|
11
10
|
|
|
12
11
|
const { match } = arrayUtilities;
|
|
13
12
|
|
|
@@ -44,30 +43,6 @@ export default define(class Primitive extends Element {
|
|
|
44
43
|
const value = primitive.getValue();
|
|
45
44
|
|
|
46
45
|
switch (type) {
|
|
47
|
-
case NODE_TYPE: {
|
|
48
|
-
const nodeA = this.value, ///
|
|
49
|
-
nodeB = value, ///
|
|
50
|
-
nodeMatches = matchNode(nodeA, nodeB);
|
|
51
|
-
|
|
52
|
-
if (nodeMatches) {
|
|
53
|
-
equalTo = true;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
break;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
case NODES_TYPE: {
|
|
60
|
-
const nodesA = this.value, ///
|
|
61
|
-
nodesB = value, ///
|
|
62
|
-
nodesMatch = matchNodes(nodesA, nodesB);
|
|
63
|
-
|
|
64
|
-
if (nodesMatch) {
|
|
65
|
-
equalTo = true;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
break;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
46
|
case STRING_TYPE: {
|
|
72
47
|
const stringLiteralA = this.value, ///
|
|
73
48
|
stringLiteralB = value; ///
|
|
@@ -100,41 +75,42 @@ export default define(class Primitive extends Element {
|
|
|
100
75
|
|
|
101
76
|
break;
|
|
102
77
|
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
78
|
|
|
106
|
-
|
|
107
|
-
|
|
79
|
+
case NOMINAL_VALUE_TYPE: {
|
|
80
|
+
const nominalValueA = this.value, ///
|
|
81
|
+
nomimalValueB = value, ///
|
|
82
|
+
matches = nominalValueA.match(nomimalValueB);
|
|
108
83
|
|
|
109
|
-
|
|
110
|
-
|
|
84
|
+
if (matches) {
|
|
85
|
+
equalTo = true;
|
|
86
|
+
}
|
|
111
87
|
|
|
112
|
-
|
|
113
|
-
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
114
90
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
nodeMatches = false;
|
|
121
|
-
} else {
|
|
122
|
-
const nodeAMatchesNodeB = nodeA.match(nodeB);
|
|
91
|
+
case NOMINAL_VALUES_TYPE: {
|
|
92
|
+
const nominalValuesA = this.value, ///
|
|
93
|
+
nominalValuesB = value, ///
|
|
94
|
+
matches = match(nominalValuesA, nominalValuesB, (nominalValueA, nomimalValueB) => {
|
|
95
|
+
const matches = nominalValueA.match(nomimalValueB);
|
|
123
96
|
|
|
124
|
-
|
|
125
|
-
|
|
97
|
+
if (matches) {
|
|
98
|
+
return true;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
126
101
|
|
|
127
|
-
|
|
128
|
-
|
|
102
|
+
if (matches) {
|
|
103
|
+
equalTo = true;
|
|
104
|
+
}
|
|
129
105
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
const nodeMatches = matchNode(nodeA, nodeB);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
133
108
|
|
|
134
|
-
|
|
135
|
-
return true;
|
|
109
|
+
}
|
|
136
110
|
}
|
|
137
|
-
});
|
|
138
111
|
|
|
139
|
-
|
|
140
|
-
}
|
|
112
|
+
return equalTo;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
static name = "Primitive";
|
|
116
|
+
});
|
package/src/element/procedure.js
CHANGED
|
@@ -7,7 +7,7 @@ import Exception from "../exception";
|
|
|
7
7
|
|
|
8
8
|
import { define } from "../elements";
|
|
9
9
|
import { BOOLEAN_TYPE } from "../types";
|
|
10
|
-
import {
|
|
10
|
+
import { termsFromNominalValues } from "../utilities/terms";
|
|
11
11
|
|
|
12
12
|
export default define(class Procedure extends Element {
|
|
13
13
|
constructor(context, string, node, breakPoint, type, label, parameters, returnBlock) {
|
|
@@ -74,14 +74,16 @@ export default define(class Procedure extends Element {
|
|
|
74
74
|
return term;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
async callNominally(
|
|
77
|
+
async callNominally(nominalValues) {
|
|
78
|
+
const context = this.getContext();
|
|
79
|
+
|
|
78
80
|
await this.break(context);
|
|
79
81
|
|
|
80
82
|
const procedureString = this.getString(); ///
|
|
81
83
|
|
|
82
84
|
context.trace(`Calling the '${procedureString}' procedure nominally...`);
|
|
83
85
|
|
|
84
|
-
const terms =
|
|
86
|
+
const terms = termsFromNominalValues(nominalValues),
|
|
85
87
|
term = await this.call(terms, context);
|
|
86
88
|
|
|
87
89
|
context.debug(`...called the '${procedureString}' procedure nominally.`);
|
package/src/element/reduce.js
CHANGED
|
@@ -6,8 +6,8 @@ import elements from "../elements";
|
|
|
6
6
|
import Exception from "../exception";
|
|
7
7
|
|
|
8
8
|
import { define } from "../elements";
|
|
9
|
-
import { NODES_TYPE } from "../types";
|
|
10
9
|
import { termFromNode } from "../utilities/term";
|
|
10
|
+
import { NOMINAL_VALUES_TYPE } from "../types";
|
|
11
11
|
|
|
12
12
|
const { asyncReduce } = asynchronousUtilities;
|
|
13
13
|
|
|
@@ -45,9 +45,9 @@ export default define(class Reduce extends Element {
|
|
|
45
45
|
|
|
46
46
|
const termType = term.getType();
|
|
47
47
|
|
|
48
|
-
if (termType !==
|
|
48
|
+
if (termType !== NOMINAL_VALUES_TYPE) {
|
|
49
49
|
const termString = term.getString(),
|
|
50
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
50
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUES_TYPE}'.`,
|
|
51
51
|
exception = Exception.fromMessage(message);
|
|
52
52
|
|
|
53
53
|
throw exception;
|
package/src/element/some.js
CHANGED
|
@@ -6,8 +6,8 @@ import elements from "../elements";
|
|
|
6
6
|
import Exception from "../exception";
|
|
7
7
|
|
|
8
8
|
import { define } from "../elements";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { BOOLEAN_TYPE, NOMINAL_VALUES_TYPE } from "../types";
|
|
10
|
+
import { termFromBoolean, termFromNominalValue } from "../utilities/term";
|
|
11
11
|
|
|
12
12
|
const { asyncSome } = asynchronousUtilities;
|
|
13
13
|
|
|
@@ -40,20 +40,20 @@ export default define(class Some extends Element {
|
|
|
40
40
|
|
|
41
41
|
const termType = term.getType();
|
|
42
42
|
|
|
43
|
-
if (termType !==
|
|
43
|
+
if (termType !== NOMINAL_VALUES_TYPE) {
|
|
44
44
|
const termString = term.getString(),
|
|
45
|
-
message = `The '${termString}' term's '${termType}' type should be '${
|
|
45
|
+
message = `The '${termString}' term's '${termType}' type should be '${NOMINAL_VALUES_TYPE}'.`,
|
|
46
46
|
exception = Exception.fromMessage(message);
|
|
47
47
|
|
|
48
48
|
throw exception;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
const primitiveValue = term.getPrimitiveValue(),
|
|
52
|
-
|
|
53
|
-
boolean = await asyncSome(
|
|
52
|
+
nominalValues = primitiveValue, ///
|
|
53
|
+
boolean = await asyncSome(nominalValues, async (nominalValue) => {
|
|
54
54
|
let term;
|
|
55
55
|
|
|
56
|
-
term =
|
|
56
|
+
term = termFromNominalValue(nominalValue);
|
|
57
57
|
|
|
58
58
|
const { Terms } = elements,
|
|
59
59
|
terms = Terms.fromTerm(term, context);
|