@abaplint/runtime 2.5.38 → 2.5.40

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 (327) hide show
  1. package/build/src/abap_regex.d.ts +4 -4
  2. package/build/src/abap_regex.js +18 -18
  3. package/build/src/binary_search.d.ts +5 -5
  4. package/build/src/binary_search.js +48 -48
  5. package/build/src/builtin/abs.d.ts +5 -5
  6. package/build/src/builtin/abs.js +17 -17
  7. package/build/src/builtin/boolc.d.ts +4 -4
  8. package/build/src/builtin/boolc.js +22 -22
  9. package/build/src/builtin/ceil.d.ts +5 -5
  10. package/build/src/builtin/ceil.js +17 -17
  11. package/build/src/builtin/concat_lines_of.d.ts +7 -7
  12. package/build/src/builtin/concat_lines_of.js +15 -15
  13. package/build/src/builtin/condense.d.ts +9 -9
  14. package/build/src/builtin/condense.js +28 -28
  15. package/build/src/builtin/contains.d.ts +12 -12
  16. package/build/src/builtin/contains.js +15 -15
  17. package/build/src/builtin/cos.d.ts +5 -5
  18. package/build/src/builtin/cos.js +22 -22
  19. package/build/src/builtin/count.d.ts +12 -12
  20. package/build/src/builtin/count.js +37 -37
  21. package/build/src/builtin/count_any_of.d.ts +8 -8
  22. package/build/src/builtin/count_any_of.js +17 -17
  23. package/build/src/builtin/escape.d.ts +7 -7
  24. package/build/src/builtin/escape.js +30 -30
  25. package/build/src/builtin/find.d.ts +13 -13
  26. package/build/src/builtin/find.js +57 -57
  27. package/build/src/builtin/floor.d.ts +5 -5
  28. package/build/src/builtin/floor.js +17 -17
  29. package/build/src/builtin/frac.d.ts +6 -6
  30. package/build/src/builtin/frac.js +40 -40
  31. package/build/src/builtin/index.d.ts +47 -47
  32. package/build/src/builtin/index.js +64 -64
  33. package/build/src/builtin/insert.d.ts +9 -9
  34. package/build/src/builtin/insert.js +15 -15
  35. package/build/src/builtin/ipow.d.ts +6 -6
  36. package/build/src/builtin/ipow.js +27 -27
  37. package/build/src/builtin/lines.d.ts +4 -4
  38. package/build/src/builtin/lines.js +8 -8
  39. package/build/src/builtin/match.d.ts +5 -5
  40. package/build/src/builtin/match.js +22 -22
  41. package/build/src/builtin/matches.d.ts +6 -6
  42. package/build/src/builtin/matches.js +29 -29
  43. package/build/src/builtin/nmax.d.ts +14 -14
  44. package/build/src/builtin/nmax.js +34 -34
  45. package/build/src/builtin/nmin.d.ts +14 -14
  46. package/build/src/builtin/nmin.js +34 -34
  47. package/build/src/builtin/numofchar.d.ts +5 -5
  48. package/build/src/builtin/numofchar.js +15 -15
  49. package/build/src/builtin/repeat.d.ts +6 -6
  50. package/build/src/builtin/repeat.js +9 -9
  51. package/build/src/builtin/replace.d.ts +13 -13
  52. package/build/src/builtin/replace.js +65 -65
  53. package/build/src/builtin/reverse.d.ts +5 -5
  54. package/build/src/builtin/reverse.js +16 -16
  55. package/build/src/builtin/round.d.ts +8 -8
  56. package/build/src/builtin/round.js +41 -41
  57. package/build/src/builtin/segment.d.ts +8 -8
  58. package/build/src/builtin/segment.js +32 -32
  59. package/build/src/builtin/shift_left.d.ts +9 -9
  60. package/build/src/builtin/shift_left.js +30 -30
  61. package/build/src/builtin/sign.d.ts +5 -5
  62. package/build/src/builtin/sign.js +17 -17
  63. package/build/src/builtin/sin.d.ts +5 -5
  64. package/build/src/builtin/sin.js +22 -22
  65. package/build/src/builtin/sqrt.d.ts +5 -5
  66. package/build/src/builtin/sqrt.js +22 -22
  67. package/build/src/builtin/strlen.d.ts +5 -5
  68. package/build/src/builtin/strlen.js +15 -15
  69. package/build/src/builtin/substring.d.ts +8 -8
  70. package/build/src/builtin/substring.js +28 -28
  71. package/build/src/builtin/substring_after.d.ts +6 -6
  72. package/build/src/builtin/substring_after.js +28 -28
  73. package/build/src/builtin/substring_before.d.ts +6 -6
  74. package/build/src/builtin/substring_before.js +28 -28
  75. package/build/src/builtin/sy.d.ts +2 -2
  76. package/build/src/builtin/sy.js +30 -30
  77. package/build/src/builtin/tan.d.ts +5 -5
  78. package/build/src/builtin/tan.js +22 -22
  79. package/build/src/builtin/to_lower.d.ts +4 -4
  80. package/build/src/builtin/to_lower.js +9 -9
  81. package/build/src/builtin/to_mixed.d.ts +9 -9
  82. package/build/src/builtin/to_mixed.js +48 -48
  83. package/build/src/builtin/to_upper.d.ts +4 -4
  84. package/build/src/builtin/to_upper.js +9 -9
  85. package/build/src/builtin/translate.d.ts +6 -6
  86. package/build/src/builtin/translate.js +19 -19
  87. package/build/src/builtin/trunc.d.ts +5 -5
  88. package/build/src/builtin/trunc.js +17 -17
  89. package/build/src/builtin/xstrlen.d.ts +5 -5
  90. package/build/src/builtin/xstrlen.js +13 -13
  91. package/build/src/classic_error.d.ts +6 -6
  92. package/build/src/classic_error.js +10 -10
  93. package/build/src/clone.d.ts +1 -1
  94. package/build/src/clone.js +37 -37
  95. package/build/src/compare/assigned.d.ts +2 -2
  96. package/build/src/compare/assigned.js +7 -7
  97. package/build/src/compare/between.d.ts +2 -2
  98. package/build/src/compare/between.js +9 -9
  99. package/build/src/compare/ca.d.ts +3 -3
  100. package/build/src/compare/ca.js +36 -36
  101. package/build/src/compare/cn.d.ts +3 -3
  102. package/build/src/compare/cn.js +8 -8
  103. package/build/src/compare/co.d.ts +4 -4
  104. package/build/src/compare/co.js +37 -37
  105. package/build/src/compare/cp.d.ts +4 -4
  106. package/build/src/compare/cp.js +48 -48
  107. package/build/src/compare/cs.d.ts +3 -3
  108. package/build/src/compare/cs.js +33 -33
  109. package/build/src/compare/eq.d.ts +4 -4
  110. package/build/src/compare/eq.js +134 -134
  111. package/build/src/compare/ge.d.ts +3 -3
  112. package/build/src/compare/ge.js +8 -8
  113. package/build/src/compare/gt.d.ts +4 -4
  114. package/build/src/compare/gt.js +107 -107
  115. package/build/src/compare/in.d.ts +4 -4
  116. package/build/src/compare/in.js +34 -34
  117. package/build/src/compare/index.d.ts +22 -22
  118. package/build/src/compare/index.js +40 -40
  119. package/build/src/compare/initial.d.ts +4 -4
  120. package/build/src/compare/initial.js +63 -63
  121. package/build/src/compare/instance_of.d.ts +2 -2
  122. package/build/src/compare/instance_of.js +7 -7
  123. package/build/src/compare/le.d.ts +3 -3
  124. package/build/src/compare/le.js +8 -8
  125. package/build/src/compare/lt.d.ts +4 -4
  126. package/build/src/compare/lt.js +8 -8
  127. package/build/src/compare/m.d.ts +3 -3
  128. package/build/src/compare/m.js +37 -37
  129. package/build/src/compare/na.d.ts +3 -3
  130. package/build/src/compare/na.js +8 -8
  131. package/build/src/compare/ne.d.ts +3 -3
  132. package/build/src/compare/ne.js +8 -8
  133. package/build/src/compare/np.d.ts +3 -3
  134. package/build/src/compare/np.js +8 -8
  135. package/build/src/compare/ns.d.ts +3 -3
  136. package/build/src/compare/ns.js +8 -8
  137. package/build/src/compare/o.d.ts +2 -2
  138. package/build/src/compare/o.js +28 -28
  139. package/build/src/compare/z.d.ts +2 -2
  140. package/build/src/compare/z.js +28 -28
  141. package/build/src/console.d.ts +7 -7
  142. package/build/src/console.js +21 -21
  143. package/build/src/context.d.ts +13 -13
  144. package/build/src/context.js +17 -17
  145. package/build/src/db/db.d.ts +55 -55
  146. package/build/src/db/db.js +2 -2
  147. package/build/src/expand_dynamic.d.ts +2 -2
  148. package/build/src/expand_dynamic.js +22 -22
  149. package/build/src/expand_in.d.ts +2 -2
  150. package/build/src/expand_in.js +24 -24
  151. package/build/src/index.d.ts +52 -52
  152. package/build/src/index.js +54 -54
  153. package/build/src/offset_length.d.ts +16 -16
  154. package/build/src/offset_length.js +78 -78
  155. package/build/src/operators/_bit_operations.d.ts +6 -6
  156. package/build/src/operators/_bit_operations.js +29 -29
  157. package/build/src/operators/_parse.d.ts +4 -4
  158. package/build/src/operators/_parse.js +45 -45
  159. package/build/src/operators/add.d.ts +4 -4
  160. package/build/src/operators/add.js +42 -42
  161. package/build/src/operators/bit-and.d.ts +2 -2
  162. package/build/src/operators/bit-and.js +18 -18
  163. package/build/src/operators/bit-not.d.ts +2 -2
  164. package/build/src/operators/bit-not.js +14 -14
  165. package/build/src/operators/bit-or.d.ts +2 -2
  166. package/build/src/operators/bit-or.js +18 -18
  167. package/build/src/operators/bit-xor.d.ts +2 -2
  168. package/build/src/operators/bit-xor.js +18 -18
  169. package/build/src/operators/concat.d.ts +4 -4
  170. package/build/src/operators/concat.js +35 -35
  171. package/build/src/operators/div.d.ts +4 -4
  172. package/build/src/operators/div.js +12 -12
  173. package/build/src/operators/divide.d.ts +4 -4
  174. package/build/src/operators/divide.js +16 -16
  175. package/build/src/operators/index.d.ts +12 -12
  176. package/build/src/operators/index.js +28 -28
  177. package/build/src/operators/minus.d.ts +4 -4
  178. package/build/src/operators/minus.js +41 -41
  179. package/build/src/operators/mod.d.ts +4 -4
  180. package/build/src/operators/mod.js +12 -12
  181. package/build/src/operators/multiply.d.ts +4 -4
  182. package/build/src/operators/multiply.js +29 -29
  183. package/build/src/operators/power.d.ts +4 -4
  184. package/build/src/operators/power.js +9 -9
  185. package/build/src/rfc.d.ts +25 -25
  186. package/build/src/rfc.js +2 -2
  187. package/build/src/statements/append.d.ts +13 -13
  188. package/build/src/statements/append.js +66 -66
  189. package/build/src/statements/assert.d.ts +1 -1
  190. package/build/src/statements/assert.js +9 -9
  191. package/build/src/statements/assign.d.ts +12 -12
  192. package/build/src/statements/assign.js +136 -136
  193. package/build/src/statements/call_function.d.ts +15 -15
  194. package/build/src/statements/call_function.js +35 -35
  195. package/build/src/statements/cast.d.ts +2 -2
  196. package/build/src/statements/cast.js +56 -56
  197. package/build/src/statements/clear.d.ts +4 -4
  198. package/build/src/statements/clear.js +7 -7
  199. package/build/src/statements/collect.d.ts +3 -3
  200. package/build/src/statements/collect.js +13 -13
  201. package/build/src/statements/commit.d.ts +1 -1
  202. package/build/src/statements/commit.js +7 -7
  203. package/build/src/statements/concatenate.d.ts +11 -11
  204. package/build/src/statements/concatenate.js +47 -47
  205. package/build/src/statements/condense.d.ts +4 -4
  206. package/build/src/statements/condense.js +15 -15
  207. package/build/src/statements/convert.d.ts +14 -14
  208. package/build/src/statements/convert.js +78 -78
  209. package/build/src/statements/create_data.d.ts +16 -16
  210. package/build/src/statements/create_data.js +154 -154
  211. package/build/src/statements/delete_database.d.ts +13 -13
  212. package/build/src/statements/delete_database.js +51 -51
  213. package/build/src/statements/delete_internal.d.ts +12 -12
  214. package/build/src/statements/delete_internal.js +106 -99
  215. package/build/src/statements/describe.d.ts +13 -13
  216. package/build/src/statements/describe.js +89 -89
  217. package/build/src/statements/find.d.ts +17 -17
  218. package/build/src/statements/find.js +173 -168
  219. package/build/src/statements/get_bit.d.ts +4 -4
  220. package/build/src/statements/get_bit.js +12 -12
  221. package/build/src/statements/get_locale.d.ts +2 -2
  222. package/build/src/statements/get_locale.js +8 -8
  223. package/build/src/statements/get_parameter.d.ts +2 -2
  224. package/build/src/statements/get_parameter.js +9 -9
  225. package/build/src/statements/get_run_time.d.ts +2 -2
  226. package/build/src/statements/get_run_time.js +16 -16
  227. package/build/src/statements/get_time.d.ts +9 -9
  228. package/build/src/statements/get_time.js +30 -30
  229. package/build/src/statements/index.d.ts +96 -96
  230. package/build/src/statements/index.js +115 -115
  231. package/build/src/statements/insert_database.d.ts +13 -13
  232. package/build/src/statements/insert_database.js +56 -56
  233. package/build/src/statements/insert_internal.d.ts +13 -13
  234. package/build/src/statements/insert_internal.js +113 -113
  235. package/build/src/statements/loop.d.ts +15 -15
  236. package/build/src/statements/loop.js +115 -115
  237. package/build/src/statements/message.d.ts +17 -17
  238. package/build/src/statements/message.js +89 -89
  239. package/build/src/statements/modify_database.d.ts +12 -12
  240. package/build/src/statements/modify_database.js +39 -39
  241. package/build/src/statements/modify_internal.d.ts +7 -7
  242. package/build/src/statements/modify_internal.js +29 -29
  243. package/build/src/statements/move_corresponding.d.ts +2 -2
  244. package/build/src/statements/move_corresponding.js +10 -10
  245. package/build/src/statements/overlay.d.ts +3 -3
  246. package/build/src/statements/overlay.js +16 -16
  247. package/build/src/statements/raise_event.d.ts +1 -1
  248. package/build/src/statements/raise_event.js +8 -8
  249. package/build/src/statements/read_report.d.ts +8 -8
  250. package/build/src/statements/read_report.js +14 -14
  251. package/build/src/statements/read_table.d.ts +22 -22
  252. package/build/src/statements/read_table.js +130 -130
  253. package/build/src/statements/replace.d.ts +13 -13
  254. package/build/src/statements/replace.js +60 -60
  255. package/build/src/statements/rollback.d.ts +1 -1
  256. package/build/src/statements/rollback.js +7 -7
  257. package/build/src/statements/select.d.ts +8 -8
  258. package/build/src/statements/select.js +77 -77
  259. package/build/src/statements/set_bit.d.ts +4 -4
  260. package/build/src/statements/set_bit.js +41 -41
  261. package/build/src/statements/set_handler.d.ts +3 -3
  262. package/build/src/statements/set_handler.js +8 -8
  263. package/build/src/statements/set_locale.d.ts +2 -2
  264. package/build/src/statements/set_locale.js +7 -7
  265. package/build/src/statements/shift.d.ts +12 -12
  266. package/build/src/statements/shift.js +113 -113
  267. package/build/src/statements/sort.d.ts +9 -9
  268. package/build/src/statements/sort.js +82 -82
  269. package/build/src/statements/split.d.ts +9 -9
  270. package/build/src/statements/split.js +38 -38
  271. package/build/src/statements/translate.d.ts +2 -2
  272. package/build/src/statements/translate.js +39 -39
  273. package/build/src/statements/update_database.d.ts +14 -14
  274. package/build/src/statements/update_database.js +53 -53
  275. package/build/src/statements/write.d.ts +17 -17
  276. package/build/src/statements/write.js +56 -56
  277. package/build/src/template_formatting.d.ts +14 -14
  278. package/build/src/template_formatting.js +82 -82
  279. package/build/src/throw_error.d.ts +1 -1
  280. package/build/src/throw_error.js +14 -14
  281. package/build/src/types/_abstract_type_data.d.ts +5 -5
  282. package/build/src/types/_abstract_type_data.js +2 -2
  283. package/build/src/types/_character.d.ts +11 -11
  284. package/build/src/types/_character.js +2 -2
  285. package/build/src/types/_date_helper.d.ts +2 -2
  286. package/build/src/types/_date_helper.js +40 -40
  287. package/build/src/types/_numeric.d.ts +5 -5
  288. package/build/src/types/_numeric.js +2 -2
  289. package/build/src/types/abap_object.d.ts +11 -11
  290. package/build/src/types/abap_object.js +32 -32
  291. package/build/src/types/character.d.ts +26 -26
  292. package/build/src/types/character.js +111 -111
  293. package/build/src/types/data_reference.d.ts +28 -28
  294. package/build/src/types/data_reference.js +88 -88
  295. package/build/src/types/date.d.ts +20 -20
  296. package/build/src/types/date.js +66 -66
  297. package/build/src/types/decfloat34.d.ts +11 -11
  298. package/build/src/types/decfloat34.js +45 -45
  299. package/build/src/types/field_symbol.d.ts +32 -32
  300. package/build/src/types/field_symbol.js +115 -115
  301. package/build/src/types/float.d.ts +15 -15
  302. package/build/src/types/float.js +74 -74
  303. package/build/src/types/hex.d.ts +20 -20
  304. package/build/src/types/hex.js +81 -81
  305. package/build/src/types/index.d.ts +17 -17
  306. package/build/src/types/index.js +33 -33
  307. package/build/src/types/integer.d.ts +15 -15
  308. package/build/src/types/integer.js +56 -56
  309. package/build/src/types/numc.d.ts +21 -21
  310. package/build/src/types/numc.js +48 -48
  311. package/build/src/types/packed.d.ts +19 -19
  312. package/build/src/types/packed.js +53 -53
  313. package/build/src/types/string.d.ts +19 -19
  314. package/build/src/types/string.js +86 -86
  315. package/build/src/types/structure.d.ts +23 -23
  316. package/build/src/types/structure.js +113 -113
  317. package/build/src/types/table.d.ts +55 -55
  318. package/build/src/types/table.js +220 -220
  319. package/build/src/types/time.d.ts +20 -20
  320. package/build/src/types/time.js +67 -67
  321. package/build/src/types/utc_long.d.ts +18 -18
  322. package/build/src/types/utc_long.js +26 -26
  323. package/build/src/types/xstring.d.ts +18 -18
  324. package/build/src/types/xstring.js +70 -70
  325. package/build/src/unit_test.d.ts +26 -26
  326. package/build/src/unit_test.js +75 -75
  327. package/package.json +2 -2
