fable 3.1.38 → 3.1.41
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/debug/Harness.js +34 -34
- package/dist/fable.js +218 -262
- package/dist/fable.js.map +1 -1
- package/dist/fable.min.js +2 -2
- package/dist/fable.min.js.map +1 -1
- package/example_applications/mathematical_playground/Math-Solver-Harness.js +1 -1
- package/package.json +1 -1
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-FunctionMap.json +14 -0
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-TokenMap.json +1 -1
- package/source/services/Fable-Service-ExpressionParser/Fable-Service-ExpressionParser-ValueMarshal.js +9 -1
- package/source/services/Fable-Service-Math.js +2 -2
- package/source/services/Fable-Service-Utility.js +23 -0
- package/test/ExpressionParser_tests.js +4 -2
package/debug/Harness.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const libFable = require('../source/Fable.js');
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const _Fable = new libFable({"Product": "Harness"});
|
|
4
4
|
|
|
5
5
|
// let tmpValue;
|
|
6
6
|
|
|
@@ -18,35 +18,35 @@
|
|
|
18
18
|
// tmpValue = _Fable.Dates.dateYearDifference("1963-10-01", "2023-09-01");
|
|
19
19
|
// console.log(`Difference in years: ${tmpValue}`);
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
const libMathHarness = require('../example_applications/mathematical_playground/Math-Solver-Harness.js');
|
|
21
|
+
const _ExpressionParser = _Fable.instantiateServiceProviderIfNotExists('ExpressionParser');
|
|
22
|
+
|
|
23
|
+
const _Expression = "TotalCost = CREATEARRAYFROMABSOLUTEVALUES(1 + 5, 2 + 6, 3 + 7)";
|
|
24
|
+
const _Values = (
|
|
25
|
+
{
|
|
26
|
+
"ItemCosts": [100,200,50,45,5]
|
|
27
|
+
});
|
|
28
|
+
const _Manyfest = _Fable.newManyfest(
|
|
29
|
+
{
|
|
30
|
+
"Scope":"None",
|
|
31
|
+
"Descriptors":
|
|
32
|
+
{
|
|
33
|
+
"Bill.Items[].Cost":
|
|
34
|
+
{
|
|
35
|
+
"Name":"Costs of the Bill Items",
|
|
36
|
+
"Hash":"BillItemCosts"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const _SolveResultsObject = {};
|
|
42
|
+
const _DataDestinationObject = {};
|
|
43
|
+
|
|
44
|
+
let tmpResult = _ExpressionParser.solve(_Expression, _Values, _SolveResultsObject, _Manyfest, _DataDestinationObject);
|
|
45
|
+
for (let i = 0; i < _SolveResultsObject.PostfixSolveList.length; i++)
|
|
46
|
+
{
|
|
47
|
+
let tmpToken = _SolveResultsObject.PostfixSolveList[i];
|
|
48
|
+
console.log(`${i}: ${tmpToken.VirtualSymbolName} = (${tmpToken.LeftValue.Token}::${tmpToken.LeftValue.Value}) ${tmpToken.Operation.Token} (${tmpToken.RightValue.Token}::${tmpToken.RightValue.Value}) `)
|
|
49
|
+
}
|
|
50
|
+
console.log(`Result: ${tmpResult}`);
|
|
51
|
+
|
|
52
|
+
// const libMathHarness = require('../example_applications/mathematical_playground/Math-Solver-Harness.js');
|