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.
Files changed (87) hide show
  1. package/lib/element/assignment/array.js +20 -20
  2. package/lib/element/assignment/object.js +17 -14
  3. package/lib/element/binding/named.js +6 -6
  4. package/lib/element/binding.js +4 -4
  5. package/lib/element/every.js +8 -8
  6. package/lib/element/nodeQuery.js +5 -5
  7. package/lib/element/nodesQuery.js +5 -5
  8. package/lib/element/parameter.js +4 -4
  9. package/lib/element/primitive.js +42 -23
  10. package/lib/element/procedure/anonymous.js +4 -4
  11. package/lib/element/procedure.js +8 -10
  12. package/lib/element/reduce.js +6 -6
  13. package/lib/element/some.js +8 -8
  14. package/lib/element/term/comparison.js +4 -4
  15. package/lib/element/term/logical.js +7 -7
  16. package/lib/element/term/negated.js +5 -5
  17. package/lib/element/term.js +3 -3
  18. package/lib/element/ternary.js +5 -5
  19. package/lib/element/type.js +94 -0
  20. package/lib/element/value.js +56 -5
  21. package/lib/element/variable.js +4 -4
  22. package/lib/node/assignments/variable.js +4 -10
  23. package/lib/node/binding/named.js +2 -2
  24. package/lib/node/binding.js +16 -23
  25. package/lib/node/declaration/procedure.js +4 -10
  26. package/lib/node/parameter.js +5 -10
  27. package/lib/node/primitive.js +9 -9
  28. package/lib/node/procedure/anoymous.js +4 -10
  29. package/lib/node/type.js +41 -0
  30. package/lib/nominalValueProperties.js +86 -0
  31. package/lib/nominalValueProperty.js +45 -0
  32. package/lib/nonTerminalNodeMap.js +3 -1
  33. package/lib/preamble.js +2 -1
  34. package/lib/ruleNames.js +5 -1
  35. package/lib/typeNames.js +34 -0
  36. package/lib/utilities/element.js +50 -18
  37. package/lib/utilities/primitive.js +13 -9
  38. package/lib/utilities/string.js +35 -22
  39. package/lib/utilities/value.js +9 -20
  40. package/lib/utilities/values.js +3 -3
  41. package/package.json +2 -2
  42. package/src/element/assignment/array.js +31 -26
  43. package/src/element/assignment/object.js +20 -13
  44. package/src/element/binding/named.js +10 -6
  45. package/src/element/binding.js +5 -3
  46. package/src/element/every.js +9 -7
  47. package/src/element/nodeQuery.js +5 -4
  48. package/src/element/nodesQuery.js +5 -4
  49. package/src/element/parameter.js +5 -3
  50. package/src/element/primitive.js +56 -26
  51. package/src/element/procedure/anonymous.js +5 -3
  52. package/src/element/procedure.js +8 -12
  53. package/src/element/reduce.js +6 -5
  54. package/src/element/some.js +9 -7
  55. package/src/element/term/comparison.js +6 -3
  56. package/src/element/term/logical.js +8 -6
  57. package/src/element/term/negated.js +5 -4
  58. package/src/element/term.js +3 -2
  59. package/src/element/ternary.js +5 -4
  60. package/src/element/type.js +128 -0
  61. package/src/element/value.js +27 -3
  62. package/src/element/variable.js +5 -3
  63. package/src/node/assignments/variable.js +5 -13
  64. package/src/node/binding/named.js +1 -1
  65. package/src/node/binding.js +19 -30
  66. package/src/node/declaration/procedure.js +5 -13
  67. package/src/node/parameter.js +6 -14
  68. package/src/node/primitive.js +8 -8
  69. package/src/node/procedure/anoymous.js +5 -13
  70. package/src/node/type.js +43 -0
  71. package/src/nominalValueProperties.js +103 -0
  72. package/src/nominalValueProperty.js +55 -0
  73. package/src/nonTerminalNodeMap.js +3 -0
  74. package/src/preamble.js +1 -0
  75. package/src/ruleNames.js +1 -0
  76. package/src/typeNames.js +7 -0
  77. package/src/utilities/element.js +67 -19
  78. package/src/utilities/primitive.js +31 -22
  79. package/src/utilities/string.js +42 -24
  80. package/src/utilities/value.js +18 -31
  81. package/src/utilities/values.js +1 -2
  82. package/lib/nodeProperties.js +0 -78
  83. package/lib/nodeProperty.js +0 -45
  84. package/lib/types.js +0 -34
  85. package/src/nodeProperties.js +0 -89
  86. package/src/nodeProperty.js +0 -53
  87. package/src/types.js +0 -7
@@ -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
- }
@@ -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
- };
package/src/types.js DELETED
@@ -1,7 +0,0 @@
1
- "use strict";
2
-
3
- export const STRING_TYPE = "String";
4
- export const NUMBER_TYPE = "Number";
5
- export const BOOLEAN_TYPE = "Boolean";
6
- export const NOMINAL_VALUE_TYPE = "Node"; ///
7
- export const NOMINAL_VALUES_TYPE = "Nodes"; ///