UNPKG

@abaplint/core

Version:
25 lines 1.74 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Replace = void 0; const combi_1 = require("../combi"); const expressions_1 = require("../expressions"); class Replace { getMatcher() { const length = (0, combi_1.seq)("LENGTH", expressions_1.Source); const offset = (0, combi_1.seq)("OFFSET", expressions_1.Source); const section = (0, combi_1.seq)((0, combi_1.opt)("IN"), "SECTION", (0, combi_1.per)(offset, length), "OF", expressions_1.Target); const source = (0, combi_1.seq)((0, combi_1.opt)("OF"), expressions_1.FindType, expressions_1.Source); const cas = (0, combi_1.altPrio)("IGNORING CASE", "RESPECTING CASE"); const repl = (0, combi_1.seq)("REPLACEMENT COUNT", expressions_1.Target); const replo = (0, combi_1.seq)("REPLACEMENT OFFSET", expressions_1.Target); const repll = (0, combi_1.seq)("REPLACEMENT LENGTH", expressions_1.Target); const repli = (0, combi_1.seq)("REPLACEMENT LINE", expressions_1.Target); const occ = (0, combi_1.altPrio)("ALL OCCURRENCES", "ALL OCCURENCES", "FIRST OCCURENCE", "FIRST OCCURRENCE"); const mode = (0, combi_1.alt)("IN CHARACTER MODE", "IN BYTE MODE"); const wit = (0, combi_1.seq)("WITH", expressions_1.Source); const into = (0, combi_1.seq)("INTO", expressions_1.Target); return (0, combi_1.seq)("REPLACE", (0, combi_1.per)(section, (0, combi_1.seq)((0, combi_1.opt)(occ), source)), (0, combi_1.opt)((0, combi_1.seq)("IN", (0, combi_1.opt)("TABLE"), expressions_1.Target)), (0, combi_1.opt)((0, combi_1.per)(wit, into, cas, mode, repl, replo, repll, repli, length))); } } exports.Replace = Replace; //# sourceMappingURL=replace.js.map