pareto-core 0.1.0

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 (99) hide show
  1. package/dist/__internals/async/asynchronous_collection_builder.d.ts +12 -0
  2. package/dist/__internals/async/asynchronous_collection_builder.js +35 -0
  3. package/dist/__internals/async/create_asynchronous_processes_monitor.d.ts +15 -0
  4. package/dist/__internals/async/create_asynchronous_processes_monitor.js +53 -0
  5. package/dist/__internals/async/create_refinement_context.d.ts +5 -0
  6. package/dist/__internals/async/create_refinement_context.js +29 -0
  7. package/dist/__internals/sync/expression/decide/index.d.ts +6 -0
  8. package/dist/__internals/sync/expression/decide/index.js +10 -0
  9. package/dist/__internals/sync/expression/decide/state_group/assert_unreachable.d.ts +15 -0
  10. package/dist/__internals/sync/expression/decide/state_group/assert_unreachable.js +21 -0
  11. package/dist/__internals/sync/expression/decide/state_group/select.d.ts +15 -0
  12. package/dist/__internals/sync/expression/decide/state_group/select.js +21 -0
  13. package/dist/__internals/sync/expression/decide/state_group/switch_state.d.ts +19 -0
  14. package/dist/__internals/sync/expression/decide/state_group/switch_state.js +24 -0
  15. package/dist/__internals/sync/expression/initialize.d.ts +66 -0
  16. package/dist/__internals/sync/expression/initialize.js +302 -0
  17. package/dist/__internals/sync/expression/literals/dictionary.d.ts +11 -0
  18. package/dist/__internals/sync/expression/literals/dictionary.js +110 -0
  19. package/dist/__internals/sync/expression/literals/list.d.ts +2 -0
  20. package/dist/__internals/sync/expression/literals/list.js +90 -0
  21. package/dist/__internals/sync/expression/literals/optional.d.ts +3 -0
  22. package/dist/__internals/sync/expression/literals/optional.js +48 -0
  23. package/dist/__internals/sync/expression/special.d.ts +49 -0
  24. package/dist/__internals/sync/expression/special.js +107 -0
  25. package/dist/__internals/sync/extracts/literal.d.ts +20 -0
  26. package/dist/__internals/sync/extracts/literal.js +54 -0
  27. package/dist/__internals/sync/get_location_info.d.ts +8 -0
  28. package/dist/__internals/sync/get_location_info.js +41 -0
  29. package/dist/command/Command_Block.d.ts +3 -0
  30. package/dist/command/Command_Block.js +3 -0
  31. package/dist/command/command.d.ts +2 -0
  32. package/dist/command/command.js +19 -0
  33. package/dist/command/command_procedure.d.ts +3 -0
  34. package/dist/command/command_procedure.js +22 -0
  35. package/dist/command/command_promise.d.ts +17 -0
  36. package/dist/command/command_promise.js +29 -0
  37. package/dist/command/handle_command_block.d.ts +3 -0
  38. package/dist/command/handle_command_block.js +21 -0
  39. package/dist/command/index.d.ts +10 -0
  40. package/dist/command/index.js +29 -0
  41. package/dist/command/statement.d.ts +27 -0
  42. package/dist/command/statement.js +271 -0
  43. package/dist/deserializer.d.ts +4 -0
  44. package/dist/deserializer.js +15 -0
  45. package/dist/interface/Deprecated_Source_Location.d.ts +5 -0
  46. package/dist/interface/Deprecated_Source_Location.js +3 -0
  47. package/dist/interface/Raw_Optional_Value.d.ts +1 -0
  48. package/dist/interface/Raw_Optional_Value.js +3 -0
  49. package/dist/interface/algorithm_signatures/Command.d.ts +8 -0
  50. package/dist/interface/algorithm_signatures/Command.js +3 -0
  51. package/dist/interface/algorithm_signatures/Deserializer.d.ts +17 -0
  52. package/dist/interface/algorithm_signatures/Deserializer.js +3 -0
  53. package/dist/interface/algorithm_signatures/Production.d.ts +6 -0
  54. package/dist/interface/algorithm_signatures/Production.js +3 -0
  55. package/dist/interface/algorithm_signatures/Query.d.ts +3 -0
  56. package/dist/interface/algorithm_signatures/Query.js +3 -0
  57. package/dist/interface/algorithm_signatures/Query_Function.d.ts +1 -0
  58. package/dist/interface/algorithm_signatures/Query_Function.js +3 -0
  59. package/dist/interface/algorithm_signatures/Refiner.d.ts +5 -0
  60. package/dist/interface/algorithm_signatures/Refiner.js +3 -0
  61. package/dist/interface/algorithm_signatures/Serializer.d.ts +9 -0
  62. package/dist/interface/algorithm_signatures/Serializer.js +3 -0
  63. package/dist/interface/algorithm_signatures/Transformer.d.ts +2 -0
  64. package/dist/interface/algorithm_signatures/Transformer.js +3 -0
  65. package/dist/interface/data/Circular_Dependency.d.ts +8 -0
  66. package/dist/interface/data/Circular_Dependency.js +3 -0
  67. package/dist/interface/data/Dictionary.d.ts +29 -0
  68. package/dist/interface/data/Dictionary.js +3 -0
  69. package/dist/interface/data/List.d.ts +26 -0
  70. package/dist/interface/data/List.js +3 -0
  71. package/dist/interface/data/Optional_Value.d.ts +16 -0
  72. package/dist/interface/data/Optional_Value.js +3 -0
  73. package/dist/interface/globals.d.ts +20 -0
  74. package/dist/interface/globals.js +2 -0
  75. package/dist/interface/index.d.ts +14 -0
  76. package/dist/interface/index.js +31 -0
  77. package/dist/interface/interfaces.d.ts +54 -0
  78. package/dist/interface/interfaces.js +3 -0
  79. package/dist/query/expression.d.ts +6 -0
  80. package/dist/query/expression.js +49 -0
  81. package/dist/query/index.d.ts +6 -0
  82. package/dist/query/index.js +23 -0
  83. package/dist/query/query.d.ts +4 -0
  84. package/dist/query/query.js +15 -0
  85. package/dist/query/query_function.d.ts +2 -0
  86. package/dist/query/query_function.js +15 -0
  87. package/dist/query/query_result.d.ts +10 -0
  88. package/dist/query/query_result.js +97 -0
  89. package/dist/refiner/index.d.ts +8 -0
  90. package/dist/refiner/index.js +45 -0
  91. package/dist/refiner/resolve.d.ts +176 -0
  92. package/dist/refiner/resolve.js +289 -0
  93. package/dist/serializer.d.ts +6 -0
  94. package/dist/serializer.js +33 -0
  95. package/dist/transformer/deprecated_shorthands_for_unresolved.d.ts +40 -0
  96. package/dist/transformer/deprecated_shorthands_for_unresolved.js +77 -0
  97. package/dist/transformer/index.d.ts +4 -0
  98. package/dist/transformer/index.js +24 -0
  99. package/package.json +26 -0