@@ -1,55 +1,55 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ABAP = exports.DB = exports.types = exports.RFC = exports.UnitTestResult = void 0;
4
- const console_1 = require("./console");
5
- const context_1 = require("./context");
6
- const offset_length_1 = require("./offset_length");
7
- const statements_1 = require("./statements");
8
- const template_formatting_1 = require("./template_formatting");
9
- const unit_test_1 = require("./unit_test");
10
- Object.defineProperty(exports, "UnitTestResult", { enumerable: true, get: function () { return unit_test_1.UnitTestResult; } });
11
- const builtin = require("./builtin");
12
- const compare = require("./compare");
13
- const DB = require("./db/db");
14
- exports.DB = DB;
15
- const operators = require("./operators");
16
- const RFC = require("./rfc");
17
- exports.RFC = RFC;
18
- const types = require("./types");
19
- exports.types = types;
20
- const expand_in_1 = require("./expand_in");
21
- const expand_dynamic_1 = require("./expand_dynamic");
22
- const classic_error_1 = require("./classic_error");
23
- class ABAP {
24
- constructor() {
25
- // global objects
26
- this.FunctionModules = {};
27
- this.Classes = {};
28
- this.Interfaces = {};
29
- this.DDIC = {};
30
- this.TypePools = {};
31
- this.SMIM = {};
32
- this.W3MI = {};
33
- this.types = types;
34
- this.builtin = builtin;
35
- this.operators = operators;
36
- this.compare = compare;
37
- this.OffsetLength = offset_length_1.OffsetLength;
38
- this.templateFormatting = template_formatting_1.templateFormatting;
39
- this.expandIN = expand_in_1.expandIN;
40
- this.expandDynamic = expand_dynamic_1.expandDynamic;
41
- this.ClassicError = classic_error_1.ClassicError;
42
- this.context = new context_1.Context();
43
- this.console = new console_1.Console();
44
- this.context.console = this.console;
45
- this.statements = new statements_1.Statements(this.context);
46
- // todo, this should not be a singleton, it should be part of this instance
47
- // todo, move to context
48
- builtin.sy.get().subrc.set(0);
49
- builtin.sy.get().tabix.set(0);
50
- builtin.sy.get().index.set(0);
51
- this.statements.getTime({ sy: builtin.sy });
52
- }
53
- }
54
- exports.ABAP = ABAP;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ABAP = exports.DB = exports.types = exports.RFC = exports.UnitTestResult = void 0;
4
+ const console_1 = require("./console");
5
+ const context_1 = require("./context");
6
+ const offset_length_1 = require("./offset_length");
7
+ const statements_1 = require("./statements");
8
+ const template_formatting_1 = require("./template_formatting");
9
+ const unit_test_1 = require("./unit_test");
10
+ Object.defineProperty(exports, "UnitTestResult", { enumerable: true, get: function () { return unit_test_1.UnitTestResult; } });
11
+ const builtin = require("./builtin");
12
+ const compare = require("./compare");
13
+ const DB = require("./db/db");
14
+ exports.DB = DB;
15
+ const operators = require("./operators");
16
+ const RFC = require("./rfc");
17
+ exports.RFC = RFC;
18
+ const types = require("./types");
19
+ exports.types = types;
20
+ const expand_in_1 = require("./expand_in");
21
+ const expand_dynamic_1 = require("./expand_dynamic");
22
+ const classic_error_1 = require("./classic_error");
23
+ class ABAP {
24
+ constructor() {
25
+ // global objects
26
+ this.FunctionModules = {};
27
+ this.Classes = {};
28
+ this.Interfaces = {};
29
+ this.DDIC = {};
30
+ this.TypePools = {};
31
+ this.SMIM = {};
32
+ this.W3MI = {};
33
+ this.types = types;
34
+ this.builtin = builtin;
35
+ this.operators = operators;
36
+ this.compare = compare;
37
+ this.OffsetLength = offset_length_1.OffsetLength;
38
+ this.templateFormatting = template_formatting_1.templateFormatting;
39
+ this.expandIN = expand_in_1.expandIN;
40
+ this.expandDynamic = expand_dynamic_1.expandDynamic;
41
+ this.ClassicError = classic_error_1.ClassicError;
42
+ this.context = new context_1.Context();
43
+ this.console = new console_1.Console();
44
+ this.context.console = this.console;
45
+ this.statements = new statements_1.Statements(this.context);
46
+ // todo, this should not be a singleton, it should be part of this instance
47
+ // todo, move to context
48
+ builtin.sy.get().subrc.set(0);
49
+ builtin.sy.get().tabix.set(0);
50
+ builtin.sy.get().index.set(0);
51
+ this.statements.getTime({ sy: builtin.sy });
52
+ }
53
+ }
54
+ exports.ABAP = ABAP;
55
55
  //# sourceMappingURL=index.js.map
