occam-furtle 3.0.305 → 3.0.310
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 +20 -20
- package/lib/element/assignment/object.js +17 -14
- package/lib/element/binding/named.js +6 -6
- package/lib/element/binding.js +4 -4
- package/lib/element/every.js +8 -8
- package/lib/element/nodeQuery.js +5 -5
- package/lib/element/nodesQuery.js +5 -5
- package/lib/element/parameter.js +4 -4
- package/lib/element/primitive.js +42 -23
- package/lib/element/procedure/anonymous.js +4 -4
- package/lib/element/procedure.js +8 -10
- package/lib/element/reduce.js +6 -6
- package/lib/element/some.js +8 -8
- package/lib/element/term/comparison.js +4 -4
- package/lib/element/term/logical.js +7 -7
- package/lib/element/term/negated.js +5 -5
- package/lib/element/term.js +3 -3
- package/lib/element/ternary.js +5 -5
- package/lib/element/type.js +94 -0
- package/lib/element/value.js +56 -5
- package/lib/element/variable.js +4 -4
- package/lib/node/assignments/variable.js +4 -10
- package/lib/node/binding/named.js +2 -2
- package/lib/node/binding.js +16 -23
- package/lib/node/declaration/procedure.js +4 -10
- package/lib/node/parameter.js +5 -10
- package/lib/node/primitive.js +9 -9
- package/lib/node/procedure/anoymous.js +4 -10
- package/lib/node/type.js +41 -0
- package/lib/nominalValueProperties.js +86 -0
- package/lib/nominalValueProperty.js +45 -0
- package/lib/nonTerminalNodeMap.js +3 -1
- package/lib/preamble.js +2 -1
- package/lib/ruleNames.js +5 -1
- package/lib/typeNames.js +34 -0
- package/lib/utilities/element.js +50 -18
- package/lib/utilities/primitive.js +13 -9
- package/lib/utilities/string.js +35 -22
- package/lib/utilities/value.js +9 -20
- package/lib/utilities/values.js +3 -3
- package/package.json +2 -2
- package/src/element/assignment/array.js +31 -26
- package/src/element/assignment/object.js +20 -13
- package/src/element/binding/named.js +10 -6
- package/src/element/binding.js +5 -3
- package/src/element/every.js +9 -7
- package/src/element/nodeQuery.js +5 -4
- package/src/element/nodesQuery.js +5 -4
- package/src/element/parameter.js +5 -3
- package/src/element/primitive.js +56 -26
- package/src/element/procedure/anonymous.js +5 -3
- package/src/element/procedure.js +8 -12
- package/src/element/reduce.js +6 -5
- package/src/element/some.js +9 -7
- package/src/element/term/comparison.js +6 -3
- package/src/element/term/logical.js +8 -6
- package/src/element/term/negated.js +5 -4
- package/src/element/term.js +3 -2
- package/src/element/ternary.js +5 -4
- package/src/element/type.js +128 -0
- package/src/element/value.js +27 -3
- package/src/element/variable.js +5 -3
- package/src/node/assignments/variable.js +5 -13
- package/src/node/binding/named.js +1 -1
- package/src/node/binding.js +19 -30
- package/src/node/declaration/procedure.js +5 -13
- package/src/node/parameter.js +6 -14
- package/src/node/primitive.js +8 -8
- package/src/node/procedure/anoymous.js +5 -13
- package/src/node/type.js +43 -0
- package/src/nominalValueProperties.js +103 -0
- package/src/nominalValueProperty.js +55 -0
- package/src/nonTerminalNodeMap.js +3 -0
- package/src/preamble.js +1 -0
- package/src/ruleNames.js +1 -0
- package/src/typeNames.js +7 -0
- package/src/utilities/element.js +67 -19
- package/src/utilities/primitive.js +31 -22
- package/src/utilities/string.js +42 -24
- package/src/utilities/value.js +18 -31
- package/src/utilities/values.js +1 -2
- package/lib/nodeProperties.js +0 -78
- package/lib/nodeProperty.js +0 -45
- package/lib/types.js +0 -34
- package/src/nodeProperties.js +0 -89
- package/src/nodeProperty.js +0 -53
- package/src/types.js +0 -7
package/src/nodeProperties.js
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import Exception from "./exception";
|
|
4
|
-
import NodeProperty from "./nodeProperty";
|
|
5
|
-
|
|
6
|
-
import { nodePropertiesStringFromNodePropertiesArray } from "./utilities/string";
|
|
7
|
-
import { STRING_TYPE, BOOLEAN_TYPE, NOMINAL_VALUES_TYPE } from "./types";
|
|
8
|
-
import { CONTENT_PARAMETER_NAME, TERMINAL_PARAMETER_NAME, CHILD_NODES_PARAMETER_NAME } from "./parameterNames";
|
|
9
|
-
|
|
10
|
-
class NodeProperties {
|
|
11
|
-
constructor(string, array) {
|
|
12
|
-
this.string = string;
|
|
13
|
-
this.array = array;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
getString() {
|
|
17
|
-
return this.string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
getArray() {
|
|
21
|
-
return this.array;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
someNodeProperty(callback) { return this.array.some(callback); }
|
|
25
|
-
|
|
26
|
-
compareNamedBinding(namedBinding, context) {
|
|
27
|
-
const namedBindingString = namedBinding.getString(),
|
|
28
|
-
nodePropertiesString = this.string; ///
|
|
29
|
-
|
|
30
|
-
context.trace(`Comparing the '${namedBindingString}' named binding with the '${nodePropertiesString}' node properties...`);
|
|
31
|
-
|
|
32
|
-
const namedBindingsCompare = this.someNodeProperty((nodeProperty) => {
|
|
33
|
-
const namedBindingComparesToNodeProperty = nodeProperty.compareNamedBinding(namedBinding, context);
|
|
34
|
-
|
|
35
|
-
if (namedBindingComparesToNodeProperty) {
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
if (!namedBindingsCompare) {
|
|
41
|
-
const message = `The '${namedBindingString}' named binding does not compmare to any of the '${nodePropertiesString}' node properties.`,
|
|
42
|
-
exception = Exception.fromMessage(message);
|
|
43
|
-
|
|
44
|
-
throw exception;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
context.debug(`...compared the '${namedBindingString}' named binding with the '${nodePropertiesString}' node properties.`);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
compareNamedBindings(namedBindings, context) {
|
|
51
|
-
namedBindings.forEachNamedBinding((namedBinding) => {
|
|
52
|
-
this.compareNamedBinding(namedBinding, context);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
static fromNothing() {
|
|
57
|
-
const nodePropertiesArray = nodePropertiesArrayFromNothing(),
|
|
58
|
-
string = nodePropertiesStringFromNodePropertiesArray(nodePropertiesArray),
|
|
59
|
-
array = nodePropertiesArray, ///
|
|
60
|
-
nodeProperties = new NodeProperties(string, array);
|
|
61
|
-
|
|
62
|
-
return nodeProperties;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const nodeProperties = NodeProperties.fromNothing();
|
|
67
|
-
|
|
68
|
-
export default nodeProperties;
|
|
69
|
-
|
|
70
|
-
function nodePropertiesArrayFromNothing() {
|
|
71
|
-
const types = [
|
|
72
|
-
STRING_TYPE,
|
|
73
|
-
BOOLEAN_TYPE,
|
|
74
|
-
NOMINAL_VALUES_TYPE
|
|
75
|
-
],
|
|
76
|
-
names = [
|
|
77
|
-
CONTENT_PARAMETER_NAME,
|
|
78
|
-
TERMINAL_PARAMETER_NAME,
|
|
79
|
-
CHILD_NODES_PARAMETER_NAME
|
|
80
|
-
],
|
|
81
|
-
nodePropertiesArray = names.map((name, index) => {
|
|
82
|
-
const type = types[index],
|
|
83
|
-
nodeProperty = NodeProperty.fromNameAndType(name, type);
|
|
84
|
-
|
|
85
|
-
return nodeProperty;
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
return nodePropertiesArray;
|
|
89
|
-
}
|
package/src/nodeProperty.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
import { nodePropertyStringFromNameAndType } from "./utilities/string";
|
|
4
|
-
|
|
5
|
-
export default class NodeProperty {
|
|
6
|
-
constructor(string, type, name) {
|
|
7
|
-
this.string = string;
|
|
8
|
-
this.type = type;
|
|
9
|
-
this.name = name;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
getString() {
|
|
13
|
-
return this.string;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
getType() {
|
|
17
|
-
return this.type;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
getName() {
|
|
21
|
-
return this.name;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
compareNamedBinding(namedBinding, context) {
|
|
25
|
-
let namedBindingCompares;
|
|
26
|
-
|
|
27
|
-
const nodePropertyString = this.string, ///
|
|
28
|
-
namedBindingString = namedBinding.getString();
|
|
29
|
-
|
|
30
|
-
context.trace(`Comparing the '${nodePropertyString}' node property with the '${namedBindingString}' named binding...`);
|
|
31
|
-
|
|
32
|
-
const name = namedBinding.getName(),
|
|
33
|
-
type = namedBinding.getType();
|
|
34
|
-
|
|
35
|
-
namedBindingCompares = ((this.name === name) && (this.type === type));
|
|
36
|
-
|
|
37
|
-
if (namedBindingCompares) {
|
|
38
|
-
context.debug(`...compared the '${nodePropertyString}' node property with the '${namedBindingString}' named binding.`);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return namedBindingCompares;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
static name = "Parameter";
|
|
45
|
-
|
|
46
|
-
static fromNameAndType(name, type) {
|
|
47
|
-
const nodePropertyString = nodePropertyStringFromNameAndType(name, type),
|
|
48
|
-
string = nodePropertyString, ///
|
|
49
|
-
nodeProperty = new NodeProperty(string, type, name);
|
|
50
|
-
|
|
51
|
-
return nodeProperty;
|
|
52
|
-
}
|
|
53
|
-
};
|