pareto-fountain-pen 0.2.0 → 0.3.1

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 (67) hide show
  1. package/dist/implementation/algorithms/procedures/guaranteed/console_error.d.ts +2 -1
  2. package/dist/implementation/algorithms/procedures/guaranteed/console_error.js +2 -2
  3. package/dist/implementation/algorithms/procedures/guaranteed/console_log.d.ts +2 -1
  4. package/dist/implementation/algorithms/procedures/guaranteed/console_log.js +2 -2
  5. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_directory.d.ts +1 -1
  6. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_directory.js +4 -4
  7. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_file.d.ts +1 -1
  8. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_file.js +3 -3
  9. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_node.d.ts +1 -1
  10. package/dist/implementation/algorithms/procedures/unguaranteed/write_to_node.js +3 -3
  11. package/dist/implementation/algorithms/transformations/block/lines.js +1 -1
  12. package/dist/implementation/generated/pareto/generic/parse/ast.d.ts +10 -0
  13. package/dist/implementation/generated/pareto/generic/parse/ast.js +245 -0
  14. package/dist/implementation/generated/pareto/generic/parse/astn_parse_generic.d.ts +13 -0
  15. package/dist/implementation/generated/pareto/generic/parse/astn_parse_generic.js +50 -0
  16. package/dist/implementation/generated/pareto/generic/parse/parse.d.ts +6 -0
  17. package/dist/implementation/generated/pareto/generic/parse/parse.js +65 -0
  18. package/dist/implementation/generated/pareto/generic/parse/string_iterator.d.ts +40 -0
  19. package/dist/implementation/generated/pareto/generic/parse/string_iterator.js +109 -0
  20. package/dist/implementation/generated/pareto/generic/parse/token.d.ts +9 -0
  21. package/dist/implementation/generated/pareto/generic/parse/token.js +519 -0
  22. package/dist/implementation/generated/pareto/generic/resolve.js +3 -3
  23. package/dist/implementation/generated/pareto/generic/serialize.d.ts +4 -0
  24. package/dist/implementation/generated/pareto/generic/serialize.js +93 -0
  25. package/dist/implementation/generated/pareto/generic/unmarshall.d.ts +26 -26
  26. package/dist/implementation/generated/pareto/generic/unmarshall.js +19 -10
  27. package/dist/implementation/generated/pareto/schemas/block/deserialize.d.ts +7 -0
  28. package/dist/implementation/generated/pareto/schemas/block/deserialize.js +40 -0
  29. package/dist/implementation/generated/pareto/schemas/block/serialize.d.ts +7 -0
  30. package/dist/implementation/generated/pareto/schemas/block/serialize.js +53 -0
  31. package/dist/implementation/generated/pareto/schemas/lines/deserialize.d.ts +3 -0
  32. package/dist/implementation/generated/pareto/schemas/lines/deserialize.js +32 -0
  33. package/dist/implementation/generated/pareto/schemas/lines/serialize.d.ts +3 -0
  34. package/dist/implementation/generated/pareto/schemas/lines/serialize.js +37 -0
  35. package/dist/implementation/generated/pareto/schemas/semi_lines/deserialize.d.ts +3 -0
  36. package/dist/implementation/generated/pareto/schemas/semi_lines/deserialize.js +32 -0
  37. package/dist/implementation/generated/pareto/schemas/semi_lines/serialize.d.ts +3 -0
  38. package/dist/implementation/generated/pareto/schemas/semi_lines/serialize.js +37 -0
  39. package/dist/implementation/generated/pareto/schemas/text/deserialize.d.ts +3 -0
  40. package/dist/implementation/generated/pareto/schemas/text/deserialize.js +32 -0
  41. package/dist/implementation/generated/pareto/schemas/text/serialize.d.ts +3 -0
  42. package/dist/implementation/generated/pareto/schemas/text/serialize.js +37 -0
  43. package/dist/interface/generated/pareto/core/astn_source.d.ts +15 -0
  44. package/dist/interface/generated/pareto/core/parse_result.d.ts +25 -0
  45. package/dist/interface/generated/pareto/core/parse_result.js +3 -0
  46. package/dist/interface/generated/pareto/core/resolve.d.ts +1 -1
  47. package/dist/interface/generated/pareto/core/resolved.d.ts +3 -3
  48. package/dist/interface/generated/pareto/core/token.d.ts +49 -0
  49. package/dist/interface/generated/pareto/core/token.js +3 -0
  50. package/dist/interface/generated/pareto/schemas/block/deserialize.d.ts +158 -0
  51. package/dist/interface/generated/pareto/schemas/block/deserialize.js +3 -0
  52. package/dist/interface/generated/pareto/schemas/block/serialize.d.ts +158 -0
  53. package/dist/interface/generated/pareto/schemas/block/serialize.js +3 -0
  54. package/dist/interface/generated/pareto/schemas/lines/deserialize.d.ts +54 -0
  55. package/dist/interface/generated/pareto/schemas/lines/deserialize.js +3 -0
  56. package/dist/interface/generated/pareto/schemas/lines/serialize.d.ts +54 -0
  57. package/dist/interface/generated/pareto/schemas/lines/serialize.js +3 -0
  58. package/dist/interface/generated/pareto/schemas/semi_lines/deserialize.d.ts +54 -0
  59. package/dist/interface/generated/pareto/schemas/semi_lines/deserialize.js +3 -0
  60. package/dist/interface/generated/pareto/schemas/semi_lines/serialize.d.ts +54 -0
  61. package/dist/interface/generated/pareto/schemas/semi_lines/serialize.js +3 -0
  62. package/dist/interface/generated/pareto/schemas/text/deserialize.d.ts +54 -0
  63. package/dist/interface/generated/pareto/schemas/text/deserialize.js +3 -0
  64. package/dist/interface/generated/pareto/schemas/text/serialize.d.ts +54 -0
  65. package/dist/interface/generated/pareto/schemas/text/serialize.js +3 -0
  66. package/dist/temp/temp_types.d.ts +2 -2
  67. package/package.json +7 -14