@@ -1,16 +1,16 @@
1
- import { Character, Hex, Structure, XString } from "./types";
2
- import { ICharacter } from "./types/_character";
3
- import { INumeric } from "./types/_numeric";
4
- export interface IOffsetLengthOptions {
5
- length?: INumeric | number;
6
- offset?: INumeric | number;
7
- }
8
- export declare class OffsetLength {
9
- private readonly obj;
10
- private readonly offset?;
11
- private readonly length?;
12
- private readonly isHex;
13
- constructor(obj: ICharacter | Character | Hex | XString | Structure, options: IOffsetLengthOptions);
14
- get(): string;
15
- set(value: ICharacter | string): void;
16
- }
1
+ import { Character, Hex, Structure, XString } from "./types";
2
+ import { ICharacter } from "./types/_character";
3
+ import { INumeric } from "./types/_numeric";
4
+ export interface IOffsetLengthOptions {
5
+ length?: INumeric | number;
6
+ offset?: INumeric | number;
7
+ }
8
+ export declare class OffsetLength {
9
+ private readonly obj;
10
+ private readonly offset?;
11
+ private readonly length?;
12
+ private readonly isHex;
13
+ constructor(obj: ICharacter | Character | Hex | XString | Structure, options: IOffsetLengthOptions);
14
+ get(): string;
15
+ set(value: ICharacter | string): void;
16
+ }
@@ -1,79 +1,79 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OffsetLength = void 0;
4
- const types_1 = require("./types");
5
- class OffsetLength {
6
- constructor(obj, options) {
7
- this.obj = obj;
8
- this.isHex = obj instanceof types_1.Hex || obj instanceof types_1.XString;
9
- if (options.offset) {
10
- if (typeof options.offset === "number") {
11
- this.offset = options.offset;
12
- }
13
- else {
14
- this.offset = options.offset.get();
15
- }
16
- if (this.isHex) {
17
- this.offset *= 2;
18
- }
19
- }
20
- if (options.length) {
21
- if (typeof options.length === "number") {
22
- this.length = options.length;
23
- }
24
- else {
25
- this.length = options.length.get();
26
- }
27
- if (this.isHex) {
28
- this.length *= 2;
29
- }
30
- }
31
- }
32
- get() {
33
- return this.obj.getOffset({ offset: this.offset, length: this.length }).get();
34
- }
35
- set(value) {
36
- let val = "";
37
- if (typeof value === "string") {
38
- val = value;
39
- }
40
- else if (typeof value === "number") {
41
- val = value + "";
42
- }
43
- else if (value instanceof types_1.Integer) {
44
- val = value.get() + "";
45
- if (this.isHex) {
46
- val = Number(val).toString(16);
47
- }
48
- }
49
- else {
50
- val = value.get() + "";
51
- }
52
- let old = this.obj instanceof types_1.Structure ? this.obj.getCharacter() : this.obj.get();
53
- if (this.obj instanceof types_1.Character) {
54
- old = old.padEnd(this.obj.getLength(), " ");
55
- }
56
- if (this.length) {
57
- val = val.substr(0, this.length);
58
- if (this.isHex || this.obj instanceof types_1.Time) {
59
- val = val.padStart(this.length, "0");
60
- }
61
- }
62
- if (this.length && this.offset) {
63
- old = old.substr(0, this.offset) + val + old.substr(this.offset + this.length);
64
- }
65
- else if (this.length) {
66
- old = val + old.substr(this.length);
67
- }
68
- else if (this.offset) {
69
- old = old.substr(0, this.offset) + val;
70
- }
71
- old = old.trimEnd();
72
- if (this.obj instanceof types_1.Character) {
73
- old = old.padEnd(this.obj.getLength(), " ");
74
- }
75
- this.obj.set(old);
76
- }
77
- }
78
- exports.OffsetLength = OffsetLength;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OffsetLength = void 0;
4
+ const types_1 = require("./types");
5
+ class OffsetLength {
6
+ constructor(obj, options) {
7
+ this.obj = obj;
8
+ this.isHex = obj instanceof types_1.Hex || obj instanceof types_1.XString;
9
+ if (options.offset) {
10
+ if (typeof options.offset === "number") {
11
+ this.offset = options.offset;
12
+ }
13
+ else {
14
+ this.offset = options.offset.get();
15
+ }
16
+ if (this.isHex) {
17
+ this.offset *= 2;
18
+ }
19
+ }
20
+ if (options.length) {
21
+ if (typeof options.length === "number") {
22
+ this.length = options.length;
23
+ }
24
+ else {
25
+ this.length = options.length.get();
26
+ }
27
+ if (this.isHex) {
28
+ this.length *= 2;
29
+ }
30
+ }
31
+ }
32
+ get() {
33
+ return this.obj.getOffset({ offset: this.offset, length: this.length }).get();
34
+ }
35
+ set(value) {
36
+ let val = "";
37
+ if (typeof value === "string") {
38
+ val = value;
39
+ }
40
+ else if (typeof value === "number") {
41
+ val = value + "";
42
+ }
43
+ else if (value instanceof types_1.Integer) {
44
+ val = value.get() + "";
45
+ if (this.isHex) {
46
+ val = Number(val).toString(16);
47
+ }
48
+ }
49
+ else {
50
+ val = value.get() + "";
51
+ }
52
+ let old = this.obj instanceof types_1.Structure ? this.obj.getCharacter() : this.obj.get();
53
+ if (this.obj instanceof types_1.Character) {
54
+ old = old.padEnd(this.obj.getLength(), " ");
55
+ }
56
+ if (this.length) {
57
+ val = val.substr(0, this.length);
58
+ if (this.isHex || this.obj instanceof types_1.Time) {
59
+ val = val.padStart(this.length, "0");
60
+ }
61
+ }
62
+ if (this.length && this.offset) {
63
+ old = old.substr(0, this.offset) + val + old.substr(this.offset + this.length);
64
+ }
65
+ else if (this.length) {
66
+ old = val + old.substr(this.length);
67
+ }
68
+ else if (this.offset) {
69
+ old = old.substr(0, this.offset) + val;
70
+ }
71
+ old = old.trimEnd();
72
+ if (this.obj instanceof types_1.Character) {
73
+ old = old.padEnd(this.obj.getLength(), " ");
74
+ }
75
+ this.obj.set(old);
76
+ }
77
+ }
78
+ exports.OffsetLength = OffsetLength;
79
79
  //# sourceMappingURL=offset_length.js.map
