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 | 1x 1x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 1x 1x 1x 1x 1x 1x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 142x 125x 142x 17x 17x 142x 142x 142x 142x 142x 10x 10x 10x 10x 10x 142x 122x 122x 122x 122x 122x 122x 122x 122x 122x 122x 142x 33x 33x 33x 33x 33x 33x 142x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 40x 142x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 142x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 142x 1x 1x | const {cx_root} = await import("./cx_root.clas.mjs"); // cl_abap_matcher.clas.abap class cl_abap_matcher { static INTERNAL_TYPE = 'CLAS'; static INTERNAL_NAME = 'CL_ABAP_MATCHER'; static IMPLEMENTED_INTERFACES = []; static ATTRIBUTES = {"MT_MATCHES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "MATCH_RESULT_TAB");}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_TEXT": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}, "MV_PATTERN": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": " "}}; static METHODS = {"CONSTRUCTOR": {"visibility": "U", "parameters": {"PATTERN": {"type": () => {return new abap.types.Character();}, "is_optional": " "}, "IGNORE_CASE": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}, "TEXT": {"type": () => {return new abap.types.Character();}, "is_optional": " "}}}, "FIND_ALL": {"visibility": "U", "parameters": {"RT_MATCHES": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "MATCH_RESULT_TAB");}, "is_optional": " "}}}, "FIND_NEXT": {"visibility": "U", "parameters": {"FOUND": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "GET_SUBMATCH": {"visibility": "U", "parameters": {"MATCH": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "GET_OFFSET": {"visibility": "U", "parameters": {"OFFSET": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}, "MATCH": {"visibility": "U", "parameters": {"SUCCESS": {"type": () => {return new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"});}, "is_optional": " "}}}, "GET_LENGTH": {"visibility": "U", "parameters": {"LENGTH": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}}}; #mt_matches; #mv_index; #mv_text; #mv_pattern; constructor() { this.me = new abap.types.ABAPObject(); this.me.set(this); this.INTERNAL_ID = abap.internalIdCounter++; this.FRIENDS_ACCESS_INSTANCE = { "find_all": this.find_all.bind(this), "find_next": this.find_next.bind(this), "get_submatch": this.get_submatch.bind(this), "get_offset": this.get_offset.bind(this), "match": this.match.bind(this), "get_length": this.get_length.bind(this), }; this.#mt_matches = abap.types.TableFactory.construct(new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "MATCH_RESULT_TAB"); this.FRIENDS_ACCESS_INSTANCE["mt_matches"] = this.#mt_matches; this.#mv_index = new abap.types.Integer({qualifiedName: "I"}); this.FRIENDS_ACCESS_INSTANCE["mv_index"] = this.#mv_index; this.#mv_text = new abap.types.String({qualifiedName: "STRING"}); this.FRIENDS_ACCESS_INSTANCE["mv_text"] = this.#mv_text; this.#mv_pattern = new abap.types.String({qualifiedName: "STRING"}); this.FRIENDS_ACCESS_INSTANCE["mv_pattern"] = this.#mv_pattern; } async constructor_(INPUT) { let pattern = INPUT?.pattern; let ignore_case = INPUT?.ignore_case; if (ignore_case?.getQualifiedName === undefined || ignore_case.getQualifiedName() !== "ABAP_BOOL") { ignore_case = undefined; } if (ignore_case === undefined) { ignore_case = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}).set(INPUT.ignore_case); } let text = INPUT?.text; if (abap.compare.eq(ignore_case, abap.builtin.abap_true)) { abap.statements.find(text, {regex: pattern, first: false, ignoringCase: true, results: this.#mt_matches}); } else { abap.statements.find(text, {regex: pattern, first: false, results: this.#mt_matches}); } this.#mv_pattern.set(pattern); this.#mv_text.set(text); return this; } async match() { let success = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); abap.statements.find(this.#mv_text, {regex: new abap.types.String().set(`^${abap.templateFormatting(this.#mv_pattern)}$`), first: false}); success.set(abap.builtin.boolc(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)))); return success; } async find_all() { let rt_matches = abap.types.TableFactory.construct(new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "MATCH_RESULT_TAB"); rt_matches.set(this.#mt_matches); return rt_matches; } async find_next() { let found = new abap.types.Character(1, {"qualifiedName":"ABAP_BOOL","ddicName":"ABAP_BOOL"}); this.#mv_index.set(abap.operators.add(this.#mv_index,abap.IntegerFactory.get(1))); abap.statements.readTable(this.#mt_matches,{index: this.#mv_index}); found.set(abap.builtin.boolc(abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0)))); return found; } async get_submatch(INPUT) { let match = new abap.types.String({qualifiedName: "STRING"}); let index = INPUT?.index; if (index?.getQualifiedName === undefined || index.getQualifiedName() !== "I") { index = undefined; } if (index === undefined) { index = new abap.types.Integer({qualifiedName: "I"}).set(INPUT.index); } let ls_match = new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}); let ls_submatch = new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}); abap.statements.readTable(this.#mt_matches,{index: this.#mv_index, into: ls_match}); abap.statements.readTable(ls_match.get().submatches,{index: index, into: ls_submatch}); if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) { match.set(this.#mv_text.getOffset({offset: ls_submatch.get().offset, length: ls_submatch.get().length})); } return match; } async get_offset() { let offset = new abap.types.Integer({qualifiedName: "I"}); let ls_match = new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}); abap.statements.readTable(this.#mt_matches,{index: this.#mv_index, into: ls_match}); offset.set(ls_match.get().offset); return offset; } async get_length() { let length = new abap.types.Integer({qualifiedName: "I"}); let ls_match = new abap.types.Structure({ "line": new abap.types.Integer({qualifiedName: "I"}), "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"}), "submatches": abap.types.TableFactory.construct(new abap.types.Structure({ "offset": new abap.types.Integer({qualifiedName: "I"}), "length": new abap.types.Integer({qualifiedName: "I"})}, "SUBMATCH_RESULT", "SUBMATCH_RESULT", {}, {}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "SUBMATCH_RESULT_TAB")}, "MATCH_RESULT", "MATCH_RESULT", {}, {}); abap.statements.readTable(this.#mt_matches,{index: this.#mv_index, into: ls_match}); length.set(ls_match.get().length); return length; } } abap.Classes['CL_ABAP_MATCHER'] = cl_abap_matcher; export {cl_abap_matcher}; |