Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 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 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 | 1x 1x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 1x 1x 1x 1x 1x 1x 1x 1x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 4x 4x 2x 2x 4x 4x 3x 3x 3x 4x 4x 4x 2x 2x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 7x 3x 3x 7x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 7x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 7x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 32x 32x 9x 4x 4x 9x 5x 5x 4x 4x 5x 5x 9x 28x 32x 20x 9x 9x 20x 8x 8x 20x 3x 32x 8x 6x 5x 8x 2x 8x 32x 10x 7x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 6x 6x 6x 6x 6x 6x 6x 6x 4x 4x 4x 4x 6x 4x 4x 6x 3x 3x 3x 3x 3x 6x 2x 7x 8x 8x 7x 8x 8x 8x 8x 8x 8x 8x 7x 18x 18x 7x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 25x 2x 23x 25x 2x 21x 25x 1x 20x 20x 20x 20x 25x 7x 7x 1x 1x 1x 1x 7x 7x 7x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 3x 1x 7x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // zcl_abapgit_po_file.clas.abap class zcl_abapgit_po_file { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'ZCL_ABAPGIT_PO_FILE'; static IMPLEMENTED_INTERFACES = ["ZIF_ABAPGIT_I18N_FILE"]; static ATTRIBUTES = {"MV_LANG": {"type": () => {return new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_SUPPRESS_COMMENTS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MT_PAIRS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["SOURCE"]},"secondary":[]}, "");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "C_COMMENT": {"type": () => {return new abap.types.Structure({ "translator": new abap.types.Integer({qualifiedName: "I"}), "extracted": new abap.types.Integer({qualifiedName: "I"}), "reference": new abap.types.Integer({qualifiedName: "I"}), "flag": new abap.types.Integer({qualifiedName: "I"}), "previous": new abap.types.Integer({qualifiedName: "I"})}, undefined, undefined, {}, {});}, "visibility": "I", "is_constant": "X", "is_class": "X"}}; static METHODS = {"BUILD_PO_BODY": {"visibility": "I", "parameters": {"RO_BUF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"});}, "is_optional": " "}}}, "BUILD_PO_HEAD": {"visibility": "I", "parameters": {"RO_BUF": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"});}, "is_optional": " "}}}, "PARSE_PO": {"visibility": "I", "parameters": {"IV_DATA": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "GET_COMMENT_MARKER": {"visibility": "I", "parameters": {"RV_MARKER": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_COMMENT_KIND": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "QUOTE": {"visibility": "I", "parameters": {"RV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "UNQUOTE": {"visibility": "I", "parameters": {"RV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}, "CONSTRUCTOR": {"visibility": "U", "parameters": {"IV_LANG": {"type": () => {return new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"});}, "is_optional": " "}, "IV_SUPPRESS_COMMENTS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "PARSE": {"visibility": "U", "parameters": {"IV_XDATA": {"type": () => {return new abap.types.XString({qualifiedName: "XSTRING"});}, "is_optional": " "}}}, "PUSH_TEXT_PAIRS": {"visibility": "U", "parameters": {"IV_OBJTYPE": {"type": () => {return new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"});}, "is_optional": " "}, "IV_OBJNAME": {"type": () => {return new abap.types.Character(70, {"qualifiedName":"LXEOBJNAME","ddicName":"LXEOBJNAME","description":"LXEOBJNAME"});}, "is_optional": " "}, "IT_TEXT_PAIRS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "textkey": new abap.types.Character(32, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-textkey"}), "s_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-s_text"}), "t_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-t_text"}), "unitmlt": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIR-UNITMLT"}), "uppcase": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-uppcase"}), "texttype": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-texttype"})}, "zif_abapgit_lxe_texts=>ty_text_pair", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_lxe_texts=>ty_text_pairs");}, "is_optional": " "}}}}; #mv_lang; #mv_suppress_comments; #mt_pairs; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "build_po_body": this.#build_po_body.bind(this), "build_po_head": this.#build_po_head.bind(this), "parse_po": this.#parse_po.bind(this), "parse": this.parse.bind(this), "push_text_pairs": this.push_text_pairs.bind(this), }; this.#mv_lang = new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}); this.FRIENDS_ACCESS_INSTANCE["mv_lang"] = this.#mv_lang; this.#mv_suppress_comments = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.FRIENDS_ACCESS_INSTANCE["mv_suppress_comments"] = this.#mv_suppress_comments; this.#mt_pairs = abap.types.TableFactory.construct(new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"SORTED","isUnique":true,"keyFields":["SOURCE"]},"secondary":[]}, ""); this.FRIENDS_ACCESS_INSTANCE["mt_pairs"] = this.#mt_pairs; this.c_comment = zcl_abapgit_po_file.c_comment; } async #build_po_body() { let ro_buf = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"}); let fs_ls_pair_ = new abap.types.FieldSymbol(new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {})); let fs_ls_comment_ = new abap.types.FieldSymbol(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {})); ro_buf.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_BUFFER']()).constructor_()); for await (const unique429 of abap.statements.loop(this.#mt_pairs)) { fs_ls_pair_.assign(unique429); if (abap.compare.ne(abap.builtin.sy.get().tabix, abap.IntegerFactory.get(1))) { await ro_buf.get().add({iv_str: abap.CharacterFactory.get(1, '')}); } abap.statements.sort(fs_ls_pair_.get().comments,{by: [{component: "kind"}]}); for await (const unique430 of abap.statements.loop(fs_ls_pair_.get().comments)) { fs_ls_comment_.assign(unique430); await ro_buf.get().add({iv_str: new abap.types.String().set(`#${abap.templateFormatting((await this.get_comment_marker({iv_comment_kind: fs_ls_comment_.get().kind})))} ${abap.templateFormatting(fs_ls_comment_.get().text)}`)}); } await ro_buf.get().add({iv_str: new abap.types.String().set(`msgid ${abap.templateFormatting((await this.quote({iv_text: fs_ls_pair_.get().source})))}`)}); await ro_buf.get().add({iv_str: new abap.types.String().set(`msgstr ${abap.templateFormatting((await this.quote({iv_text: fs_ls_pair_.get().target})))}`)}); } return ro_buf; } async #build_po_head() { let ro_buf = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_BUFFER", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_BUFFER"}); ro_buf.set(await (new abap.Classes['ZCL_ABAPGIT_STRING_BUFFER']()).constructor_()); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(8, '#, fuzzy')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(8, 'msgid ""')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(9, 'msgstr ""')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(21, '"MIME-Version: 1.0\\n"')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(43, '"Content-Type: text/plain; charset=UTF-8\\n"')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(35, '"Content-Transfer-Encoding: 8bit\\n"')}); await ro_buf.get().add({iv_str: abap.CharacterFactory.get(1, '')}); return ro_buf; } async constructor_(INPUT) { let iv_lang = INPUT?.iv_lang; if (iv_lang?.getQualifiedName === undefined || iv_lang.getQualifiedName() !== "LAISO") { iv_lang = undefined; } if (iv_lang === undefined) { iv_lang = new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}).set(INPUT.iv_lang); } let iv_suppress_comments = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.iv_suppress_comments) {iv_suppress_comments.set(INPUT.iv_suppress_comments);} if (INPUT === undefined || INPUT.iv_suppress_comments === undefined) {iv_suppress_comments = abap.builtin.abap_false;} this.#mv_lang.set(abap.builtin.to_lower({val: iv_lang})); this.#mv_suppress_comments.set(iv_suppress_comments); return this; } async get_comment_marker(INPUT) { return zcl_abapgit_po_file.get_comment_marker(INPUT); } static async get_comment_marker(INPUT) { let rv_marker = new abap.types.String({qualifiedName: "STRING"}); let iv_comment_kind = INPUT?.iv_comment_kind; if (iv_comment_kind?.getQualifiedName === undefined || iv_comment_kind.getQualifiedName() !== "I") { iv_comment_kind = undefined; } if (iv_comment_kind === undefined) { iv_comment_kind = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.iv_comment_kind); } let unique431 = iv_comment_kind; if (abap.compare.eq(unique431, zcl_abapgit_po_file.c_comment.get().translator)) { rv_marker.set(abap.CharacterFactory.get(1, '')); } else if (abap.compare.eq(unique431, zcl_abapgit_po_file.c_comment.get().extracted)) { rv_marker.set(abap.CharacterFactory.get(1, '.')); } else if (abap.compare.eq(unique431, zcl_abapgit_po_file.c_comment.get().reference)) { rv_marker.set(abap.CharacterFactory.get(1, ':')); } else if (abap.compare.eq(unique431, zcl_abapgit_po_file.c_comment.get().flag)) { rv_marker.set(abap.CharacterFactory.get(1, ',')); } else if (abap.compare.eq(unique431, zcl_abapgit_po_file.c_comment.get().previous)) { rv_marker.set(abap.CharacterFactory.get(1, '|')); } return rv_marker; } async parse(INPUT) { let iv_xdata = INPUT?.iv_xdata; if (iv_xdata?.getQualifiedName === undefined || iv_xdata.getQualifiedName() !== "XSTRING") { iv_xdata = undefined; } if (iv_xdata === undefined) { iv_xdata = new abap.types.XString({qualifiedName: "XSTRING"}).set(INPUT.iv_xdata); } let lv_xdata = new abap.types.XString({qualifiedName: "XSTRING"}); let lv_data = new abap.types.String({qualifiedName: "STRING"}); if (abap.compare.gt(abap.builtin.xstrlen({val: iv_xdata}), abap.IntegerFactory.get(3)) && abap.compare.eq(iv_xdata.getOffset({length: 3}), abap.Classes['CL_ABAP_CHAR_UTILITIES'].byte_order_mark_utf8)) { lv_xdata.set(iv_xdata.getOffset({offset: 3})); } else { lv_xdata.set(iv_xdata); } lv_data.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].xstring_to_string_utf8({iv_data: lv_xdata}))); await this.#parse_po({iv_data: lv_data}); } async #parse_po(INPUT) { let iv_data = INPUT?.iv_data; if (iv_data?.getQualifiedName === undefined || iv_data.getQualifiedName() !== "STRING") { iv_data = undefined; } if (iv_data === undefined) { iv_data = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_data); } let c_state = new abap.types.Structure({ "wait_id": new abap.types.Integer({qualifiedName: "I"}), "wait_str": new abap.types.Integer({qualifiedName: "I"}), "wait_eos": new abap.types.Integer({qualifiedName: "I"})}, undefined, undefined, {}, {}); c_state.get().wait_id.set(abap.IntegerFactory.get(0)); c_state.get().wait_str.set(abap.IntegerFactory.get(1)); c_state.get().wait_eos.set(abap.IntegerFactory.get(2)); let lv_state = new abap.types.Integer({qualifiedName: "I"}); lv_state.set(c_state.get().wait_id); let lt_lines = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE"); let ls_pair = new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {}); let lv_whitespace = new abap.types.Character(2, {}); let fs_lv_i_ = new abap.types.FieldSymbol(new abap.types.String({qualifiedName: "STRING"})); lv_whitespace.set(abap.operators.concat(new abap.types.String().set(` `),abap.Classes['CL_ABAP_CHAR_UTILITIES'].horizontal_tab)); abap.statements.split({source: iv_data, at: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, table: lt_lines}); abap.statements.append({source: abap.CharacterFactory.get(1, ''), target: lt_lines}); for await (const unique432 of abap.statements.loop(lt_lines)) { fs_lv_i_.assign(unique432); if (abap.compare.eq(lv_state, c_state.get().wait_eos)) { if (abap.compare.ge(abap.builtin.strlen({val: fs_lv_i_}), abap.IntegerFactory.get(1)) && abap.compare.eq(fs_lv_i_.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '"'))) { ls_pair.get().target.set(abap.operators.concat(ls_pair.get().target,(await this.unquote({iv_text: fs_lv_i_})))); continue; } else { lv_state.set(c_state.get().wait_id); if (abap.compare.initial(ls_pair.get().source) === false) { abap.statements.insertInternal({data: ls_pair, table: this.#mt_pairs}); } ls_pair.clear(); } } let unique433 = lv_state; if (abap.compare.eq(unique433, c_state.get().wait_id)) { if (abap.compare.initial(fs_lv_i_) || abap.compare.eq(fs_lv_i_.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '#')) || abap.compare.co(fs_lv_i_, lv_whitespace)) { continue; } if (abap.compare.ge(abap.builtin.strlen({val: fs_lv_i_}), abap.IntegerFactory.get(6)) && abap.compare.eq(fs_lv_i_.getOffset({offset: 0, length: 6}), new abap.types.String().set(`msgid `))) { ls_pair.get().source.set((await this.unquote({iv_text: abap.builtin.substring({val: fs_lv_i_, off: abap.IntegerFactory.get(6)})}))); lv_state.set(c_state.get().wait_str); } else { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(36, 'PO file format error: expected msgid')}); } } else if (abap.compare.eq(unique433, c_state.get().wait_str)) { if (abap.compare.ge(abap.builtin.strlen({val: fs_lv_i_}), abap.IntegerFactory.get(7)) && abap.compare.eq(fs_lv_i_.getOffset({offset: 0, length: 7}), new abap.types.String().set(`msgstr `))) { ls_pair.get().target.set((await this.unquote({iv_text: abap.builtin.substring({val: fs_lv_i_, off: abap.IntegerFactory.get(7)})}))); lv_state.set(c_state.get().wait_eos); } else { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(37, 'PO file format error: expected msgstr')}); } } } } async push_text_pairs(INPUT) { let iv_objtype = INPUT?.iv_objtype; if (iv_objtype?.getQualifiedName === undefined || iv_objtype.getQualifiedName() !== "TROBJTYPE") { iv_objtype = undefined; } if (iv_objtype === undefined) { iv_objtype = new abap.types.Character(4, {"qualifiedName":"TROBJTYPE","ddicName":"TROBJTYPE","description":"TROBJTYPE"}).set(INPUT.iv_objtype); } let iv_objname = INPUT?.iv_objname; if (iv_objname?.getQualifiedName === undefined || iv_objname.getQualifiedName() !== "LXEOBJNAME") { iv_objname = undefined; } if (iv_objname === undefined) { iv_objname = new abap.types.Character(70, {"qualifiedName":"LXEOBJNAME","ddicName":"LXEOBJNAME","description":"LXEOBJNAME"}).set(INPUT.iv_objname); } let it_text_pairs = INPUT?.it_text_pairs; if (it_text_pairs?.getQualifiedName === undefined || it_text_pairs.getQualifiedName() !== "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIRS") { it_text_pairs = undefined; } if (it_text_pairs === undefined) { it_text_pairs = abap.types.TableFactory.construct(new abap.types.Structure({ "textkey": new abap.types.Character(32, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-textkey"}), "s_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-s_text"}), "t_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-t_text"}), "unitmlt": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIR-UNITMLT"}), "uppcase": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-uppcase"}), "texttype": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-texttype"})}, "zif_abapgit_lxe_texts=>ty_text_pair", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_lxe_texts=>ty_text_pairs").set(INPUT.it_text_pairs); } let ls_out = new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {}); let fs_ls_in_ = new abap.types.FieldSymbol(new abap.types.Structure({ "textkey": new abap.types.Character(32, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-textkey"}), "s_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-s_text"}), "t_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-t_text"}), "unitmlt": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIR-UNITMLT"}), "uppcase": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-uppcase"}), "texttype": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-texttype"})}, "zif_abapgit_lxe_texts=>ty_text_pair", undefined, {}, {})); let fs_ls_out_ = new abap.types.FieldSymbol(new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {})); let ls_comment = new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}); for await (const unique434 of abap.statements.loop(it_text_pairs)) { fs_ls_in_.assign(unique434); if (!(abap.compare.initial(fs_ls_in_.get().s_text) === false)) { continue; } abap.statements.readTable(this.#mt_pairs,{assigning: fs_ls_out_, withKey: (i) => {return abap.compare.eq(i.source, fs_ls_in_.get().s_text);}, withKeyValue: [{key: (i) => {return i.source}, value: fs_ls_in_.get().s_text}], usesTableLine: false, withKeySimple: {"source": fs_ls_in_.get().s_text}}); if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { ls_out.get().source.set(fs_ls_in_.get().s_text); abap.statements.insertInternal({data: ls_out, assigning: fs_ls_out_, table: this.#mt_pairs}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } if (abap.compare.initial(fs_ls_out_.get().target)) { fs_ls_out_.get().target.set(fs_ls_in_.get().t_text); } if (abap.compare.eq(this.#mv_suppress_comments, abap.builtin.abap_false)) { ls_comment.get().kind.set(zcl_abapgit_po_file.c_comment.get().reference); ls_comment.get().text.set(abap.operators.concat(abap.builtin.condense({val: new abap.types.String().set(`${abap.templateFormatting(iv_objtype)}/${abap.templateFormatting(iv_objname)}/${abap.templateFormatting(fs_ls_in_.get().textkey)}`)}),new abap.types.String().set(`, maxlen=${abap.templateFormatting(fs_ls_in_.get().unitmlt)}`))); abap.statements.append({source: ls_comment, target: fs_ls_out_.get().comments}); abap.statements.assert(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))); } } } async quote(INPUT) { return zcl_abapgit_po_file.quote(INPUT); } static async quote(INPUT) { let rv_text = new abap.types.String({qualifiedName: "STRING"}); let iv_text = INPUT?.iv_text; if (iv_text?.getQualifiedName === undefined || iv_text.getQualifiedName() !== "STRING") { iv_text = undefined; } if (iv_text === undefined) { iv_text = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_text); } rv_text.set(abap.operators.concat(abap.CharacterFactory.get(1, '"'),abap.operators.concat(abap.builtin.replace({val: iv_text, sub: abap.CharacterFactory.get(1, '"'), with: abap.CharacterFactory.get(2, '\\"'), occ: abap.IntegerFactory.get(0)}),abap.CharacterFactory.get(1, '"')))); return rv_text; } async unquote(INPUT) { return zcl_abapgit_po_file.unquote(INPUT); } static async unquote(INPUT) { let rv_text = new abap.types.String({qualifiedName: "STRING"}); let iv_text = INPUT?.iv_text; if (iv_text?.getQualifiedName === undefined || iv_text.getQualifiedName() !== "STRING") { iv_text = undefined; } if (iv_text === undefined) { iv_text = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_text); } let lv_len = new abap.types.Integer({qualifiedName: "I"}); let lv_prev_char = new abap.types.Integer({qualifiedName: "I"}); rv_text.set(iv_text); abap.statements.shift(rv_text, {direction: 'RIGHT',deletingTrailing: abap.builtin.space}); abap.statements.shift(rv_text, {direction: 'LEFT',deletingLeading: abap.builtin.space}); lv_len.set(abap.builtin.strlen({val: rv_text})); if (abap.compare.lt(lv_len, abap.IntegerFactory.get(2))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(33, 'PO file format error: bad quoting')}); } lv_prev_char.set(abap.operators.minus(lv_len,abap.IntegerFactory.get(1))); if (abap.compare.ne(rv_text.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '"')) || abap.compare.ne(rv_text.getOffset({offset: lv_prev_char, length: 1}), abap.CharacterFactory.get(1, '"'))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(33, 'PO file format error: bad quoting')}); } lv_prev_char.set(abap.operators.minus(lv_prev_char,abap.IntegerFactory.get(1))); if (abap.compare.ge(lv_len, abap.IntegerFactory.get(3)) && abap.compare.eq(rv_text.getOffset({offset: lv_prev_char, length: 1}), abap.CharacterFactory.get(1, '\\'))) { await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: abap.CharacterFactory.get(33, 'PO file format error: bad quoting')}); } rv_text.set(abap.builtin.substring({val: rv_text, off: abap.IntegerFactory.get(1), len: abap.operators.minus(lv_len,abap.IntegerFactory.get(2))})); rv_text.set(abap.builtin.replace({val: rv_text, sub: abap.CharacterFactory.get(2, '\\"'), with: abap.CharacterFactory.get(1, '"'), occ: abap.IntegerFactory.get(0)})); rv_text.set(abap.builtin.replace({val: rv_text, sub: abap.CharacterFactory.get(2, '\\n'), with: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, occ: abap.IntegerFactory.get(0)})); return rv_text; } async zif_abapgit_i18n_file$ext() { let rv_ext = new abap.types.String({qualifiedName: "STRING"}); rv_ext.set(abap.CharacterFactory.get(2, 'po')); return rv_ext; } async zif_abapgit_i18n_file$lang() { let rv_lang = new abap.types.Character(2, {"qualifiedName":"LAISO","ddicName":"LAISO","description":"LAISO"}); rv_lang.set(this.#mv_lang); return rv_lang; } async zif_abapgit_i18n_file$lang_suffix() { let rv_lang_suffix = new abap.types.String({qualifiedName: "STRING"}); rv_lang_suffix.set(this.#mv_lang); return rv_lang_suffix; } async zif_abapgit_i18n_file$render() { let rv_data = new abap.types.XString({qualifiedName: "XSTRING"}); let lv_str = new abap.types.String({qualifiedName: "STRING"}); lv_str.set((await (await this.#build_po_body()).get().join_w_newline_and_flush())); if (abap.compare.initial(lv_str) === false) { lv_str.set(abap.operators.concat((await (await this.#build_po_head()).get().join_w_newline_and_flush()),abap.operators.concat(abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline,abap.operators.concat(lv_str,abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline)))); rv_data.set((await abap.Classes['ZCL_ABAPGIT_CONVERT'].string_to_xstring_utf8({iv_string: lv_str}))); } return rv_data; } async zif_abapgit_i18n_file$translate(INPUT) { let cv_changed = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); if (INPUT && INPUT.cv_changed) {cv_changed = INPUT.cv_changed;} let ct_text_pairs = abap.types.TableFactory.construct(new abap.types.Structure({ "textkey": new abap.types.Character(32, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-textkey"}), "s_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-s_text"}), "t_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-t_text"}), "unitmlt": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIR-UNITMLT"}), "uppcase": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-uppcase"}), "texttype": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-texttype"})}, "zif_abapgit_lxe_texts=>ty_text_pair", undefined, {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":[]},"secondary":[]}, "zif_abapgit_lxe_texts=>ty_text_pairs"); if (INPUT && INPUT.ct_text_pairs) {ct_text_pairs = INPUT.ct_text_pairs;} let fs_ls_lxe_ = new abap.types.FieldSymbol(new abap.types.Structure({ "textkey": new abap.types.Character(32, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-textkey"}), "s_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-s_text"}), "t_text": new abap.types.Character(255, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-t_text"}), "unitmlt": new abap.types.Integer({qualifiedName: "ZIF_ABAPGIT_LXE_TEXTS=>TY_TEXT_PAIR-UNITMLT"}), "uppcase": new abap.types.Character(4, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-uppcase"}), "texttype": new abap.types.Character(1, {"qualifiedName":"zif_abapgit_lxe_texts=>ty_text_pair-texttype"})}, "zif_abapgit_lxe_texts=>ty_text_pair", undefined, {}, {})); let fs_ls_tr_ = new abap.types.FieldSymbol(new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {})); let lv_idx = new abap.types.Integer({qualifiedName: "I"}); for await (const unique435 of abap.statements.loop(ct_text_pairs)) { fs_ls_lxe_.assign(unique435); if (!(abap.compare.initial(fs_ls_lxe_.get().s_text) === false)) { continue; } lv_idx.set(abap.builtin.sy.get().tabix); abap.statements.readTable(this.#mt_pairs,{assigning: fs_ls_tr_, withKey: (i) => {return abap.compare.eq(i.source, fs_ls_lxe_.get().s_text);}, withKeyValue: [{key: (i) => {return i.source}, value: fs_ls_lxe_.get().s_text}], usesTableLine: false, withKeySimple: {"source": fs_ls_lxe_.get().s_text}}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)) && abap.compare.initial(fs_ls_tr_.get().target) === false) { if (abap.compare.ne(fs_ls_lxe_.get().t_text, fs_ls_tr_.get().target)) { cv_changed.set(abap.builtin.abap_true); fs_ls_lxe_.get().t_text.set(fs_ls_tr_.get().target); } } else { await abap.statements.deleteInternal(ct_text_pairs,{index: lv_idx}); cv_changed.set(abap.builtin.abap_true); } } } } abap.Classes['ZCL_ABAPGIT_PO_FILE'] = zcl_abapgit_po_file; zcl_abapgit_po_file.c_comment = new abap.types.Structure({ "translator": new abap.types.Integer({qualifiedName: "I"}), "extracted": new abap.types.Integer({qualifiedName: "I"}), "reference": new abap.types.Integer({qualifiedName: "I"}), "flag": new abap.types.Integer({qualifiedName: "I"}), "previous": new abap.types.Integer({qualifiedName: "I"})}, undefined, undefined, {}, {}); zcl_abapgit_po_file.c_comment.get().translator.set(1); zcl_abapgit_po_file.c_comment.get().extracted.set(2); zcl_abapgit_po_file.c_comment.get().reference.set(3); zcl_abapgit_po_file.c_comment.get().flag.set(4); zcl_abapgit_po_file.c_comment.get().previous.set(5); zcl_abapgit_po_file.ty_comment = new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}); zcl_abapgit_po_file.ty_msg_pair = new abap.types.Structure({ "source": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-SOURCE"}), "target": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_MSG_PAIR-TARGET"}), "comments": abap.types.TableFactory.construct(new abap.types.Structure({ "kind": new abap.types.Integer({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-KIND"}), "text": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_PO_FILE=>TY_COMMENT-TEXT"})}, "zcl_abapgit_po_file=>ty_comment", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["KIND","TEXT"]},"secondary":[]}, "zcl_abapgit_po_file=>ty_msg_pair-comments")}, "zcl_abapgit_po_file=>ty_msg_pair", undefined, {}, {}); export {zcl_abapgit_po_file}; |