@@ -1,6 +1,6 @@
1
- import { XString } from "../types";
2
- export declare function get_bit_operation_chunks(left: XString, right: XString): {
3
- leftChunk: number;
4
- rightChunk: number;
5
- chunkLen: number;
6
- }[];
1
+ import { XString } from "../types";
2
+ export declare function get_bit_operation_chunks(left: XString, right: XString): {
3
+ leftChunk: number;
4
+ rightChunk: number;
5
+ chunkLen: number;
6
+ }[];
@@ -1,30 +1,30 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.get_bit_operation_chunks = void 0;
4
- function get_bit_operation_chunks(left, right) {
5
- const ret = [];
6
- let leftFull = left.get();
7
- const leftLen = leftFull.length;
8
- leftFull = leftFull.padEnd(Math.ceil(leftLen / 2) * 2, "0");
9
- let rightFull = right.get();
10
- const rightLen = rightFull.length;
11
- rightFull = rightFull.padEnd(Math.ceil(rightLen / 2) * 2, "0");
12
- const maxLen = leftFull.length > rightFull.length ? leftFull.length : rightFull.length;
13
- // Using 3-byte chunkgs (6 hex positions) to avoid JavaScript negative values for extreme cases
14
- const chunks = maxLen / 6;
15
- for (let pass = chunks; pass > 0; pass--) {
16
- const chunkStart = maxLen - pass * 6;
17
- const chunkEnd = maxLen - (pass - 1) * 6;
18
- let leftSlice = leftFull.slice(chunkStart, chunkEnd);
19
- let rightSlice = rightFull.slice(chunkStart, chunkEnd);
20
- const chunkLen = leftSlice.length > rightSlice.length ? leftSlice.length : rightSlice.length;
21
- leftSlice = leftSlice.padEnd(chunkLen, "0");
22
- rightSlice = rightSlice.padEnd(chunkLen, "0");
23
- const leftChunk = parseInt(leftSlice, 16);
24
- const rightChunk = parseInt(rightSlice, 16);
25
- ret.push({ leftChunk: leftChunk, rightChunk: rightChunk, chunkLen: chunkLen });
26
- }
27
- return ret;
28
- }
29
- exports.get_bit_operation_chunks = get_bit_operation_chunks;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.get_bit_operation_chunks = void 0;
4
+ function get_bit_operation_chunks(left, right) {
5
+ const ret = [];
6
+ let leftFull = left.get();
7
+ const leftLen = leftFull.length;
8
+ leftFull = leftFull.padEnd(Math.ceil(leftLen / 2) * 2, "0");
9
+ let rightFull = right.get();
10
+ const rightLen = rightFull.length;
11
+ rightFull = rightFull.padEnd(Math.ceil(rightLen / 2) * 2, "0");
12
+ const maxLen = leftFull.length > rightFull.length ? leftFull.length : rightFull.length;
13
+ // Using 3-byte chunkgs (6 hex positions) to avoid JavaScript negative values for extreme cases
14
+ const chunks = maxLen / 6;
15
+ for (let pass = chunks; pass > 0; pass--) {
16
+ const chunkStart = maxLen - pass * 6;
17
+ const chunkEnd = maxLen - (pass - 1) * 6;
18
+ let leftSlice = leftFull.slice(chunkStart, chunkEnd);
19
+ let rightSlice = rightFull.slice(chunkStart, chunkEnd);
20
+ const chunkLen = leftSlice.length > rightSlice.length ? leftSlice.length : rightSlice.length;
21
+ leftSlice = leftSlice.padEnd(chunkLen, "0");
22
+ rightSlice = rightSlice.padEnd(chunkLen, "0");
23
+ const leftChunk = parseInt(leftSlice, 16);
24
+ const rightChunk = parseInt(rightSlice, 16);
25
+ ret.push({ leftChunk: leftChunk, rightChunk: rightChunk, chunkLen: chunkLen });
26
+ }
27
+ return ret;
28
+ }
29
+ exports.get_bit_operation_chunks = get_bit_operation_chunks;
30
30
  //# sourceMappingURL=_bit_operations.js.map