@@ -0,0 +1,12 @@
1
+ import * as _pi from "../../interface";
2
+ export type Asynchronous_Dictionary_Builder<Entry> = {
3
+ 'add entry': (key: string, entry: Entry) => void;
4
+ 'get dictionary': () => _pi.Dictionary<Entry>;
5
+ };
6
+ export declare const create_asynchronous_dictionary_builder: <Entry>() => Asynchronous_Dictionary_Builder<Entry>;
7
+ export type Asynchronous_List_Builder<Item> = {
8
+ 'add item': (item: Item) => void;
9
+ 'add list': (list: _pi.List<Item>) => void;
10
+ 'get list': () => _pi.List<Item>;
11
+ };
12
+ export declare const create_asynchronous_list_builder: <Item>() => Asynchronous_List_Builder<Item>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create_asynchronous_list_builder = exports.create_asynchronous_dictionary_builder = void 0;
4
+ const dictionary_1 = require("../sync/expression/literals/dictionary");
5
+ const list_1 = require("../sync/expression/literals/list");
6
+ const create_asynchronous_dictionary_builder = () => {
7
+ const entries = {};
8
+ return {
9
+ 'add entry': (key, entry) => {
10
+ entries[key] = entry;
11
+ },
12
+ 'get dictionary': () => {
13
+ return (0, dictionary_1.$$)(entries);
14
+ },
15
+ };
16
+ };
17
+ exports.create_asynchronous_dictionary_builder = create_asynchronous_dictionary_builder;
18
+ const create_asynchronous_list_builder = () => {
19
+ const items = [];
20
+ return {
21
+ 'add item': (item) => {
22
+ items.push(item);
23
+ },
24
+ 'add list': (list) => {
25
+ list.__for_each(($) => {
26
+ items.push($);
27
+ });
28
+ },
29
+ 'get list': () => {
30
+ return (0, list_1.$$)(items);
31
+ },
32
+ };
33
+ };
34
+ exports.create_asynchronous_list_builder = create_asynchronous_list_builder;
35
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXN5bmNocm9ub3VzX2NvbGxlY3Rpb25fYnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9fX2ludGVybmFscy9hc3luYy9hc3luY2hyb25vdXNfY29sbGVjdGlvbl9idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLHVFQUFpRjtBQUNqRiwyREFBcUU7QUFPOUQsTUFBTSxzQ0FBc0MsR0FBRyxHQUFrRCxFQUFFO0lBQ3RHLE1BQU0sT0FBTyxHQUE2QixFQUFFLENBQUE7SUFFNUMsT0FBTztRQUNILFdBQVcsRUFBRSxDQUFDLEdBQVcsRUFBRSxLQUFZLEVBQUUsRUFBRTtZQUN2QyxPQUFPLENBQUMsR0FBRyxDQUFDLEdBQUcsS0FBSyxDQUFBO1FBQ3hCLENBQUM7UUFFRCxnQkFBZ0IsRUFBRSxHQUFHLEVBQUU7WUFDbkIsT0FBTyxJQUFBLGVBQWtCLEVBQUMsT0FBTyxDQUFDLENBQUE7UUFDdEMsQ0FBQztLQUNKLENBQUE7QUFDTCxDQUFDLENBQUE7QUFaWSxRQUFBLHNDQUFzQywwQ0FZbEQ7QUFRTSxNQUFNLGdDQUFnQyxHQUFHLEdBQTBDLEVBQUU7SUFDeEYsTUFBTSxLQUFLLEdBQVcsRUFBRSxDQUFBO0lBRXhCLE9BQU87UUFDSCxVQUFVLEVBQUUsQ0FBQyxJQUFVLEVBQUUsRUFBRTtZQUN2QixLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFBO1FBQ3BCLENBQUM7UUFDRCxVQUFVLEVBQUUsQ0FBQyxJQUFvQixFQUFFLEVBQUU7WUFDakMsSUFBSSxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsRUFBRSxFQUFFO2dCQUNsQixLQUFLLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxDQUFBO1lBQ2pCLENBQUMsQ0FBQyxDQUFBO1FBQ04sQ0FBQztRQUVELFVBQVUsRUFBRSxHQUFHLEVBQUU7WUFDYixPQUFPLElBQUEsU0FBWSxFQUFDLEtBQUssQ0FBQyxDQUFBO1FBQzlCLENBQUM7S0FDSixDQUFBO0FBQ0wsQ0FBQyxDQUFBO0FBakJZLFFBQUEsZ0NBQWdDLG9DQWlCNUMifQ==
@@ -0,0 +1,15 @@
1
+ export type I_Async_Monitor = {
2
+ readonly 'report process started': () => void;
3
+ readonly 'report process finished': () => void;
4
+ };
5
+ /**
6
+ * this function helps in keeping track of ongoing async operations
7
+ * async operations are registered and when finished reported as such.
8
+ * when all ongoing operations are finished the onEnd callback is called
9
+ *
10
+ * this function is specifically useful for async map functions
11
+ *
12
+ * @param callback this callback creates a scope within which the counter is provided
13
+ * @param onEnd this callback will be called when all ongoing operations are finished
14
+ */
15
+ export declare function create_asynchronous_processes_monitor(monitoring_phase: ($: I_Async_Monitor) => void, on_all_finished: () => void): void;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create_asynchronous_processes_monitor = create_asynchronous_processes_monitor;
4
+ /**
5
+ * this function helps in keeping track of ongoing async operations
6
+ * async operations are registered and when finished reported as such.
7
+ * when all ongoing operations are finished the onEnd callback is called
8
+ *
9
+ * this function is specifically useful for async map functions
10
+ *
11
+ * @param callback this callback creates a scope within which the counter is provided
12
+ * @param onEnd this callback will be called when all ongoing operations are finished
13
+ */
14
+ function create_asynchronous_processes_monitor(monitoring_phase, on_all_finished) {
15
+ let counter = 0;
16
+ /*
17
+ * we need to keep track of if the registration phase is ended or not.
18
+ * it can happen that the counter reaches 0 during the registration phase, specifically if there is no real async calls being made
19
+ * in that case the reportFinished counter is als called during the registration phase.
20
+ * If that happens there should not yet be a call to onEnd().
21
+ */
22
+ let registration_phase_ended = false;
23
+ let on_all_finished_has_been_called = false;
24
+ function checkStatus() {
25
+ if (registration_phase_ended) {
26
+ if (counter === 0) {
27
+ if (on_all_finished_has_been_called === true) {
28
+ throw new Error("CORE: already ended");
29
+ }
30
+ on_all_finished_has_been_called = true;
31
+ on_all_finished();
32
+ }
33
+ }
34
+ }
35
+ monitoring_phase({
36
+ 'report process started': () => {
37
+ if (on_all_finished_has_been_called) {
38
+ throw new Error("CORE: async call done after context is ready");
39
+ }
40
+ counter += 1;
41
+ },
42
+ 'report process finished': () => {
43
+ if (counter === 0) {
44
+ throw new Error("CORE: decrement while counter is 0");
45
+ }
46
+ counter -= 1;
47
+ checkStatus();
48
+ },
49
+ });
50
+ registration_phase_ended = true;
51
+ checkStatus();
52
+ }
53
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlX2FzeW5jaHJvbm91c19wcm9jZXNzZXNfbW9uaXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9fX2ludGVybmFscy9hc3luYy9jcmVhdGVfYXN5bmNocm9ub3VzX3Byb2Nlc3Nlc19tb25pdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBZ0JBLHNGQThDQztBQXhERDs7Ozs7Ozs7O0dBU0c7QUFDSCxTQUFnQixxQ0FBcUMsQ0FDakQsZ0JBQThDLEVBQzlDLGVBQTJCO0lBRzNCLElBQUksT0FBTyxHQUFHLENBQUMsQ0FBQTtJQUVmOzs7OztPQUtHO0lBQ0gsSUFBSSx3QkFBd0IsR0FBRyxLQUFLLENBQUE7SUFDcEMsSUFBSSwrQkFBK0IsR0FBRyxLQUFLLENBQUE7SUFFM0MsU0FBUyxXQUFXO1FBQ2hCLElBQUksd0JBQXdCLEVBQUUsQ0FBQztZQUUzQixJQUFJLE9BQU8sS0FBSyxDQUFDLEVBQUUsQ0FBQztnQkFDaEIsSUFBSSwrQkFBK0IsS0FBSyxJQUFJLEVBQUUsQ0FBQztvQkFDM0MsTUFBTSxJQUFJLEtBQUssQ0FBQyxxQkFBcUIsQ0FBQyxDQUFBO2dCQUMxQyxDQUFDO2dCQUNELCtCQUErQixHQUFHLElBQUksQ0FBQTtnQkFDdEMsZUFBZSxFQUFFLENBQUE7WUFDckIsQ0FBQztRQUNMLENBQUM7SUFDTCxDQUFDO0lBQ0QsZ0JBQWdCLENBQUM7UUFDYix3QkFBd0IsRUFBRSxHQUFHLEVBQUU7WUFDM0IsSUFBSSwrQkFBK0IsRUFBRSxDQUFDO2dCQUNsQyxNQUFNLElBQUksS0FBSyxDQUFDLDhDQUE4QyxDQUFDLENBQUE7WUFDbkUsQ0FBQztZQUNELE9BQU8sSUFBSSxDQUFDLENBQUE7UUFFaEIsQ0FBQztRQUNELHlCQUF5QixFQUFFLEdBQUcsRUFBRTtZQUM1QixJQUFJLE9BQU8sS0FBSyxDQUFDLEVBQUUsQ0FBQztnQkFDaEIsTUFBTSxJQUFJLEtBQUssQ0FBQyxvQ0FBb0MsQ0FBQyxDQUFBO1lBQ3pELENBQUM7WUFDRCxPQUFPLElBQUksQ0FBQyxDQUFBO1lBQ1osV0FBVyxFQUFFLENBQUE7UUFDakIsQ0FBQztLQUNKLENBQUMsQ0FBQTtJQUNGLHdCQUF3QixHQUFHLElBQUksQ0FBQTtJQUMvQixXQUFXLEVBQUUsQ0FBQTtBQUNqQixDQUFDIn0=
@@ -0,0 +1,5 @@
1
+ import * as _pi from "../../interface";
2
+ export type Refinement_Result<Output, Error> = {
3
+ __extract_data: (on_success: ($: Output) => void, on_error: ($: Error) => void) => void;
4
+ };
5
+ export declare const create_refinement_context: <Output, Error>(callback: (abort: _pi.Abort<Error>) => Output) => Refinement_Result<Output, Error>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create_refinement_context = void 0;
4
+ const create_refinement_context = (callback) => {
5
+ return ({
6
+ __extract_data(on_result, on_error) {
7
+ class Refine_Guard_Abort_Error {
8
+ constructor(error) {
9
+ this.error = error;
10
+ }
11
+ }
12
+ try {
13
+ on_result(callback((error) => {
14
+ throw new Refine_Guard_Abort_Error(error);
15
+ }));
16
+ }
17
+ catch (e) {
18
+ if (e instanceof Refine_Guard_Abort_Error) {
19
+ on_error(e.error);
20
+ }
21
+ else {
22
+ throw e; // re-throw unexpected errors
23
+ }
24
+ }
25
+ }
26
+ });
27
+ };
28
+ exports.create_refinement_context = create_refinement_context;
29
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlX3JlZmluZW1lbnRfY29udGV4dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9fX2ludGVybmFscy9hc3luYy9jcmVhdGVfcmVmaW5lbWVudF9jb250ZXh0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQVlPLE1BQU0seUJBQXlCLEdBQUcsQ0FDckMsUUFBNkMsRUFDYixFQUFFO0lBQ2xDLE9BQU8sQ0FBQztRQUNKLGNBQWMsQ0FDVixTQUE4QixFQUM5QixRQUE0QjtZQUU1QixNQUFNLHdCQUF3QjtnQkFDMUIsWUFDb0IsS0FBWTtvQkFBWixVQUFLLEdBQUwsS0FBSyxDQUFPO2dCQUM1QixDQUFDO2FBQ1I7WUFDRCxJQUFJLENBQUM7Z0JBQ0QsU0FBUyxDQUNMLFFBQVEsQ0FDSixDQUFDLEtBQUssRUFBRSxFQUFFO29CQUNOLE1BQU0sSUFBSSx3QkFBd0IsQ0FBQyxLQUFLLENBQUMsQ0FBQztnQkFDOUMsQ0FBQyxDQUNKLENBQ0osQ0FBQTtZQUNMLENBQUM7WUFBQyxPQUFPLENBQUMsRUFBRSxDQUFDO2dCQUNULElBQUksQ0FBQyxZQUFZLHdCQUF3QixFQUFFLENBQUM7b0JBQ3hDLFFBQVEsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLENBQUE7Z0JBQ3JCLENBQUM7cUJBQU0sQ0FBQztvQkFDSixNQUFNLENBQUMsQ0FBQSxDQUFDLDZCQUE2QjtnQkFDekMsQ0FBQztZQUNMLENBQUM7UUFDTCxDQUFDO0tBQ0osQ0FBQyxDQUFBO0FBQ04sQ0FBQyxDQUFBO0FBOUJZLFFBQUEseUJBQXlCLDZCQThCckMifQ==
@@ -0,0 +1,6 @@
1
+ import { $$ as state_group_assert_unreachable } from "./state_group/assert_unreachable";
2
+ import { $$ as state_group_switch_state } from "./state_group/switch_state";
3
+ import { $$ as state_group_select } from "./state_group/select";
4
+ export declare const au: typeof state_group_assert_unreachable;
5
+ export declare const ss: typeof state_group_switch_state;
6
+ export declare const sg: typeof state_group_select;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sg = exports.ss = exports.au = void 0;
4
+ const assert_unreachable_1 = require("./state_group/assert_unreachable");
5
+ const switch_state_1 = require("./state_group/switch_state");
6
+ const select_1 = require("./state_group/select");
7
+ exports.au = assert_unreachable_1.$$;
8
+ exports.ss = switch_state_1.$$;
9
+ exports.sg = select_1.$$;
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9zcmMvX19pbnRlcm5hbHMvc3luYy9leHByZXNzaW9uL2RlY2lkZS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQSx5RUFBdUY7QUFDdkYsNkRBQTJFO0FBQzNFLGlEQUErRDtBQUVsRCxRQUFBLEVBQUUsR0FBRyx1QkFBOEIsQ0FBQTtBQUNuQyxRQUFBLEVBQUUsR0FBRyxpQkFBd0IsQ0FBQTtBQUM3QixRQUFBLEVBQUUsR0FBRyxXQUFrQixDQUFBIn0=
@@ -0,0 +1,15 @@
1
+ /**
2
+ * au means 'assert unreachable'. Used in the 'default' clause of switch statements to ensure
3
+ * during compile time that all possible cases have been implemented
4
+ *
5
+ * example:
6
+ *
7
+ * switch (x) {
8
+ * case "5":
9
+ * break
10
+ * default: au(x)
11
+ * }
12
+ *
13
+ * @param _x
14
+ */
15
+ export declare function $$<RT>(_x: never): RT;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.$$ = $$;
4
+ /**
5
+ * au means 'assert unreachable'. Used in the 'default' clause of switch statements to ensure
6
+ * during compile time that all possible cases have been implemented
7
+ *
8
+ * example:
9
+ *
10
+ * switch (x) {
11
+ * case "5":
12
+ * break
13
+ * default: au(x)
14
+ * }
15
+ *
16
+ * @param _x
17
+ */
18
+ function $$(_x) {
19
+ throw new Error("unreachable");
20
+ }
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXJ0X3VucmVhY2hhYmxlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL19faW50ZXJuYWxzL3N5bmMvZXhwcmVzc2lvbi9kZWNpZGUvc3RhdGVfZ3JvdXAvYXNzZXJ0X3VucmVhY2hhYmxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBZUMsZ0JBRUE7QUFoQkQ7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUNGLFNBQWdCLEVBQUUsQ0FBSyxFQUFTO0lBQzdCLE1BQU0sSUFBSSxLQUFLLENBQUMsYUFBYSxDQUFDLENBQUE7QUFDbEMsQ0FBQyJ9
@@ -0,0 +1,15 @@
1
+ /**
2
+ * cc means 'change context'. It creates a new scope in which a variable name can be used again
3
+ * (usually '$', a variable name that indicates the current context in exupery)
4
+ *
5
+ * example:
6
+ *
7
+ * cc($[1], ($) => {
8
+ * //here $[1] has become $
9
+ * })
10
+ *
11
+ * @param input
12
+ * @param callback
13
+ * @returns
14
+ */
15
+ export declare function $$<T extends readonly [string, any], RT>(input: T, callback: (output: T) => RT): RT;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ /**
3
+ * cc means 'change context'. It creates a new scope in which a variable name can be used again
4
+ * (usually '$', a variable name that indicates the current context in exupery)
5
+ *
6
+ * example:
7
+ *
8
+ * cc($[1], ($) => {
9
+ * //here $[1] has become $
10
+ * })
11
+ *
12
+ * @param input
13
+ * @param callback
14
+ * @returns
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.$$ = $$;
18
+ function $$(input, callback) {
19
+ return callback(input);
20
+ }
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VsZWN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL19faW50ZXJuYWxzL3N5bmMvZXhwcmVzc2lvbi9kZWNpZGUvc3RhdGVfZ3JvdXAvc2VsZWN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7Ozs7OztHQWFHOztBQUVILGdCQUVDO0FBRkQsU0FBZ0IsRUFBRSxDQUF1QyxLQUFRLEVBQUUsUUFBMkI7SUFDMUYsT0FBTyxRQUFRLENBQUMsS0FBSyxDQUFDLENBQUE7QUFDMUIsQ0FBQyJ9
@@ -0,0 +1,19 @@
1
+ export type State<T> = readonly [string | boolean, T];
2
+ /**
3
+ * ss means 'switch state'.
4
+ * used to make the value T the context variable ('$')
5
+ * given a tuple of a string (or boolean) and a value T,
6
+ * the function takes the value T and calls back the callback ($c)
7
+ * notice that the string part is never used
8
+ *
9
+ * example:
10
+ *
11
+ * switch ($.state[0]) {
12
+ * case "on":
13
+ * return ss($.state, ($) => $.value
14
+ * case "off":
15
+ * return ss($.state, ($) => null
16
+ * default: au($.state[0])
17
+ * }
18
+ */
19
+ export declare function $$<T, RT>($: State<T>, $c: ($: T) => RT): RT;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.$$ = $$;
4
+ /**
5
+ * ss means 'switch state'.
6
+ * used to make the value T the context variable ('$')
7
+ * given a tuple of a string (or boolean) and a value T,
8
+ * the function takes the value T and calls back the callback ($c)
9
+ * notice that the string part is never used
10
+ *
11
+ * example:
12
+ *
13
+ * switch ($.state[0]) {
14
+ * case "on":
15
+ * return ss($.state, ($) => $.value
16
+ * case "off":
17
+ * return ss($.state, ($) => null
18
+ * default: au($.state[0])
19
+ * }
20
+ */
21
+ function $$($, $c) {
22
+ return $c($[1]);
23
+ }
24
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3dpdGNoX3N0YXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL19faW50ZXJuYWxzL3N5bmMvZXhwcmVzc2lvbi9kZWNpZGUvc3RhdGVfZ3JvdXAvc3dpdGNoX3N0YXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBcUJBLGdCQUtDO0FBdEJEOzs7Ozs7Ozs7Ozs7Ozs7O0dBZ0JHO0FBQ0gsU0FBZ0IsRUFBRSxDQUNkLENBQVcsRUFDWCxFQUFnQjtJQUVoQixPQUFPLEVBQUUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQTtBQUNuQixDQUFDIn0=
@@ -0,0 +1,66 @@
1
+ import * as _pi from "../../../interface";
2
+ import { $$ as dictionary_literal } from "./literals/dictionary";
3
+ import { $$ as list_literal } from "./literals/list";
4
+ import { set as optional_set, not_set as optional_not_set } from "./literals/optional";
5
+ export declare namespace boolean {
6
+ const dictionary_is_empty: <T>($: _pi.Dictionary<T>) => boolean;
7
+ const list_is_empty: <T>($: _pi.List<T>) => boolean;
8
+ }
9
+ export declare namespace dictionary {
10
+ const filter: <T, New_Type>($: _pi.Dictionary<T>, handle_value: (value: T, id: string) => _pi.Optional_Value<New_Type>) => _pi.Dictionary<New_Type>;
11
+ const from_list: <T, NT>(list: _pi.List<T>, get_key: (item: T) => string, get_value: (item: T) => NT, abort: _pi.Abort<["duplicate id in list to dictionary", null]>) => _pi.Dictionary<NT>;
12
+ const group_dictionary: <T>(dictionary: _pi.Dictionary<T>, get_key: (item: T, id: string) => string) => _pi.Dictionary<_pi.Dictionary<T>>;
13
+ const group_list: <T>(list: _pi.List<T>, get_key: (item: T) => string) => _pi.Dictionary<_pi.List<T>>;
14
+ const literal: typeof dictionary_literal;
15
+ const map: <T, New_Type>($: _pi.Dictionary<T>, handle_value: (value: T, id: string) => New_Type) => _pi.Dictionary<New_Type>;
16
+ const resolve: <Unresolved, Resolved>(source: _pi.Dictionary<Unresolved>, handle_entry: ($: Unresolved, key: string, acyclic_lookup: _pi.Acyclic_Lookup<Resolved>, cyclic_lookup: _pi.Cyclic_Lookup<Resolved>) => Resolved) => _pi.Dictionary<Resolved>;
17
+ }
18
+ export declare namespace integer {
19
+ /**
20
+ * Performs integer division of two numbers (rounding towards negative infinity).
21
+ *
22
+ * dividend / divisor
23
+ *
24
+ * examples:
25
+ * integer_division(7, 3) === 2
26
+ * integer_division(7, -3) === -3
27
+ * integer_division(-7, 3) === -3
28
+ * integer_division(-7, -3) === 2
29
+ */
30
+ const divide: (dividend: number, divisor: number, abort: _pi.Abort<["divide by zero", null]>) => number;
31
+ }
32
+ export declare namespace list {
33
+ type List_Builder<T> = {
34
+ 'add element': ($: T) => void;
35
+ 'add list': ($: _pi.List<T>) => void;
36
+ };
37
+ export const deprecated_build: <T>($: ($c: List_Builder<T>) => void) => _pi.List<T>;
38
+ export const filter: <T, New_Type>($: _pi.List<T>, handle_value: (value: T) => _pi.Optional_Value<New_Type>) => _pi.List<New_Type>;
39
+ export const flatten: <T, NT>(lists: (_pi.List<T>), callback: ($: T) => _pi.List<NT>) => _pi.List<NT>;
40
+ export const from_dictionary: <T, New_Type>($: _pi.Dictionary<T>, handle_entry: ($: T, id: string) => New_Type) => _pi.List<New_Type>;
41
+ export const from_single: <T>($: T) => _pi.List<T>;
42
+ export const literal: typeof list_literal;
43
+ export type NonUndefined = null | {};
44
+ export const nested_literal_old: <T extends NonUndefined | {}>(lists: (undefined | T[] | _pi.List<T>)[]) => _pi.List<T>;
45
+ export type Nested<T> = undefined | Nested<T>[] | _pi.List<T>;
46
+ export const nested_literal_new: <T extends NonUndefined | {}>(nested: Nested<T>) => _pi.List<T>;
47
+ export const map: <T, New_Type>($: _pi.List<T>, handle_value: (value: T) => New_Type) => _pi.List<New_Type>;
48
+ export const map_with_state: <T, New_Type, State>($: _pi.List<T>, initial_state: State, handle_value: (value: T, state: State) => New_Type, update_state: (value: T, state: State) => State) => _pi.List<New_Type>;
49
+ export const reverse: <T>($: _pi.List<T>) => _pi.List<T>;
50
+ export {};
51
+ }
52
+ export declare namespace natural {
53
+ const amount_of_dictionary_entries: <T>(dictionary: _pi.Dictionary<T>) => number;
54
+ const amount_of_list_elements: <T>(list: _pi.List<T>) => number;
55
+ const source_column: (depth: number) => number;
56
+ const source_line: (depth: number) => number;
57
+ const text_length: ($: string) => number;
58
+ }
59
+ export declare namespace optional {
60
+ function block<RT>(callback: () => _pi.Optional_Value<RT>): _pi.Optional_Value<RT>;
61
+ const set: typeof optional_set;
62
+ const not_set: typeof optional_not_set;
63
+ }
64
+ export declare namespace state_group {
65
+ function block<RT extends readonly [string, any]>(callback: () => RT): RT;
66
+ }