@@ -0,0 +1,109 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.create_string_iterator = exports.is_control_character = void 0;
4
+ const to_character_list_1 = require("exupery-standard-library/dist/implementation/algorithms/operations/impure/text/to_character_list");
5
+ const WhitespaceChars = {
6
+ tab: 0x09, // \t
7
+ line_feed: 0x0A, // \n
8
+ carriage_return: 0x0D, // \r
9
+ space: 0x20, //
10
+ };
11
+ const is_control_character = ($) => {
12
+ return ($ < 0x20 && $ !== WhitespaceChars.tab && $ !== WhitespaceChars.line_feed && $ !== WhitespaceChars.carriage_return);
13
+ };
14
+ exports.is_control_character = is_control_character;
15
+ /**
16
+ * Creates a string iterator that allows iterating over characters in a string,
17
+ * while keeping track of line numbers, columns, and line indentation.
18
+ */
19
+ const create_string_iterator = ($, $p) => {
20
+ const source = $;
21
+ const characters = (0, to_character_list_1.$$)($);
22
+ const length = characters.__get_number_of_elements();
23
+ let found_carriage_return_before = false;
24
+ let position = 0;
25
+ let relative_position = {
26
+ 'line': 0,
27
+ 'column': 0,
28
+ 'line indentation': null
29
+ };
30
+ const consume_character = () => {
31
+ const c = characters.__get_element_at(position);
32
+ const start = relative_position;
33
+ relative_position = c.transform(($) => {
34
+ return $ === WhitespaceChars.line_feed
35
+ ? {
36
+ 'line': relative_position.line + 1,
37
+ 'column': 0,
38
+ 'line indentation': null,
39
+ }
40
+ : found_carriage_return_before
41
+ ? {
42
+ 'line': relative_position.line + 1,
43
+ 'column': 0,
44
+ 'line indentation': null,
45
+ }
46
+ : {
47
+ 'line': relative_position.line,
48
+ 'column': relative_position['column'] + ($ === WhitespaceChars.tab
49
+ ? $p['tab size']
50
+ : 1),
51
+ 'line indentation': relative_position['line indentation'] !== null
52
+ ? relative_position['line indentation']
53
+ : $ === WhitespaceChars.space || $ === WhitespaceChars.tab
54
+ ? null
55
+ : relative_position['column'],
56
+ };
57
+ }, () => relative_position //this is weird, we were already at the end of the list
58
+ );
59
+ found_carriage_return_before = c.transform(($) => $ === WhitespaceChars.carriage_return, () => false);
60
+ position += 1;
61
+ };
62
+ return {
63
+ 'consume string': ($) => {
64
+ (0, to_character_list_1.$$)($).__for_each(() => {
65
+ consume_character();
66
+ });
67
+ },
68
+ 'consume character': consume_character,
69
+ 'get current character': () => {
70
+ if (position === length) {
71
+ return null;
72
+ }
73
+ return characters.__get_element_at(position).transform(($) => $, () => null);
74
+ },
75
+ 'look ahead': ($) => {
76
+ const next_position = position + $;
77
+ if (next_position >= length) {
78
+ return null;
79
+ }
80
+ return characters.__get_element_at(next_position).transform(($) => $, () => null);
81
+ },
82
+ 'create location info': () => {
83
+ return {
84
+ 'absolute': position,
85
+ 'relative': {
86
+ 'line': relative_position.line,
87
+ 'column': relative_position['column'],
88
+ }
89
+ };
90
+ },
91
+ 'create offset location info': (subtract) => {
92
+ return {
93
+ 'absolute': position - subtract,
94
+ 'relative': {
95
+ 'line': relative_position.line,
96
+ 'column': relative_position['column'] - subtract,
97
+ }
98
+ };
99
+ },
100
+ 'create location info string': () => `${relative_position.line}:${relative_position['column']}`,
101
+ 'get line indentation': () => {
102
+ return relative_position['line indentation'] !== null
103
+ ? relative_position['line indentation']
104
+ : relative_position['column'];
105
+ },
106
+ };
107
+ };
108
+ exports.create_string_iterator = create_string_iterator;
109
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyaW5nX2l0ZXJhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL2ltcGxlbWVudGF0aW9uL2dlbmVyYXRlZC9wYXJldG8vZ2VuZXJpYy9wYXJzZS9zdHJpbmdfaXRlcmF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBb0NBLHdJQUE2STtBQUU3SSxNQUFNLGVBQWUsR0FBRztJQUNwQixHQUFHLEVBQUUsSUFBSSxFQUFtQixLQUFLO0lBQ2pDLFNBQVMsRUFBRSxJQUFJLEVBQWEsS0FBSztJQUNqQyxlQUFlLEVBQUUsSUFBSSxFQUFPLEtBQUs7SUFDakMsS0FBSyxFQUFFLElBQUksRUFBaUIsRUFBRTtDQUNqQyxDQUFBO0FBRU0sTUFBTSxvQkFBb0IsR0FBRyxDQUFDLENBQVMsRUFBVyxFQUFFO0lBQ3ZELE9BQU8sQ0FBQyxDQUFDLEdBQUcsSUFBSSxJQUFJLENBQUMsS0FBSyxlQUFlLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxlQUFlLENBQUMsU0FBUyxJQUFJLENBQUMsS0FBSyxlQUFlLENBQUMsZUFBZSxDQUFDLENBQUE7QUFDOUgsQ0FBQyxDQUFBO0FBRlksUUFBQSxvQkFBb0Isd0JBRWhDO0FBRUQ7OztHQUdHO0FBRUksTUFBTSxzQkFBc0IsR0FBRyxDQUNsQyxDQUFT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N4QyxPQUFPO2dCQUNILFVBQVUsRUFBRSxRQUFRLEdBQUcsUUFBUTtnQkFDL0IsVUFBVSxFQUFFO29CQUNSLE1BQU0sRUFBRSxpQkFBaUIsQ0FBQyxJQUFJO29CQUM5QixRQUFRLEVBQUUsaUJBQWlCLENBQUMsUUFBUSxDQUFDLEdBQUcsUUFBUTtpQkFDbkQ7YUFDSixDQUFBO1FBQ0wsQ0FBQztRQUNELDZCQUE2QixFQUFFLEdBQUcsRUFBRSxDQUFDLEdBQUcsaUJBQWlCLENBQUMsSUFBSSxJQUFJLGlCQUFpQixDQUFDLFFBQVEsQ0FBQyxFQUFFO1FBQy9GLHNCQUFzQixFQUFFLEdBQUcsRUFBRTtZQUN6QixPQUFPLGlCQUFpQixDQUFDLGtCQUFrQixDQUFDLEtBQUssSUFBSTtnQkFDakQsQ0FBQyxDQUFDLGlCQUFpQixDQUFDLGtCQUFrQixDQUFDO2dCQUN2QyxDQUFDLENBQUMsaUJBQWlCLENBQUMsUUFBUSxDQUFDLENBQUE7UUFDckMsQ0FBQztLQUNKLENBQUE7QUFDTCxDQUFDLENBQUE7QUFsSFksUUFBQSxzQkFBc0IsMEJBa0hsQyJ9
@@ -0,0 +1,9 @@
1
+ import * as _out from "../../../../../interface/generated/pareto/core/token";
2
+ import { String_Iterator } from "./string_iterator";
3
+ export declare const Whitespace: (string_iterator: String_Iterator) => _out._T_Whitespace;
4
+ export declare const Trivia: (string_iterator: String_Iterator) => _out._T_Trivia;
5
+ export declare const Annotated_Token: (st: String_Iterator) => _out._T_Annotated_Token;
6
+ export declare const Delimited_String: (string_iterator: String_Iterator, is_end_character: (character: number) => boolean, allow_newlines: boolean) => _out._T_Delimited_String;
7
+ export declare const Tokenizer_Result: ($: null, $p: {
8
+ "string iterator": String_Iterator;
9
+ }) => _out._T_Tokenizer_Result;