@@ -1,4 +1,4 @@
1
- import { Float, Integer } from "../types";
2
- import { ICharacter } from "../types/_character";
3
- import { INumeric } from "../types/_numeric";
4
- export declare function parse(val: INumeric | ICharacter | string | number | Float | Integer): number;
1
+ import { Float, Integer } from "../types";
2
+ import { ICharacter } from "../types/_character";
3
+ import { INumeric } from "../types/_numeric";
4
+ export declare function parse(val: INumeric | ICharacter | string | number | Float | Integer): number;
@@ -1,46 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parse = void 0;
4
- const types_1 = require("../types");
5
- const xstring_1 = require("../types/xstring");
6
- function parse(val) {
7
- if (typeof val === "number") {
8
- return val;
9
- }
10
- else if (typeof val === "string") {
11
- if (val.includes(".")) {
12
- return parseFloat(val);
13
- }
14
- else {
15
- return parseInt(val, 10);
16
- }
17
- }
18
- else if (val instanceof types_1.Float) {
19
- return val.getRaw();
20
- }
21
- else if (val instanceof xstring_1.XString || val instanceof types_1.Hex) {
22
- if (val.get() === "") {
23
- return 0;
24
- }
25
- let num = parseInt(val.get(), 16);
26
- // handle two complement,
27
- if (val instanceof types_1.Hex && val.getLength() >= 4) {
28
- const maxVal = Math.pow(2, val.get().length / 2 * 8);
29
- if (num > maxVal / 2 - 1) {
30
- num = num - maxVal;
31
- }
32
- }
33
- return num;
34
- }
35
- else if (val instanceof types_1.Time || val instanceof types_1.Date) {
36
- return val.getNumeric();
37
- }
38
- else if (val instanceof types_1.DecFloat34) {
39
- return val.getRaw();
40
- }
41
- else {
42
- return parse(val.get());
43
- }
44
- }
45
- exports.parse = parse;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parse = void 0;
4
+ const types_1 = require("../types");
5
+ const xstring_1 = require("../types/xstring");
6
+ function parse(val) {
7
+ if (typeof val === "number") {
8
+ return val;
9
+ }
10
+ else if (typeof val === "string") {
11
+ if (val.includes(".")) {
12
+ return parseFloat(val);
13
+ }
14
+ else {
15
+ return parseInt(val, 10);
16
+ }
17
+ }
18
+ else if (val instanceof types_1.Float) {
19
+ return val.getRaw();
20
+ }
21
+ else if (val instanceof xstring_1.XString || val instanceof types_1.Hex) {
22
+ if (val.get() === "") {
23
+ return 0;
24
+ }
25
+ let num = parseInt(val.get(), 16);
26
+ // handle two complement,
27
+ if (val instanceof types_1.Hex && val.getLength() >= 4) {
28
+ const maxVal = Math.pow(2, val.get().length / 2 * 8);
29
+ if (num > maxVal / 2 - 1) {
30
+ num = num - maxVal;
31
+ }
32
+ }
33
+ return num;
34
+ }
35
+ else if (val instanceof types_1.Time || val instanceof types_1.Date) {
36
+ return val.getNumeric();
37
+ }
38
+ else if (val instanceof types_1.DecFloat34) {
39
+ return val.getRaw();
40
+ }
41
+ else {
42
+ return parse(val.get());
43
+ }
44
+ }
45
+ exports.parse = parse;
46
46
  //# sourceMappingURL=_parse.js.map
@@ -1,4 +1,4 @@
1
- import { FieldSymbol, Float, Hex, Integer } from "../types";
2
- import { ICharacter } from "../types/_character";
3
- import { INumeric } from "../types/_numeric";
4
- export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol, right: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol): Integer | Float;
1
+ import { FieldSymbol, Float, Hex, Integer } from "../types";
2
+ import { ICharacter } from "../types/_character";
3
+ import { INumeric } from "../types/_numeric";
4
+ export declare function add(left: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol, right: INumeric | ICharacter | string | number | Float | Integer | Hex | FieldSymbol): Integer | Float;
@@ -1,43 +1,43 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.add = void 0;
4
- const types_1 = require("../types");
5
- const string_1 = require("../types/string");
6
- const _parse_1 = require("./_parse");
7
- function add(left, right) {
8
- if (left instanceof types_1.FieldSymbol) {
9
- if (left.getPointer() === undefined) {
10
- throw new Error("GETWA_NOT_ASSIGNED");
11
- }
12
- return add(left.getPointer(), right);
13
- }
14
- if (right instanceof types_1.FieldSymbol) {
15
- if (right.getPointer() === undefined) {
16
- throw new Error("GETWA_NOT_ASSIGNED");
17
- }
18
- return add(left, right.getPointer());
19
- }
20
- if (left instanceof types_1.Integer && right instanceof types_1.Integer) {
21
- return new types_1.Integer().set(left.get() + right.get());
22
- }
23
- else if (typeof left === "number" && typeof right === "number"
24
- && Number.isInteger(left) && Number.isInteger(right)) {
25
- return new types_1.Integer().set(left + right);
26
- }
27
- else if (typeof left === "number" && Number.isInteger(left) && right instanceof types_1.Integer) {
28
- return new types_1.Integer().set(left + right.get());
29
- }
30
- else if (typeof right === "number" && Number.isInteger(right) && left instanceof types_1.Integer) {
31
- return new types_1.Integer().set(left.get() + right);
32
- }
33
- else if ((left instanceof string_1.String || left instanceof types_1.Character) && Number.isInteger(Number(left.get())) && right instanceof types_1.Integer) {
34
- return new types_1.Integer().set(Number.parseInt(left.get(), 10) + right.get());
35
- }
36
- else if ((right instanceof string_1.String || right instanceof types_1.Character) && Number.isInteger(Number(right)) && left instanceof types_1.Integer) {
37
- return new types_1.Integer().set(left.get() + Number.parseInt(right.get(), 10));
38
- }
39
- const ret = new types_1.Float().set((0, _parse_1.parse)(left) + (0, _parse_1.parse)(right));
40
- return ret;
41
- }
42
- exports.add = add;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.add = void 0;
4
+ const types_1 = require("../types");
5
+ const string_1 = require("../types/string");
6
+ const _parse_1 = require("./_parse");
7
+ function add(left, right) {
8
+ if (left instanceof types_1.FieldSymbol) {
9
+ if (left.getPointer() === undefined) {
10
+ throw new Error("GETWA_NOT_ASSIGNED");
11
+ }
12
+ return add(left.getPointer(), right);
13
+ }
14
+ if (right instanceof types_1.FieldSymbol) {
15
+ if (right.getPointer() === undefined) {
16
+ throw new Error("GETWA_NOT_ASSIGNED");
17
+ }
18
+ return add(left, right.getPointer());
19
+ }
20
+ if (left instanceof types_1.Integer && right instanceof types_1.Integer) {
21
+ return new types_1.Integer().set(left.get() + right.get());
22
+ }
23
+ else if (typeof left === "number" && typeof right === "number"
24
+ && Number.isInteger(left) && Number.isInteger(right)) {
25
+ return new types_1.Integer().set(left + right);
26
+ }
27
+ else if (typeof left === "number" && Number.isInteger(left) && right instanceof types_1.Integer) {
28
+ return new types_1.Integer().set(left + right.get());
29
+ }
30
+ else if (typeof right === "number" && Number.isInteger(right) && left instanceof types_1.Integer) {
31
+ return new types_1.Integer().set(left.get() + right);
32
+ }
33
+ else if ((left instanceof string_1.String || left instanceof types_1.Character) && Number.isInteger(Number(left.get())) && right instanceof types_1.Integer) {
34
+ return new types_1.Integer().set(Number.parseInt(left.get(), 10) + right.get());
35
+ }
36
+ else if ((right instanceof string_1.String || right instanceof types_1.Character) && Number.isInteger(Number(right)) && left instanceof types_1.Integer) {
37
+ return new types_1.Integer().set(left.get() + Number.parseInt(right.get(), 10));
38
+ }
39
+ const ret = new types_1.Float().set((0, _parse_1.parse)(left) + (0, _parse_1.parse)(right));
40
+ return ret;
41
+ }
42
+ exports.add = add;
43
43
  //# sourceMappingURL=add.js.map
@@ -1,2 +1,2 @@
1
- import { XString } from "../types";
2
- export declare function bitand(left: XString, right: XString): XString;
1
+ import { XString } from "../types";
2
+ export declare function bitand(left: XString, right: XString): XString;
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bitand = void 0;
4
- /*eslint no-bitwise: ["error", { "allow": ["&"] }] */
5
- const types_1 = require("../types");
6
- const _bit_operations_1 = require("./_bit_operations");
7
- function bitand(left, right) {
8
- let and = "";
9
- const chunks = (0, _bit_operations_1.get_bit_operation_chunks)(left, right);
10
- // eslint-disable-next-line no-cond-assign
11
- for (let i = 0, chunk; chunk = chunks[i]; i++) {
12
- and = and + (chunk.leftChunk & chunk.rightChunk).toString(16).toUpperCase().padStart(chunk.chunkLen, "0");
13
- }
14
- const ret = new types_1.XString();
15
- ret.set(and);
16
- return ret;
17
- }
18
- exports.bitand = bitand;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.bitand = void 0;
4
+ /*eslint no-bitwise: ["error", { "allow": ["&"] }] */
5
+ const types_1 = require("../types");
6
+ const _bit_operations_1 = require("./_bit_operations");
7
+ function bitand(left, right) {
8
+ let and = "";
9
+ const chunks = (0, _bit_operations_1.get_bit_operation_chunks)(left, right);
10
+ // eslint-disable-next-line no-cond-assign
11
+ for (let i = 0, chunk; chunk = chunks[i]; i++) {
12
+ and = and + (chunk.leftChunk & chunk.rightChunk).toString(16).toUpperCase().padStart(chunk.chunkLen, "0");
13
+ }
14
+ const ret = new types_1.XString();
15
+ ret.set(and);
16
+ return ret;
17
+ }
18
+ exports.bitand = bitand;
19
19
  //# sourceMappingURL=bit-and.js.map
@@ -1,2 +1,2 @@
1
- import { Hex, XString } from "../types";
2
- export declare function bitnot(right: XString | Hex): Hex;
1
+ import { Hex, XString } from "../types";
2
+ export declare function bitnot(right: XString | Hex): Hex;