@abaplint/cli 2.85.39 → 2.85.42
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.
- package/README.md +21 -21
- package/abaplint +2 -2
- package/build/cli.js +115 -82
- package/package.json +64 -64
package/build/cli.js
CHANGED
|
@@ -368,7 +368,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
368
368
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
369
369
|
|
|
370
370
|
"use strict";
|
|
371
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;\r\nconst Tokens = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst result_1 = __webpack_require__(/*! ./result */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/result.js\");\r\nclass Regex {\r\n constructor(r) {\r\n this.regexp = r;\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() === 0) {\r\n continue;\r\n }\r\n const token = input.peek();\r\n if (this.regexp.test(token.getStr()) === true) {\r\n result.push(input.shift(new nodes_1.TokenNodeRegex(token)));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal(\\\"\" + this.regexp.source.replace(/\\\\/g, \"\\\\\\\\\") + \"\\\")\";\r\n }\r\n toStr() {\r\n return this.regexp.toString();\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Word {\r\n constructor(s) {\r\n this.s = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [this.s];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().getStr().toUpperCase() === this.s) {\r\n // console.log(\"match, \" + this.s + result.length);\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.s + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"\\\"\" + this.s + \"\\\"\";\r\n }\r\n first() {\r\n return [this.s];\r\n }\r\n}\r\nclass Token {\r\n constructor(s) {\r\n this.name = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().constructor.name.toUpperCase() === this.name) {\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n let text = this.name;\r\n const toke = Tokens;\r\n for (const token in Tokens) {\r\n if (token.toUpperCase() === this.name && toke[token].railroad) {\r\n text = toke[token].railroad();\r\n break;\r\n }\r\n }\r\n return \"Railroad.Terminal('!\\\"\" + text + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"Token \\\"\" + this.name + \"\\\"\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Vers {\r\n constructor(version, runnable, or) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n this.or = or;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n run(r) {\r\n const targetVersion = Combi.getVersion();\r\n if (this.or && targetVersion === this.or) {\r\n return this.runnable.run(r);\r\n }\r\n else if (targetVersion === version_1.Version.OpenABAP) {\r\n if (this.version > version_1.Version.v702) {\r\n return [];\r\n }\r\n else {\r\n return this.runnable.run(r);\r\n }\r\n }\r\n else if (targetVersion >= this.version || targetVersion === version_1.Version.Cloud) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n railroad() {\r\n let text = this.version;\r\n if (this.or) {\r\n text += \" or \" + this.or;\r\n }\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"\" +\r\n text +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"Version(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass VersNot {\r\n constructor(version, runnable) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n run(r) {\r\n if (Combi.getVersion() !== this.version) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n railroad() {\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"not \" +\r\n this.version +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"VersionNot(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass OptionalPriority {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n const res = this.optional.run([input]);\r\n if (res.length > 1) {\r\n result.push(...res);\r\n }\r\n else if (res.length === 0) {\r\n result.push(input);\r\n }\r\n else if (res[0].remainingLength() < input.remainingLength()) {\r\n result.push(...res);\r\n }\r\n else {\r\n result.push(input);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Optional {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n result.push(input);\r\n const res = this.optional.run([input]);\r\n result.push(...res);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Star {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n const result = r;\r\n let res = r;\r\n let input = [];\r\n for (;;) {\r\n input = res;\r\n res = this.sta.run(input);\r\n if (res.length === 0) {\r\n break;\r\n }\r\n result.push(...res);\r\n }\r\n // console.dir(result);\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass StarPrioroity {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n let result = r;\r\n let res = r;\r\n // let input: Result[] = [];\r\n let prev;\r\n for (;;) {\r\n // input = res;\r\n res = this.sta.run(res);\r\n if (res.length === 0) {\r\n if (prev !== undefined) {\r\n // console.log(\"star length: \" + prev.length);\r\n let best = Number.MAX_SAFE_INTEGER;\r\n for (const p of prev) {\r\n if (p.remainingLength() < best) {\r\n result = [p];\r\n best = p.remainingLength();\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n prev = res;\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Plus {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new Star(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass PlusPriority {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new StarPrioroity(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass Sequence {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Sequence, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n let temp = [input];\r\n let match = true;\r\n for (const sequence of this.list) {\r\n temp = sequence.run(temp);\r\n if (temp.length === 0) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n if (match === true) {\r\n result.push(...temp);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Sequence(\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"seq(\" + ret + \")\";\r\n }\r\n first() {\r\n return this.list[0].first();\r\n }\r\n}\r\nclass WordSequence {\r\n constructor(stri) {\r\n this.words = [];\r\n this.stri = stri;\r\n const foo = this.stri.replace(/-/g, \" - \");\r\n const split = foo.split(\" \");\r\n for (const st of split) {\r\n // todo, use Dash token\r\n this.words.push(new Word(st));\r\n }\r\n this.seq = new Sequence(this.words);\r\n }\r\n listKeywords() {\r\n return [this.stri.toString()];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n return this.seq.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.stri + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"str(\" + this.stri + \")\";\r\n }\r\n first() {\r\n return this.words[0].first();\r\n }\r\n}\r\nclass Expression {\r\n constructor() {\r\n this.runnable = undefined;\r\n }\r\n run(r) {\r\n const results = [];\r\n if (this.runnable === undefined) {\r\n this.runnable = this.getRunnable();\r\n }\r\n for (const input of r) {\r\n const temp = this.runnable.run([input]);\r\n for (const t of temp) {\r\n let consumed = input.remainingLength() - t.remainingLength();\r\n if (consumed > 0) {\r\n const originalLength = t.getNodes().length;\r\n const children = [];\r\n while (consumed > 0) {\r\n const sub = t.popNode();\r\n if (sub) {\r\n children.push(sub);\r\n consumed = consumed - sub.countTokens();\r\n }\r\n }\r\n const re = new nodes_1.ExpressionNode(this);\r\n re.setChildren(children.reverse());\r\n const n = t.getNodes().slice(0, originalLength - consumed);\r\n n.push(re);\r\n t.setNodes(n);\r\n }\r\n results.push(t);\r\n }\r\n }\r\n // console.dir(results);\r\n return results;\r\n }\r\n listKeywords() {\r\n // do not recurse, all Expressions are evaluated only on first level\r\n return [];\r\n }\r\n getUsing() {\r\n return [\"expression/\" + this.getName()];\r\n }\r\n getName() {\r\n return this.constructor.name;\r\n }\r\n railroad() {\r\n return \"Railroad.NonTerminal('\" + this.getName() + \"', {href: '#/expression/\" + this.getName() + \"'})\";\r\n }\r\n toStr() {\r\n return \"expression(\" + this.getName() + \")\";\r\n }\r\n first() {\r\n return this.getRunnable().first();\r\n }\r\n}\r\nexports.Expression = Expression;\r\nclass Permutation {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Permutation, length error, got \" + list.length);\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n const copy = this.list.slice();\r\n for (let index = 0; index < this.list.length; index++) {\r\n const temp = this.list[index].run(r);\r\n if (temp.length !== 0) {\r\n // match\r\n result.push(...temp);\r\n const left = copy;\r\n left.splice(index, 1);\r\n if (left.length === 1) {\r\n result.push(...left[0].run(temp));\r\n }\r\n else {\r\n result.push(...new Permutation(left).run(temp));\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.MultipleChoice(0, 'any',\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n const children = this.list.map((e) => { return e.toStr(); });\r\n return \"per(\" + children.join() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Alternative {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n const temp = sequ.run(r);\r\n result.push(...temp);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\n// prioritized alternative, skip others if match found\r\nclass AlternativePriority {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n // console.log(seq.toStr());\r\n const temp = sequ.run(r);\r\n if (temp.length > 0) {\r\n result.push(...temp);\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\nclass Combi {\r\n static railroad(runnable, complex = false) {\r\n // todo, move method to graph.js?\r\n let type = \"Railroad.Diagram(\";\r\n if (complex === true) {\r\n type = \"Railroad.ComplexDiagram(\";\r\n }\r\n const result = \"Railroad.Diagram.INTERNAL_ALIGNMENT = 'left';\\n\" +\r\n type +\r\n runnable.railroad() +\r\n \").toString();\";\r\n return result;\r\n }\r\n static listKeywords(runnable) {\r\n // todo, move these walkers of the syntax tree to some abstraction?\r\n let res = runnable.listKeywords();\r\n // remove duplicates\r\n res = res.filter((x, i, a) => { return a.indexOf(x) === i; });\r\n return res;\r\n }\r\n // assumption: no pragmas supplied in tokens input\r\n static run(runnable, tokens, version) {\r\n this.ver = version;\r\n const input = new result_1.Result(tokens, 0);\r\n const result = runnable.run([input]);\r\n /*\r\n console.log(\"res: \" + result.length);\r\n for (const res of result) {\r\n console.dir(res.getNodes().map(n => n.get().constructor.name));\r\n console.dir(res.getNodes().map(n => n.concatTokens()));\r\n }\r\n */\r\n for (const res of result) {\r\n if (res.remainingLength() === 0) {\r\n return res.getNodes();\r\n }\r\n }\r\n return undefined;\r\n }\r\n static getVersion() {\r\n return this.ver;\r\n }\r\n}\r\nexports.Combi = Combi;\r\n// -----------------------------------------------------------------------------\r\nfunction str(s) {\r\n if (s.indexOf(\" \") > 0 || s.indexOf(\"-\") > 0) {\r\n return new WordSequence(s);\r\n }\r\n else {\r\n return new Word(s);\r\n }\r\n}\r\nexports.str = str;\r\nfunction regex(r) {\r\n return new Regex(r);\r\n}\r\nexports.regex = regex;\r\nfunction tok(t) {\r\n return new Token(t.name);\r\n}\r\nexports.tok = tok;\r\nconst singletons = {};\r\nfunction map(s) {\r\n const type = typeof s;\r\n if (type === \"string\") {\r\n return str(s);\r\n }\r\n else if (type === \"function\") {\r\n // @ts-ignore\r\n const name = s.name;\r\n if (singletons[name] === undefined) {\r\n // @ts-ignore\r\n singletons[name] = new s();\r\n }\r\n return singletons[name];\r\n }\r\n else {\r\n return s;\r\n }\r\n}\r\nfunction seq(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Sequence(list);\r\n}\r\nexports.seq = seq;\r\nfunction alt(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Alternative(list);\r\n}\r\nexports.alt = alt;\r\nfunction altPrio(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new AlternativePriority(list);\r\n}\r\nexports.altPrio = altPrio;\r\nfunction opt(first) {\r\n return new Optional(map(first));\r\n}\r\nexports.opt = opt;\r\nfunction optPrio(first) {\r\n return new OptionalPriority(map(first));\r\n}\r\nexports.optPrio = optPrio;\r\nfunction per(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Permutation(list);\r\n}\r\nexports.per = per;\r\nfunction star(first) {\r\n return new Star(map(first));\r\n}\r\nexports.star = star;\r\nfunction starPrio(first) {\r\n return new StarPrioroity(map(first));\r\n}\r\nexports.starPrio = starPrio;\r\nfunction plus(first) {\r\n return new Plus(map(first));\r\n}\r\nexports.plus = plus;\r\nfunction plusPrio(first) {\r\n return new PlusPriority(map(first));\r\n}\r\nexports.plusPrio = plusPrio;\r\nfunction ver(version, first, or) {\r\n return new Vers(version, map(first), or);\r\n}\r\nexports.ver = ver;\r\nfunction verNot(version, first) {\r\n return new VersNot(version, map(first));\r\n}\r\nexports.verNot = verNot;\r\n//# sourceMappingURL=combi.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js?");
|
|
371
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.fail = exports.verNot = exports.ver = exports.plusPrio = exports.plus = exports.starPrio = exports.star = exports.per = exports.optPrio = exports.opt = exports.altPrio = exports.alt = exports.seq = exports.tok = exports.regex = exports.str = exports.Combi = exports.Expression = void 0;\r\nconst Tokens = __webpack_require__(/*! ../1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst result_1 = __webpack_require__(/*! ./result */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/result.js\");\r\nclass Regex {\r\n constructor(r) {\r\n this.regexp = r;\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() === 0) {\r\n continue;\r\n }\r\n const token = input.peek();\r\n if (this.regexp.test(token.getStr()) === true) {\r\n result.push(input.shift(new nodes_1.TokenNodeRegex(token)));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal(\\\"\" + this.regexp.source.replace(/\\\\/g, \"\\\\\\\\\") + \"\\\")\";\r\n }\r\n toStr() {\r\n return this.regexp.toString();\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Word {\r\n constructor(s) {\r\n this.s = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [this.s];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().getStr().toUpperCase() === this.s) {\r\n // console.log(\"match, \" + this.s + result.length);\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.s + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"\\\"\" + this.s + \"\\\"\";\r\n }\r\n first() {\r\n return [this.s];\r\n }\r\n}\r\nclass Token {\r\n constructor(s) {\r\n this.name = s.toUpperCase();\r\n }\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n if (input.remainingLength() !== 0\r\n && input.peek().constructor.name.toUpperCase() === this.name) {\r\n result.push(input.shift(new nodes_1.TokenNode(input.peek())));\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n let text = this.name;\r\n const toke = Tokens;\r\n for (const token in Tokens) {\r\n if (token.toUpperCase() === this.name && toke[token].railroad) {\r\n text = toke[token].railroad();\r\n break;\r\n }\r\n }\r\n return \"Railroad.Terminal('!\\\"\" + text + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"Token \\\"\" + this.name + \"\\\"\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Vers {\r\n constructor(version, runnable, or) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n this.or = or;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n run(r) {\r\n const targetVersion = Combi.getVersion();\r\n if (this.or && targetVersion === this.or) {\r\n return this.runnable.run(r);\r\n }\r\n else if (targetVersion === version_1.Version.OpenABAP) {\r\n if (this.version > version_1.Version.v702) {\r\n return [];\r\n }\r\n else {\r\n return this.runnable.run(r);\r\n }\r\n }\r\n else if (targetVersion >= this.version || targetVersion === version_1.Version.Cloud) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n railroad() {\r\n let text = this.version;\r\n if (this.or) {\r\n text += \" or \" + this.or;\r\n }\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"\" +\r\n text +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"Version(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass VersNot {\r\n constructor(version, runnable) {\r\n this.version = version;\r\n this.runnable = runnable;\r\n }\r\n listKeywords() {\r\n return this.runnable.listKeywords();\r\n }\r\n getUsing() {\r\n return this.runnable.getUsing();\r\n }\r\n run(r) {\r\n if (Combi.getVersion() !== this.version) {\r\n return this.runnable.run(r);\r\n }\r\n else {\r\n return [];\r\n }\r\n }\r\n railroad() {\r\n return \"Railroad.Sequence(Railroad.Comment(\\\"not \" +\r\n this.version +\r\n \"\\\", {}), \" +\r\n this.runnable.railroad() +\r\n \")\";\r\n }\r\n toStr() {\r\n return \"VersionNot(\" + this.runnable.toStr() + \")\";\r\n }\r\n first() {\r\n return this.runnable.first();\r\n }\r\n}\r\nclass OptionalPriority {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n const res = this.optional.run([input]);\r\n if (res.length > 1) {\r\n result.push(...res);\r\n }\r\n else if (res.length === 0) {\r\n result.push(input);\r\n }\r\n else if (res[0].remainingLength() < input.remainingLength()) {\r\n result.push(...res);\r\n }\r\n else {\r\n result.push(input);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Optional {\r\n constructor(optional) {\r\n this.optional = optional;\r\n }\r\n listKeywords() {\r\n return this.optional.listKeywords();\r\n }\r\n getUsing() {\r\n return this.optional.getUsing();\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n result.push(input);\r\n const res = this.optional.run([input]);\r\n result.push(...res);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.Optional(\" + this.optional.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"opt(\" + this.optional.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Star {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n const result = r;\r\n let res = r;\r\n let input = [];\r\n for (;;) {\r\n input = res;\r\n res = this.sta.run(input);\r\n if (res.length === 0) {\r\n break;\r\n }\r\n result.push(...res);\r\n }\r\n // console.dir(result);\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass StarPrioroity {\r\n constructor(sta) {\r\n this.sta = sta;\r\n }\r\n listKeywords() {\r\n return this.sta.listKeywords();\r\n }\r\n getUsing() {\r\n return this.sta.getUsing();\r\n }\r\n run(r) {\r\n let result = r;\r\n let res = r;\r\n // let input: Result[] = [];\r\n let prev;\r\n for (;;) {\r\n // input = res;\r\n res = this.sta.run(res);\r\n if (res.length === 0) {\r\n if (prev !== undefined) {\r\n // console.log(\"star length: \" + prev.length);\r\n let best = Number.MAX_SAFE_INTEGER;\r\n for (const p of prev) {\r\n if (p.remainingLength() < best) {\r\n result = [p];\r\n best = p.remainingLength();\r\n }\r\n }\r\n }\r\n break;\r\n }\r\n prev = res;\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n return \"Railroad.ZeroOrMore(\" + this.sta.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"star(\" + this.sta.toStr() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass Plus {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new Star(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass PlusPriority {\r\n constructor(plu) {\r\n this.plu = plu;\r\n this.sub = new Sequence([this.plu, new StarPrioroity(this.plu)]);\r\n }\r\n listKeywords() {\r\n return this.plu.listKeywords();\r\n }\r\n getUsing() {\r\n return this.plu.getUsing();\r\n }\r\n run(r) {\r\n return this.sub.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.OneOrMore(\" + this.plu.railroad() + \")\";\r\n }\r\n toStr() {\r\n return \"plus(\" + this.plu.toStr() + \")\";\r\n }\r\n first() {\r\n return this.plu.first();\r\n }\r\n}\r\nclass Sequence {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Sequence, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const input of r) {\r\n let temp = [input];\r\n let match = true;\r\n for (const sequence of this.list) {\r\n temp = sequence.run(temp);\r\n if (temp.length === 0) {\r\n match = false;\r\n break;\r\n }\r\n }\r\n if (match === true) {\r\n result.push(...temp);\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Sequence(\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"seq(\" + ret + \")\";\r\n }\r\n first() {\r\n return this.list[0].first();\r\n }\r\n}\r\nclass WordSequence {\r\n constructor(stri) {\r\n this.words = [];\r\n this.stri = stri;\r\n const foo = this.stri.replace(/-/g, \" - \");\r\n const split = foo.split(\" \");\r\n for (const st of split) {\r\n // todo, use Dash token\r\n this.words.push(new Word(st));\r\n }\r\n this.seq = new Sequence(this.words);\r\n }\r\n listKeywords() {\r\n return [this.stri.toString()];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(r) {\r\n return this.seq.run(r);\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('\\\"\" + this.stri + \"\\\"')\";\r\n }\r\n toStr() {\r\n return \"str(\" + this.stri + \")\";\r\n }\r\n first() {\r\n return this.words[0].first();\r\n }\r\n}\r\nclass Expression {\r\n constructor() {\r\n this.runnable = undefined;\r\n }\r\n run(r) {\r\n const results = [];\r\n if (this.runnable === undefined) {\r\n this.runnable = this.getRunnable();\r\n }\r\n for (const input of r) {\r\n const temp = this.runnable.run([input]);\r\n for (const t of temp) {\r\n let consumed = input.remainingLength() - t.remainingLength();\r\n if (consumed > 0) {\r\n const originalLength = t.getNodes().length;\r\n const children = [];\r\n while (consumed > 0) {\r\n const sub = t.popNode();\r\n if (sub) {\r\n children.push(sub);\r\n consumed = consumed - sub.countTokens();\r\n }\r\n }\r\n const re = new nodes_1.ExpressionNode(this);\r\n re.setChildren(children.reverse());\r\n const n = t.getNodes().slice(0, originalLength - consumed);\r\n n.push(re);\r\n t.setNodes(n);\r\n }\r\n results.push(t);\r\n }\r\n }\r\n // console.dir(results);\r\n return results;\r\n }\r\n listKeywords() {\r\n // do not recurse, all Expressions are evaluated only on first level\r\n return [];\r\n }\r\n getUsing() {\r\n return [\"expression/\" + this.getName()];\r\n }\r\n getName() {\r\n return this.constructor.name;\r\n }\r\n railroad() {\r\n return \"Railroad.NonTerminal('\" + this.getName() + \"', {href: '#/expression/\" + this.getName() + \"'})\";\r\n }\r\n toStr() {\r\n return \"expression(\" + this.getName() + \")\";\r\n }\r\n first() {\r\n return this.getRunnable().first();\r\n }\r\n}\r\nexports.Expression = Expression;\r\nclass Permutation {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Permutation, length error, got \" + list.length);\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n const copy = this.list.slice();\r\n for (let index = 0; index < this.list.length; index++) {\r\n const temp = this.list[index].run(r);\r\n if (temp.length !== 0) {\r\n // match\r\n result.push(...temp);\r\n const left = copy;\r\n left.splice(index, 1);\r\n if (left.length === 1) {\r\n result.push(...left[0].run(temp));\r\n }\r\n else {\r\n result.push(...new Permutation(left).run(temp));\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.MultipleChoice(0, 'any',\" + children.join() + \")\";\r\n }\r\n toStr() {\r\n const children = this.list.map((e) => { return e.toStr(); });\r\n return \"per(\" + children.join() + \")\";\r\n }\r\n first() {\r\n return [\"\"];\r\n }\r\n}\r\nclass FailCombinator extends Error {\r\n}\r\nclass Fail {\r\n listKeywords() {\r\n return [];\r\n }\r\n getUsing() {\r\n return [];\r\n }\r\n run(_r) {\r\n throw new FailCombinator();\r\n }\r\n railroad() {\r\n return \"Railroad.Terminal('!Fail')\";\r\n }\r\n toStr() {\r\n return \"fail()\";\r\n }\r\n first() {\r\n return [];\r\n }\r\n}\r\nclass Alternative {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n const temp = sequ.run(r);\r\n result.push(...temp);\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\n// prioritized alternative, skip others if match found\r\nclass AlternativePriority {\r\n constructor(list) {\r\n if (list.length < 2) {\r\n throw new Error(\"Alternative, length error\");\r\n }\r\n this.list = list;\r\n }\r\n listKeywords() {\r\n const ret = [];\r\n for (const i of this.list) {\r\n ret.push(...i.listKeywords());\r\n }\r\n return ret;\r\n }\r\n getUsing() {\r\n return this.list.reduce((a, c) => { return a.concat(c.getUsing()); }, []);\r\n }\r\n run(r) {\r\n const result = [];\r\n for (const sequ of this.list) {\r\n // console.log(seq.toStr());\r\n const temp = sequ.run(r);\r\n if (temp.length > 0) {\r\n result.push(...temp);\r\n break;\r\n }\r\n }\r\n return result;\r\n }\r\n railroad() {\r\n const children = this.list.map((e) => { return e.railroad(); });\r\n return \"Railroad.Choice(0, \" + children.join() + \")\";\r\n }\r\n toStr() {\r\n let ret = \"\";\r\n for (const i of this.list) {\r\n ret = ret + i.toStr() + \",\";\r\n }\r\n return \"alt(\" + ret + \")\";\r\n }\r\n first() {\r\n if (this.list.length !== 2) {\r\n return [\"\"];\r\n }\r\n const f1 = this.list[0].first();\r\n const f2 = this.list[1].first();\r\n if (f1.length === 1 && f1[0] === \"\") {\r\n return f1;\r\n }\r\n if (f2.length === 1 && f2[0] === \"\") {\r\n return f2;\r\n }\r\n if (f1.length === 1 && f2.length === 1 && f1[0] === f2[0]) {\r\n return f1;\r\n }\r\n f1.push(...f2);\r\n return f1;\r\n }\r\n}\r\nclass Combi {\r\n static railroad(runnable, complex = false) {\r\n // todo, move method to graph.js?\r\n let type = \"Railroad.Diagram(\";\r\n if (complex === true) {\r\n type = \"Railroad.ComplexDiagram(\";\r\n }\r\n const result = \"Railroad.Diagram.INTERNAL_ALIGNMENT = 'left';\\n\" +\r\n type +\r\n runnable.railroad() +\r\n \").toString();\";\r\n return result;\r\n }\r\n static listKeywords(runnable) {\r\n // todo, move these walkers of the syntax tree to some abstraction?\r\n let res = runnable.listKeywords();\r\n // remove duplicates\r\n res = res.filter((x, i, a) => { return a.indexOf(x) === i; });\r\n return res;\r\n }\r\n // assumption: no pragmas supplied in tokens input\r\n static run(runnable, tokens, version) {\r\n this.ver = version;\r\n const input = new result_1.Result(tokens, 0);\r\n try {\r\n const result = runnable.run([input]);\r\n /*\r\n console.log(\"res: \" + result.length);\r\n for (const res of result) {\r\n console.dir(res.getNodes().map(n => n.get().constructor.name));\r\n console.dir(res.getNodes().map(n => n.concatTokens()));\r\n }\r\n */\r\n for (const res of result) {\r\n if (res.remainingLength() === 0) {\r\n return res.getNodes();\r\n }\r\n }\r\n }\r\n catch (err) {\r\n if (err instanceof FailCombinator) {\r\n return undefined;\r\n }\r\n throw err;\r\n }\r\n return undefined;\r\n }\r\n static getVersion() {\r\n return this.ver;\r\n }\r\n}\r\nexports.Combi = Combi;\r\n// -----------------------------------------------------------------------------\r\nfunction str(s) {\r\n if (s.indexOf(\" \") > 0 || s.indexOf(\"-\") > 0) {\r\n return new WordSequence(s);\r\n }\r\n else {\r\n return new Word(s);\r\n }\r\n}\r\nexports.str = str;\r\nfunction regex(r) {\r\n return new Regex(r);\r\n}\r\nexports.regex = regex;\r\nfunction tok(t) {\r\n return new Token(t.name);\r\n}\r\nexports.tok = tok;\r\nconst singletons = {};\r\nfunction map(s) {\r\n const type = typeof s;\r\n if (type === \"string\") {\r\n return str(s);\r\n }\r\n else if (type === \"function\") {\r\n // @ts-ignore\r\n const name = s.name;\r\n if (singletons[name] === undefined) {\r\n // @ts-ignore\r\n singletons[name] = new s();\r\n }\r\n return singletons[name];\r\n }\r\n else {\r\n return s;\r\n }\r\n}\r\nfunction seq(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Sequence(list);\r\n}\r\nexports.seq = seq;\r\nfunction alt(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Alternative(list);\r\n}\r\nexports.alt = alt;\r\nfunction altPrio(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new AlternativePriority(list);\r\n}\r\nexports.altPrio = altPrio;\r\nfunction opt(first) {\r\n return new Optional(map(first));\r\n}\r\nexports.opt = opt;\r\nfunction optPrio(first) {\r\n return new OptionalPriority(map(first));\r\n}\r\nexports.optPrio = optPrio;\r\nfunction per(first, second, ...rest) {\r\n const list = [map(first), map(second)];\r\n list.push(...rest.map(map));\r\n return new Permutation(list);\r\n}\r\nexports.per = per;\r\nfunction star(first) {\r\n return new Star(map(first));\r\n}\r\nexports.star = star;\r\nfunction starPrio(first) {\r\n return new StarPrioroity(map(first));\r\n}\r\nexports.starPrio = starPrio;\r\nfunction plus(first) {\r\n return new Plus(map(first));\r\n}\r\nexports.plus = plus;\r\nfunction plusPrio(first) {\r\n return new PlusPriority(map(first));\r\n}\r\nexports.plusPrio = plusPrio;\r\nfunction ver(version, first, or) {\r\n return new Vers(version, map(first), or);\r\n}\r\nexports.ver = ver;\r\nfunction verNot(version, first) {\r\n return new VersNot(version, map(first));\r\n}\r\nexports.verNot = verNot;\r\nfunction fail() {\r\n return new Fail();\r\n}\r\nexports.fail = fail;\r\n//# sourceMappingURL=combi.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js?");
|
|
372
372
|
|
|
373
373
|
/***/ }),
|
|
374
374
|
|
|
@@ -4185,7 +4185,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4185
4185
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
4186
4186
|
|
|
4187
4187
|
"use strict";
|
|
4188
|
-
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n// do not include statement.ts in this file.\r\n// this file only contains \"real\" statements\r\n// sequence of exports is optimized for parsing and precedence\r\n// see statement.ts for Unknown, Empty, Macro and Comment statements\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./write */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/write.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmethod */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmethod.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_nametab */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_nametab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_select_options */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check_select_options.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break_id */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break_id.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endprovide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endprovide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert_text */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert_text.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./log_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/log_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./window */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/window.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./print_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/print_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./extract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/extract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./perform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/perform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./append */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/append.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clear */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/clear.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./concatenate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/concatenate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddo */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endclass */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endclass.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endtry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endtry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./return */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/return.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwhile */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwhile.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./infotypes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/infotypes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/message.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_table */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endloop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endloop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_local_friends.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fieldsymbol.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./translate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/translate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcase */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcase.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_others.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./continue */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/continue.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./suppress_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/suppress_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/hide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./summary */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/summary.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/position.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./resume */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/resume.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./stop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/stop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./controls */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/controls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_line_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_line_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scroll_list */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scroll_list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_of_program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_of_program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./top_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/top_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/truncate_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_update_task */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_update_task.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcatch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcatch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign_local_copy */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign_local_copy.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_extended_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_extended_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./split */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/split.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./replace */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/replace.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwith */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwith.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./condense */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/condense.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./update_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/update_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddefine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddefine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./find */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/find.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_handler */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_handler.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_left */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_left.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/pack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./communication */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/communication.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_subroutine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_subroutine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reject */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reject.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/private.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./system_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/system_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_language */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_language.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/protected.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nodes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/nodes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./demand */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/demand.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./supply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/supply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fields */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fields.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_cluster.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_margin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_margin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contexts */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/contexts.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endinterface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endinterface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./collect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/collect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ranges */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/ranges.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./events */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./receive */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/receive.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./back */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/back.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tables */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/local.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./describe */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/describe.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./submit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/submit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scan */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scan.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./put */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/put.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endat */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endat.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endselect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endselect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./shift */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/shift.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./transfer */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/transfer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unassign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unassign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./leave */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/leave.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./initialization */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/initialization.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/start_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_blank */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./search */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/search.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectionscreen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectionscreen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endon */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fetch_next_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fetch_next_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reserve */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reserve.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./detail */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/detail.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./editor_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/editor_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectoption */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectoption.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./compute */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/compute.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./multiply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/multiply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./divide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/divide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./format */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/format.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/syntax_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_function */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transformation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_reference */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_reference.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_country */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_country.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pools */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pools.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./wait */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/wait.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./overlay */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/overlay.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_titlebar.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmodule */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmodule.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endfunction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endfunction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./retry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/retry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./authority_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_kernel.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transaction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unpack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unpack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./skip */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/skip.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uline */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/uline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise_event */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise_event.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endexec */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endexec.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js?");
|
|
4188
|
+
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n// do not include statement.ts in this file.\r\n// this file only contains \"real\" statements\r\n// sequence of exports is optimized for parsing and precedence\r\n// see statement.ts for Unknown, Empty, Macro and Comment statements\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./write */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/write.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmethod */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmethod.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_nametab */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_nametab.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check_select_options */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check_select_options.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break_id */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break_id.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endprovide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endprovide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert_text */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert_text.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./log_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/log_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./window */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/window.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_enum_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./print_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/print_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./extract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/extract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sum */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./perform */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/perform.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./append */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/append.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./clear */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/clear.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./concatenate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/concatenate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddo */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddo.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endclass */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endclass.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endtry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endtry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./return */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/return.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwhile */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwhile.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./infotypes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/infotypes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./message */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/message.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_table */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_table.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endloop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endloop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_local_friends.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_deferred.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fieldsymbol.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./translate */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/translate.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcase */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcase.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constant_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/constant_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_others */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_others.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./continue */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/continue.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_badi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_badi.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./suppress_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/suppress_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./hide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/hide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_locale */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_locale.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./commit_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/commit_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback_entities */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback_entities.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./summary */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/summary.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./position */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/position.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./resume */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/resume.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./stop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/stop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./controls */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/controls.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_line_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_line_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scroll_list */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scroll_list.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_of_program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_of_program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./top_of_page */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/top_of_page.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/truncate_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_update_task */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_update_task.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_user_command */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_user_command.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./rollback */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/rollback.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endcatch */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endcatch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./assign_local_copy */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/assign_local_copy.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_extended_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_extended_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./split */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/split.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./new_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/new_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free_object */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free_object.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./replace */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/replace.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with_loop */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with_loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/with.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endwith */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endwith.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./condense */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/condense.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_field_group */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_field_group.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./update_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/update_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_internal */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_internal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enddefine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enddefine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./find */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/find.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/move_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_point */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_point.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_handler */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_handler.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_left */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_left.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./pack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/pack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./communication */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/communication.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_subroutine */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_subroutine.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reject */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reject.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./load_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/load_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/private.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./system_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/system_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_language */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_language.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_dialog */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_dialog.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/protected.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/public.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./nodes */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/nodes.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./demand */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/demand.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./supply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/supply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fields */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fields.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_cluster.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_margin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_margin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_database */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_database.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./contexts */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/contexts.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endinterface */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endinterface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./collect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/collect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./ranges */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/ranges.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./events */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/events.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./receive */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/receive.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./back */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/back.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract_corresponding.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./tables */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/tables.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./local */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/local.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./add */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/add.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./describe */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/describe.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./submit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/submit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./scan */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/scan.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./put */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/put.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endat */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endat.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endselect */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endselect.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./shift */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/shift.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./transfer */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/transfer.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./subtract */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/subtract.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unassign */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unassign.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/open_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./close_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/close_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./leave */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/leave.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition_load */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/class_definition_load.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./initialization */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/initialization.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./start_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/start_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_blank */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_blank.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./export_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/export_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_of_selection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_of_selection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./search */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/search.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./modify_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/modify_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectionscreen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectionscreen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./free */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/free.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endon */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endon.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./fetch_next_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/fetch_next_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./reserve */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/reserve.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./refresh_control */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/refresh_control.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./generate_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/generate_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./detail */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/detail.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./editor_call */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/editor_call.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./break */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/break.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./selectoption */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/selectoption.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./convert */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/convert.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./static */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/static.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./compute */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/compute.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./multiply */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/multiply.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./divide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/divide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./format */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/format.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/syntax_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./aliases */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/aliases.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/method_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_mesh_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_def */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/interface_def.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/at_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./include_type */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/include_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/import_dynpro.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_function */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_function.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_selection_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transformation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_line */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_line.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./read_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/read_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_reference */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_reference.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_report */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_report.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/insert_textpool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_bit */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_bit.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_run_time.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_data */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_country */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_country.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pools */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pools.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./wait */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/wait.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./overlay */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/overlay.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_screen */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_pf_status.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_titlebar.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./program */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/program.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_pool */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/function_pool.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endmodule */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endmodule.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endfunction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endfunction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./retry */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/retry.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./authority_check */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/authority_check.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_parameter.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/get_cursor.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_kernel */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_kernel.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_transaction.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./unpack */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/unpack.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./skip */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/skip.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./uline */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/uline.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/data_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_begin */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_begin.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_end */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/type_end.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./raise_event */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/raise_event.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./create_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/create_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./call_ole */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/call_ole.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./set_property */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/set_property.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_injection */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_test_seam */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./delete_memory */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/delete_memory.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./endexec */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/endexec.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./sort_dataset */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/sort_dataset.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./end_enhancement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/end_enhancement.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js?");
|
|
4189
4189
|
|
|
4190
4190
|
/***/ }),
|
|
4191
4191
|
|
|
@@ -4372,7 +4372,18 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
4372
4372
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4373
4373
|
|
|
4374
4374
|
"use strict";
|
|
4375
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Loop = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst simple_source2_1 = __webpack_require__(/*! ../expressions/simple_source2 */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_source2.js\");\r\nconst loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by.js\");\r\nclass Loop {\r\n getMatcher() {\r\n const where = (0, combi_1.seq)(\"WHERE\", (0, combi_1.alt)(expressions_1.ComponentCond, expressions_1.Dynamic));\r\n const into = (0, combi_1.seq)((0, combi_1.opt)(\"REFERENCE\"), \"INTO\", expressions_1.Target);\r\n const assigning = (0, combi_1.seq)(\"ASSIGNING\", expressions_1.FSTarget);\r\n const group = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"GROUP BY\", loop_group_by_1.LoopGroupBy));\r\n const target = (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.alt)(into, assigning), (0, combi_1.optPrio)(\"CASTING\")), \"TRANSPORTING NO FIELDS\");\r\n const from = (0, combi_1.seq)(\"FROM\", expressions_1.Source);\r\n const to = (0, combi_1.seq)(\"TO\", expressions_1.Source);\r\n const usingKey = (0, combi_1.seq)(\"USING KEY\", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));\r\n const options = (0, combi_1.per)(target, from, to, where, usingKey, group);\r\n const at = (0, combi_1.seq)(\"AT\", (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, \"GROUP\")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));\r\n return (0, combi_1.seq)(\"LOOP\", (0, combi_1.opt)(at));\r\n }\r\n}\r\nexports.Loop = Loop;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js?");
|
|
4375
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Loop = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst simple_source2_1 = __webpack_require__(/*! ../expressions/simple_source2 */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/simple_source2.js\");\r\nconst loop_group_by_1 = __webpack_require__(/*! ../expressions/loop_group_by */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/loop_group_by.js\");\r\nclass Loop {\r\n getMatcher() {\r\n const where = (0, combi_1.seq)(\"WHERE\", (0, combi_1.alt)(expressions_1.ComponentCond, expressions_1.Dynamic));\r\n const into = (0, combi_1.seq)((0, combi_1.opt)(\"REFERENCE\"), \"INTO\", expressions_1.Target);\r\n const assigning = (0, combi_1.seq)(\"ASSIGNING\", expressions_1.FSTarget);\r\n const group = (0, combi_1.ver)(version_1.Version.v740sp08, (0, combi_1.seq)(\"GROUP BY\", loop_group_by_1.LoopGroupBy));\r\n const target = (0, combi_1.alt)((0, combi_1.seq)((0, combi_1.alt)(into, assigning), (0, combi_1.optPrio)(\"CASTING\")), \"TRANSPORTING NO FIELDS\");\r\n const from = (0, combi_1.seq)(\"FROM\", expressions_1.Source);\r\n const to = (0, combi_1.seq)(\"TO\", expressions_1.Source);\r\n const usingKey = (0, combi_1.seq)(\"USING KEY\", (0, combi_1.altPrio)(expressions_1.SimpleName, expressions_1.Dynamic));\r\n const options = (0, combi_1.per)(target, from, to, where, usingKey, group);\r\n const at = (0, combi_1.seq)(\"AT\", (0, combi_1.opt)((0, combi_1.seq)(\"SCREEN\", (0, combi_1.fail)())), (0, combi_1.opt)((0, combi_1.ver)(version_1.Version.v740sp08, \"GROUP\")), (0, combi_1.alt)(simple_source2_1.SimpleSource2, (0, combi_1.ver)(version_1.Version.v740sp02, expressions_1.Source)), (0, combi_1.opt)(options));\r\n return (0, combi_1.seq)(\"LOOP\", (0, combi_1.opt)(at));\r\n }\r\n}\r\nexports.Loop = Loop;\r\n//# sourceMappingURL=loop.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop.js?");
|
|
4376
|
+
|
|
4377
|
+
/***/ }),
|
|
4378
|
+
|
|
4379
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js":
|
|
4380
|
+
/*!**********************************************************************************************!*\
|
|
4381
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js ***!
|
|
4382
|
+
\**********************************************************************************************/
|
|
4383
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
4384
|
+
|
|
4385
|
+
"use strict";
|
|
4386
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LoopAtScreen = void 0;\r\nconst combi_1 = __webpack_require__(/*! ../combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../../../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass LoopAtScreen {\r\n getMatcher() {\r\n const l = (0, combi_1.seq)(\"LOOP AT SCREEN\", (0, combi_1.opt)((0, combi_1.seq)(\"INTO\", expressions_1.Target)));\r\n return (0, combi_1.verNot)(version_1.Version.Cloud, l);\r\n }\r\n}\r\nexports.LoopAtScreen = LoopAtScreen;\r\n//# sourceMappingURL=loop_at_screen.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/2_statements/statements/loop_at_screen.js?");
|
|
4376
4387
|
|
|
4377
4388
|
/***/ }),
|
|
4378
4389
|
|
|
@@ -5945,7 +5956,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
5945
5956
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
5946
5957
|
|
|
5947
5958
|
"use strict";
|
|
5948
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Constants = void 0;\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nclass Constants {\r\n getMatcher() {\r\n return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.ConstantBegin), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sub)(Constants))), (0, _combi_1.sta)(Statements.ConstantEnd));\r\n }\r\n}\r\nexports.Constants = Constants;\r\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/constants.js?");
|
|
5959
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Constants = void 0;\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nclass Constants {\r\n getMatcher() {\r\n return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.ConstantBegin), (0, _combi_1.star)((0, _combi_1.alt)((0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Include), (0, _combi_1.sub)(Constants))), (0, _combi_1.sta)(Statements.ConstantEnd));\r\n }\r\n}\r\nexports.Constants = Constants;\r\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/constants.js?");
|
|
5949
5960
|
|
|
5950
5961
|
/***/ }),
|
|
5951
5962
|
|
|
@@ -6077,7 +6088,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6077
6088
|
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
|
6078
6089
|
|
|
6079
6090
|
"use strict";
|
|
6080
|
-
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./any */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/any.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./body */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/body.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_global */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_global.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_global */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/interface_global.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/method.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./normal */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/private_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/protected_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/public_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./section_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/section_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./statics */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/statics.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/with.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js?");
|
|
6091
|
+
eval("\r\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}));\r\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\r\n};\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n__exportStar(__webpack_require__(/*! ./any */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/any.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./at */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/at.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./body */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/body.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case_type */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/case_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./case */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/case.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch_system_exceptions */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/catch_system_exceptions.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./catch */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/catch.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_data */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_definition */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_definition.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_global */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_global.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/class_implementation.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./cleanup */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/cleanup.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./constants */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/constants.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./data */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/data.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./define */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/define.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./do */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/do.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_mesh */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/type_mesh.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./else */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/else.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./elseif */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/elseif.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/enhancement_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./enhancement */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/enhancement.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./exec_sql */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/exec_sql.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./form */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/form.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./function_module */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/function_module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./if */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/if.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface_global */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/interface_global.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./interface */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/interface.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop_at_screen.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./loop */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./method */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/method.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./module */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/module.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./normal */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./on_change */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/on_change.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./private_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/private_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./protected_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/protected_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./provide */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/provide.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./public_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/public_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./section_section */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/section_section.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./select */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/select.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./statics */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/statics.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_injection */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/test_injection.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./test_seam */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/test_seam.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./try */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/try.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./type_enum */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/type_enum.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/types.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when_type */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/when_type.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./when */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/when.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./while */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/while.js\"), exports);\r\n__exportStar(__webpack_require__(/*! ./with */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/with.js\"), exports);\r\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js?");
|
|
6081
6092
|
|
|
6082
6093
|
/***/ }),
|
|
6083
6094
|
|
|
@@ -6114,6 +6125,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6114
6125
|
|
|
6115
6126
|
/***/ }),
|
|
6116
6127
|
|
|
6128
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop_at_screen.js":
|
|
6129
|
+
/*!**********************************************************************************************!*\
|
|
6130
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop_at_screen.js ***!
|
|
6131
|
+
\**********************************************************************************************/
|
|
6132
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6133
|
+
|
|
6134
|
+
"use strict";
|
|
6135
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LoopAtScreen = void 0;\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nconst _1 = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nclass LoopAtScreen {\r\n getMatcher() {\r\n return (0, _combi_1.beginEnd)((0, _combi_1.sta)(Statements.LoopAtScreen), (0, _combi_1.opt)((0, _combi_1.sub)(_1.Body)), (0, _combi_1.sta)(Statements.EndLoop));\r\n }\r\n}\r\nexports.LoopAtScreen = LoopAtScreen;\r\n//# sourceMappingURL=loop_at_screen.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/loop_at_screen.js?");
|
|
6136
|
+
|
|
6137
|
+
/***/ }),
|
|
6138
|
+
|
|
6117
6139
|
/***/ "./node_modules/@abaplint/core/build/src/abap/3_structures/structures/method.js":
|
|
6118
6140
|
/*!**************************************************************************************!*\
|
|
6119
6141
|
!*** ./node_modules/@abaplint/core/build/src/abap/3_structures/structures/method.js ***!
|
|
@@ -6143,7 +6165,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
6143
6165
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
6144
6166
|
|
|
6145
6167
|
"use strict";
|
|
6146
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Normal = void 0;\r\nconst Structures = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../../2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass Normal {\r\n getMatcher() {\r\n // note that the sequence of alternatives here influences performance\r\n return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level\r\n (0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));\r\n }\r\n}\r\nexports.Normal = Normal;\r\n//# sourceMappingURL=normal.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js?");
|
|
6168
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Normal = void 0;\r\nconst Structures = __webpack_require__(/*! . */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _combi_1 = __webpack_require__(/*! ./_combi */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/_combi.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../../2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass Normal {\r\n getMatcher() {\r\n // note that the sequence of alternatives here influences performance\r\n return (0, _combi_1.alt)((0, _combi_1.sta)(Statements.Move), (0, _combi_1.sta)(Statements.Call), (0, _combi_1.sta)(Statements.Data), (0, _combi_1.sub)(Structures.If), (0, _combi_1.sta)(Statements.Clear), (0, _combi_1.sta)(Statements.FieldSymbol), (0, _combi_1.sta)(Statements.CreateObject), (0, _combi_1.sta)(Statements.CallFunction), (0, _combi_1.sta)(_statement_1.MacroCall), (0, _combi_1.sub)(Structures.LoopAtScreen), (0, _combi_1.sub)(Structures.Loop), (0, _combi_1.sta)(Statements.Append), (0, _combi_1.sub)(Structures.Try), (0, _combi_1.sta)(Statements.ReadTable), (0, _combi_1.sta)(Statements.Assert), (0, _combi_1.sta)(Statements.Return), (0, _combi_1.sta)(Statements.Select), (0, _combi_1.sta)(Statements.Assign), (0, _combi_1.sta)(Statements.InsertInternal), (0, _combi_1.sta)(Statements.DeleteInternal), (0, _combi_1.sta)(Statements.Concatenate), (0, _combi_1.sub)(Structures.Case), (0, _combi_1.sub)(Structures.CaseType), (0, _combi_1.sub)(Structures.Enhancement), (0, _combi_1.sub)(Structures.EnhancementSection), (0, _combi_1.sta)(Statements.AddCorresponding), (0, _combi_1.sta)(Statements.Add), (0, _combi_1.sta)(Statements.AssignLocalCopy), (0, _combi_1.sta)(Statements.AuthorityCheck), (0, _combi_1.sta)(Statements.Back), (0, _combi_1.sta)(Statements.Break), (0, _combi_1.sta)(Statements.BreakId), (0, _combi_1.sta)(Statements.CallDatabase), (0, _combi_1.sta)(Statements.CallDialog), (0, _combi_1.sta)(Statements.CallKernel), (0, _combi_1.sta)(Statements.CallOLE), (0, _combi_1.sta)(Statements.CallScreen), (0, _combi_1.sta)(Statements.ModifyScreen), (0, _combi_1.sta)(Statements.CallSelectionScreen), (0, _combi_1.sta)(Statements.CallTransaction), (0, _combi_1.sta)(Statements.CallTransformation), (0, _combi_1.sta)(Statements.Check), (0, _combi_1.sta)(Statements.ClassDefinitionLoad), (0, _combi_1.sta)(Statements.CloseCursor), (0, _combi_1.sta)(Statements.CloseDataset), (0, _combi_1.sta)(Statements.Collect), (0, _combi_1.sta)(Statements.Commit), (0, _combi_1.sta)(Statements.Communication), (0, _combi_1.sta)(Statements.Compute), (0, _combi_1.sta)(Statements.CallBadi), (0, _combi_1.sta)(Statements.Condense), (0, _combi_1.sta)(Statements.Constant), (0, _combi_1.sta)(Statements.Contexts), (0, _combi_1.sta)(Statements.Continue), (0, _combi_1.sta)(Statements.ConvertText), (0, _combi_1.sta)(Statements.Convert), (0, _combi_1.sta)(Statements.CreateData), (0, _combi_1.sta)(Statements.CreateOLE), (0, _combi_1.sta)(Statements.DeleteCluster), (0, _combi_1.sta)(Statements.DeleteDatabase), (0, _combi_1.sta)(Statements.DeleteDataset), (0, _combi_1.sta)(Statements.DeleteDynpro), (0, _combi_1.sta)(Statements.DeleteMemory), (0, _combi_1.sta)(Statements.DeleteReport), (0, _combi_1.sta)(Statements.DeleteTextpool), (0, _combi_1.sta)(Statements.Demand), (0, _combi_1.sta)(Statements.Describe), (0, _combi_1.sta)(Statements.Detail), (0, _combi_1.sta)(Statements.Divide), (0, _combi_1.sta)(Statements.EditorCall), (0, _combi_1.sta)(Statements.EnhancementPoint), (0, _combi_1.sta)(Statements.Exit), (0, _combi_1.sta)(Statements.ExportDynpro), (0, _combi_1.sta)(Statements.Export), (0, _combi_1.sta)(Statements.Extract), (0, _combi_1.sta)(Statements.FetchNextCursor), (0, _combi_1.sta)(Statements.FieldGroup), (0, _combi_1.sta)(Statements.Fields), (0, _combi_1.sta)(Statements.Find), (0, _combi_1.sta)(Statements.Format), (0, _combi_1.sta)(Statements.FreeMemory), (0, _combi_1.sta)(Statements.FreeObject), (0, _combi_1.sta)(Statements.Free), (0, _combi_1.sta)(Statements.GenerateDynpro), (0, _combi_1.sta)(Statements.GenerateReport), (0, _combi_1.sta)(Statements.GenerateSubroutine), (0, _combi_1.sta)(Statements.GetBadi), (0, _combi_1.sta)(Statements.GetBit), (0, _combi_1.sta)(Statements.GetCursor), (0, _combi_1.sta)(Statements.GetDataset), (0, _combi_1.sta)(Statements.GetLocale), (0, _combi_1.sta)(Statements.GetParameter), (0, _combi_1.sta)(Statements.GetPFStatus), (0, _combi_1.sta)(Statements.GetProperty), (0, _combi_1.sta)(Statements.GetReference), (0, _combi_1.sta)(Statements.GetRunTime), (0, _combi_1.sta)(Statements.GetTime), (0, _combi_1.sta)(Statements.Hide), (0, _combi_1.sta)(Statements.Nodes), (0, _combi_1.sta)(Statements.ImportDynpro), (0, _combi_1.sta)(Statements.ImportNametab), (0, _combi_1.sta)(Statements.MoveCorresponding), (0, _combi_1.sta)(Statements.Import), (0, _combi_1.sta)(Statements.Infotypes), (0, _combi_1.sta)(Statements.Include), // include does not have to be at top level\r\n (0, _combi_1.sta)(Statements.InsertDatabase), (0, _combi_1.sta)(Statements.InsertReport), (0, _combi_1.sta)(Statements.InsertTextpool), (0, _combi_1.sta)(Statements.InsertFieldGroup), (0, _combi_1.sta)(Statements.InterfaceLoad), (0, _combi_1.sta)(Statements.Leave), (0, _combi_1.sta)(Statements.LoadReport), (0, _combi_1.sta)(Statements.Local), (0, _combi_1.sta)(Statements.With), (0, _combi_1.sta)(Statements.LogPoint), (0, _combi_1.sta)(Statements.Message), (0, _combi_1.sta)(Statements.ModifyLine), (0, _combi_1.sta)(Statements.ModifyDatabase), (0, _combi_1.sta)(Statements.ModifyInternal), (0, _combi_1.sta)(Statements.Multiply), (0, _combi_1.sta)(Statements.NewLine), (0, _combi_1.sta)(Statements.NewPage), (0, _combi_1.sta)(Statements.OpenCursor), (0, _combi_1.sta)(Statements.OpenDataset), (0, _combi_1.sta)(Statements.Overlay), (0, _combi_1.sta)(Statements.Pack), (0, _combi_1.sta)(Statements.Perform), (0, _combi_1.sta)(Statements.Position), (0, _combi_1.sta)(Statements.Put), (0, _combi_1.sta)(Statements.PrintControl), (0, _combi_1.sta)(Statements.RaiseEvent), (0, _combi_1.sta)(Statements.Raise), (0, _combi_1.sta)(Statements.Ranges), (0, _combi_1.sta)(Statements.ReadDataset), (0, _combi_1.sta)(Statements.ReadLine), (0, _combi_1.sta)(Statements.ReadReport), (0, _combi_1.sta)(Statements.ReadTextpool), (0, _combi_1.sta)(Statements.Receive), (0, _combi_1.sta)(Statements.RefreshControl), (0, _combi_1.sta)(Statements.Refresh), (0, _combi_1.sta)(Statements.Reject), (0, _combi_1.sta)(Statements.Replace), (0, _combi_1.sta)(Statements.Reserve), (0, _combi_1.sta)(Statements.Resume), (0, _combi_1.sta)(Statements.Retry), (0, _combi_1.sta)(Statements.Rollback), (0, _combi_1.sta)(Statements.Scan), (0, _combi_1.sta)(Statements.ScrollList), (0, _combi_1.sta)(Statements.Search), (0, _combi_1.sta)(Statements.SetBit), (0, _combi_1.sta)(Statements.SetBlank), (0, _combi_1.sta)(Statements.SetCountry), (0, _combi_1.sta)(Statements.SetCursor), (0, _combi_1.sta)(Statements.SetDataset), (0, _combi_1.sta)(Statements.SetExtendedCheck), (0, _combi_1.sta)(Statements.SetHandler), (0, _combi_1.sta)(Statements.SetLanguage), (0, _combi_1.sta)(Statements.SetLeft), (0, _combi_1.sta)(Statements.SetLocale), (0, _combi_1.sta)(Statements.SetMargin), (0, _combi_1.sta)(Statements.SetParameter), (0, _combi_1.sta)(Statements.SetPFStatus), (0, _combi_1.sta)(Statements.SetProperty), (0, _combi_1.sta)(Statements.SetRunTime), (0, _combi_1.sta)(Statements.SetScreen), (0, _combi_1.sta)(Statements.SetTitlebar), (0, _combi_1.sta)(Statements.SetUserCommand), (0, _combi_1.sta)(Statements.SetUpdateTask), (0, _combi_1.sta)(Statements.Shift), (0, _combi_1.sta)(Statements.Skip), (0, _combi_1.sta)(Statements.SortDataset), (0, _combi_1.sta)(Statements.Sort), (0, _combi_1.sta)(Statements.Static), (0, _combi_1.sta)(Statements.Split), (0, _combi_1.sta)(Statements.Stop), (0, _combi_1.sta)(Statements.Submit), (0, _combi_1.sta)(Statements.Summary), (0, _combi_1.sta)(Statements.SubtractCorresponding), (0, _combi_1.sta)(Statements.Subtract), (0, _combi_1.sta)(Statements.SuppressDialog), (0, _combi_1.sta)(Statements.Supply), (0, _combi_1.sta)(Statements.Sum), (0, _combi_1.sta)(Statements.SyntaxCheck), (0, _combi_1.sta)(Statements.SystemCall), (0, _combi_1.sta)(Statements.Tables), (0, _combi_1.sta)(Statements.Transfer), (0, _combi_1.sta)(Statements.Translate), (0, _combi_1.sta)(Statements.Type), (0, _combi_1.sta)(Statements.TypePools), (0, _combi_1.sta)(Statements.Uline), (0, _combi_1.sta)(Statements.Unassign), (0, _combi_1.sta)(Statements.Unpack), (0, _combi_1.sta)(Statements.UpdateDatabase), (0, _combi_1.sta)(Statements.Wait), (0, _combi_1.sta)(Statements.Window), (0, _combi_1.sta)(Statements.Write), (0, _combi_1.sta)(Statements.CommitEntities), (0, _combi_1.sta)(Statements.ModifyEntities), (0, _combi_1.sta)(Statements.ReadEntities), (0, _combi_1.sta)(Statements.RollbackEntities), (0, _combi_1.sub)(Structures.Define), (0, _combi_1.sub)(Structures.TestInjection), (0, _combi_1.sub)(Structures.TestSeam), (0, _combi_1.sub)(Structures.TypeMesh), (0, _combi_1.sub)(Structures.Provide), (0, _combi_1.sub)(Structures.CatchSystemExceptions), (0, _combi_1.sub)(Structures.At), (0, _combi_1.sub)(Structures.Constants), (0, _combi_1.sub)(Structures.Types), (0, _combi_1.sub)(Structures.Statics), (0, _combi_1.sub)(Structures.Select), (0, _combi_1.sub)(Structures.Data), (0, _combi_1.sub)(Structures.TypeEnum), (0, _combi_1.sub)(Structures.While), (0, _combi_1.sub)(Structures.With), (0, _combi_1.sub)(Structures.Do), (0, _combi_1.sub)(Structures.ExecSQL));\r\n }\r\n}\r\nexports.Normal = Normal;\r\n//# sourceMappingURL=normal.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/3_structures/structures/normal.js?");
|
|
6147
6169
|
|
|
6148
6170
|
/***/ }),
|
|
6149
6171
|
|
|
@@ -7786,6 +7808,17 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
7786
7808
|
|
|
7787
7809
|
/***/ }),
|
|
7788
7810
|
|
|
7811
|
+
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js":
|
|
7812
|
+
/*!******************************************************************************************!*\
|
|
7813
|
+
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js ***!
|
|
7814
|
+
\******************************************************************************************/
|
|
7815
|
+
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
7816
|
+
|
|
7817
|
+
"use strict";
|
|
7818
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LoopAtScreen = void 0;\r\nconst Expressions = __webpack_require__(/*! ../../2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst target_1 = __webpack_require__(/*! ../expressions/target */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/target.js\");\r\nconst inline_data_1 = __webpack_require__(/*! ../expressions/inline_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/expressions/inline_data.js\");\r\nconst basic_1 = __webpack_require__(/*! ../../types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass LoopAtScreen {\r\n runSyntax(node, scope, filename) {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n if (target) {\r\n new target_1.Target().runSyntax(target, scope, filename);\r\n }\r\n const inline = target === null || target === void 0 ? void 0 : target.findDirectExpression(Expressions.InlineData);\r\n if (inline) {\r\n new inline_data_1.InlineData().runSyntax(inline, scope, filename, new basic_1.VoidType(\"SCREEN\"));\r\n }\r\n }\r\n}\r\nexports.LoopAtScreen = LoopAtScreen;\r\n//# sourceMappingURL=loop_at_screen.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js?");
|
|
7819
|
+
|
|
7820
|
+
/***/ }),
|
|
7821
|
+
|
|
7789
7822
|
/***/ "./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js":
|
|
7790
7823
|
/*!***********************************************************************************!*\
|
|
7791
7824
|
!*** ./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js ***!
|
|
@@ -8431,7 +8464,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8431
8464
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
8432
8465
|
|
|
8433
8466
|
"use strict";
|
|
8434
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyntaxLogic = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _procedural_1 = __webpack_require__(/*! ./_procedural */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst data_1 = __webpack_require__(/*! ./structures/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/data.js\");\r\nconst type_enum_1 = __webpack_require__(/*! ./structures/type_enum */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/type_enum.js\");\r\nconst types_1 = __webpack_require__(/*! ./structures/types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/types.js\");\r\nconst statics_1 = __webpack_require__(/*! ./structures/statics */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/statics.js\");\r\nconst constants_1 = __webpack_require__(/*! ./structures/constants */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js\");\r\nconst class_definition_1 = __webpack_require__(/*! ../types/class_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/class_definition.js\");\r\nconst interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/interface_definition.js\");\r\nconst perform_1 = __webpack_require__(/*! ./statements/perform */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/perform.js\");\r\nconst type_1 = __webpack_require__(/*! ./statements/type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/type.js\");\r\nconst constant_1 = __webpack_require__(/*! ./statements/constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js\");\r\nconst static_1 = __webpack_require__(/*! ./statements/static */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/static.js\");\r\nconst data_2 = __webpack_require__(/*! ./statements/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/data.js\");\r\nconst parameter_1 = __webpack_require__(/*! ./statements/parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/parameter.js\");\r\nconst fieldsymbol_1 = __webpack_require__(/*! ./statements/fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js\");\r\nconst tables_1 = __webpack_require__(/*! ./statements/tables */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/tables.js\");\r\nconst selectoption_1 = __webpack_require__(/*! ./statements/selectoption */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selectoption.js\");\r\nconst interface_deferred_1 = __webpack_require__(/*! ./statements/interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/interface_deferred.js\");\r\nconst class_deferred_1 = __webpack_require__(/*! ./statements/class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_deferred.js\");\r\nconst call_1 = __webpack_require__(/*! ./statements/call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call.js\");\r\nconst class_implementation_1 = __webpack_require__(/*! ./statements/class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_implementation.js\");\r\nconst method_implementation_1 = __webpack_require__(/*! ./statements/method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/method_implementation.js\");\r\nconst move_1 = __webpack_require__(/*! ./statements/move */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js\");\r\nconst move_corresponding_1 = __webpack_require__(/*! ./statements/move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move_corresponding.js\");\r\nconst catch_1 = __webpack_require__(/*! ./statements/catch */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/catch.js\");\r\nconst loop_1 = __webpack_require__(/*! ./statements/loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js\");\r\nconst read_table_1 = __webpack_require__(/*! ./statements/read_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js\");\r\nconst select_1 = __webpack_require__(/*! ./statements/select */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js\");\r\nconst insert_internal_1 = __webpack_require__(/*! ./statements/insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_internal.js\");\r\nconst split_1 = __webpack_require__(/*! ./statements/split */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/split.js\");\r\nconst assign_1 = __webpack_require__(/*! ./statements/assign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assign.js\");\r\nconst convert_1 = __webpack_require__(/*! ./statements/convert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/convert.js\");\r\nconst describe_1 = __webpack_require__(/*! ./statements/describe */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/describe.js\");\r\nconst find_1 = __webpack_require__(/*! ./statements/find */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/find.js\");\r\nconst message_1 = __webpack_require__(/*! ./statements/message */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js\");\r\nconst get_time_1 = __webpack_require__(/*! ./statements/get_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_time.js\");\r\nconst get_parameter_1 = __webpack_require__(/*! ./statements/get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_parameter.js\");\r\nconst when_type_1 = __webpack_require__(/*! ./statements/when_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when_type.js\");\r\nconst if_1 = __webpack_require__(/*! ./statements/if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/if.js\");\r\nconst else_if_1 = __webpack_require__(/*! ./statements/else_if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/else_if.js\");\r\nconst append_1 = __webpack_require__(/*! ./statements/append */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js\");\r\nconst selection_screen_1 = __webpack_require__(/*! ./statements/selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selection_screen.js\");\r\nconst ranges_1 = __webpack_require__(/*! ./statements/ranges */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/ranges.js\");\r\nconst write_1 = __webpack_require__(/*! ./statements/write */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js\");\r\nconst case_1 = __webpack_require__(/*! ./statements/case */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/case.js\");\r\nconst create_object_1 = __webpack_require__(/*! ./statements/create_object */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js\");\r\nconst do_1 = __webpack_require__(/*! ./statements/do */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/do.js\");\r\nconst concatenate_1 = __webpack_require__(/*! ./statements/concatenate */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/concatenate.js\");\r\nconst call_function_1 = __webpack_require__(/*! ./statements/call_function */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_function.js\");\r\nconst clear_1 = __webpack_require__(/*! ./statements/clear */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/clear.js\");\r\nconst replace_1 = __webpack_require__(/*! ./statements/replace */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/replace.js\");\r\nconst get_bit_1 = __webpack_require__(/*! ./statements/get_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_bit.js\");\r\nconst raise_1 = __webpack_require__(/*! ./statements/raise */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js\");\r\nconst delete_internal_1 = __webpack_require__(/*! ./statements/delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_internal.js\");\r\nconst receive_1 = __webpack_require__(/*! ./statements/receive */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/receive.js\");\r\nconst when_1 = __webpack_require__(/*! ./statements/when */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when.js\");\r\nconst create_data_1 = __webpack_require__(/*! ./statements/create_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_data.js\");\r\nconst call_transformation_1 = __webpack_require__(/*! ./statements/call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transformation.js\");\r\nconst get_locale_1 = __webpack_require__(/*! ./statements/get_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_locale.js\");\r\nconst set_locale_1 = __webpack_require__(/*! ./statements/set_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_locale.js\");\r\nconst sort_1 = __webpack_require__(/*! ./statements/sort */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/sort.js\");\r\nconst read_report_1 = __webpack_require__(/*! ./statements/read_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_report.js\");\r\nconst authority_check_1 = __webpack_require__(/*! ./statements/authority_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/authority_check.js\");\r\nconst insert_report_1 = __webpack_require__(/*! ./statements/insert_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_report.js\");\r\nconst get_reference_1 = __webpack_require__(/*! ./statements/get_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_reference.js\");\r\nconst insert_database_1 = __webpack_require__(/*! ./statements/insert_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_database.js\");\r\nconst delete_database_1 = __webpack_require__(/*! ./statements/delete_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_database.js\");\r\nconst import_dynpro_1 = __webpack_require__(/*! ./statements/import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import_dynpro.js\");\r\nconst syntax_check_1 = __webpack_require__(/*! ./statements/syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/syntax_check.js\");\r\nconst import_1 = __webpack_require__(/*! ./statements/import */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import.js\");\r\nconst export_1 = __webpack_require__(/*! ./statements/export */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/export.js\");\r\nconst scan_1 = __webpack_require__(/*! ./statements/scan */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/scan.js\");\r\nconst submit_1 = __webpack_require__(/*! ./statements/submit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/submit.js\");\r\nconst open_dataset_1 = __webpack_require__(/*! ./statements/open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/open_dataset.js\");\r\nconst close_dataset_1 = __webpack_require__(/*! ./statements/close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/close_dataset.js\");\r\nconst get_run_time_1 = __webpack_require__(/*! ./statements/get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_run_time.js\");\r\nconst update_database_1 = __webpack_require__(/*! ./statements/update_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/update_database.js\");\r\nconst add_1 = __webpack_require__(/*! ./statements/add */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add.js\");\r\nconst subtract_1 = __webpack_require__(/*! ./statements/subtract */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract.js\");\r\nconst add_corresponding_1 = __webpack_require__(/*! ./statements/add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add_corresponding.js\");\r\nconst subtract_corresponding_1 = __webpack_require__(/*! ./statements/subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract_corresponding.js\");\r\nconst multiply_1 = __webpack_require__(/*! ./statements/multiply */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/multiply.js\");\r\nconst divide_1 = __webpack_require__(/*! ./statements/divide */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/divide.js\");\r\nconst condense_1 = __webpack_require__(/*! ./statements/condense */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/condense.js\");\r\nconst controls_1 = __webpack_require__(/*! ./statements/controls */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/controls.js\");\r\nconst while_1 = __webpack_require__(/*! ./statements/while */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/while.js\");\r\nconst select_loop_1 = __webpack_require__(/*! ./statements/select_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select_loop.js\");\r\nconst check_1 = __webpack_require__(/*! ./statements/check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/check.js\");\r\nconst log_point_1 = __webpack_require__(/*! ./statements/log_point */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/log_point.js\");\r\nconst severity_1 = __webpack_require__(/*! ../../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nconst raise_event_1 = __webpack_require__(/*! ./statements/raise_event */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise_event.js\");\r\nconst form_1 = __webpack_require__(/*! ./statements/form */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/form.js\");\r\nconst assert_1 = __webpack_require__(/*! ./statements/assert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assert.js\");\r\nconst set_parameter_1 = __webpack_require__(/*! ./statements/set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_parameter.js\");\r\nconst class_local_friends_1 = __webpack_require__(/*! ./statements/class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_local_friends.js\");\r\nconst get_badi_1 = __webpack_require__(/*! ./statements/get_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_badi.js\");\r\nconst with_1 = __webpack_require__(/*! ./statements/with */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with.js\");\r\nconst with_loop_1 = __webpack_require__(/*! ./statements/with_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with_loop.js\");\r\nconst system_call_1 = __webpack_require__(/*! ./statements/system_call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/system_call.js\");\r\nconst collect_1 = __webpack_require__(/*! ./statements/collect */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/collect.js\");\r\nconst transfer_1 = __webpack_require__(/*! ./statements/transfer */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/transfer.js\");\r\nconst modify_database_1 = __webpack_require__(/*! ./statements/modify_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_database.js\");\r\nconst truncate_dataset_1 = __webpack_require__(/*! ./statements/truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js\");\r\nconst call_badi_1 = __webpack_require__(/*! ./statements/call_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_badi.js\");\r\nconst pack_1 = __webpack_require__(/*! ./statements/pack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/pack.js\");\r\nconst unpack_1 = __webpack_require__(/*! ./statements/unpack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unpack.js\");\r\nconst format_1 = __webpack_require__(/*! ./statements/format */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/format.js\");\r\nconst set_pf_status_1 = __webpack_require__(/*! ./statements/set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_pf_status.js\");\r\nconst set_titlebar_1 = __webpack_require__(/*! ./statements/set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_titlebar.js\");\r\nconst call_transaction_1 = __webpack_require__(/*! ./statements/call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transaction.js\");\r\nconst set_handler_1 = __webpack_require__(/*! ./statements/set_handler */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_handler.js\");\r\nconst wait_1 = __webpack_require__(/*! ./statements/wait */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/wait.js\");\r\nconst delete_report_1 = __webpack_require__(/*! ./statements/delete_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_report.js\");\r\nconst shift_1 = __webpack_require__(/*! ./statements/shift */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js\");\r\nconst set_bit_1 = __webpack_require__(/*! ./statements/set_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_bit.js\");\r\nconst modify_screen_1 = __webpack_require__(/*! ./statements/modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js\");\r\nconst delete_cluster_1 = __webpack_require__(/*! ./statements/delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_cluster.js\");\r\nconst unassign_1 = __webpack_require__(/*! ./statements/unassign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unassign.js\");\r\nconst insert_textpool_1 = __webpack_require__(/*! ./statements/insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_textpool.js\");\r\nconst get_cursor_1 = __webpack_require__(/*! ./statements/get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_cursor.js\");\r\n// -----------------------------------\r\nconst map = {};\r\nfunction addToMap(handler) {\r\n if (map[handler.constructor.name] !== undefined) {\r\n throw new Error(\"syntax.ts duplicate statement syntax handler\");\r\n }\r\n map[handler.constructor.name] = handler;\r\n}\r\nif (Object.keys(map).length === 0) {\r\n addToMap(new interface_deferred_1.InterfaceDeferred());\r\n addToMap(new perform_1.Perform());\r\n addToMap(new class_deferred_1.ClassDeferred());\r\n addToMap(new call_1.Call());\r\n addToMap(new set_handler_1.SetHandler());\r\n addToMap(new class_implementation_1.ClassImplementation());\r\n addToMap(new method_implementation_1.MethodImplementation());\r\n addToMap(new move_1.Move());\r\n addToMap(new get_badi_1.GetBadi());\r\n addToMap(new call_badi_1.CallBadi());\r\n addToMap(new get_cursor_1.GetCursor());\r\n addToMap(new replace_1.Replace());\r\n addToMap(new truncate_dataset_1.TruncateDataset());\r\n addToMap(new assert_1.Assert());\r\n addToMap(new catch_1.Catch());\r\n addToMap(new loop_1.Loop());\r\n addToMap(new set_pf_status_1.SetPFStatus());\r\n addToMap(new set_titlebar_1.SetTitlebar());\r\n addToMap(new submit_1.Submit());\r\n addToMap(new insert_textpool_1.InsertTextpool());\r\n addToMap(new read_table_1.ReadTable());\r\n addToMap(new syntax_check_1.SyntaxCheck());\r\n addToMap(new delete_report_1.DeleteReport());\r\n addToMap(new import_1.Import());\r\n addToMap(new collect_1.Collect());\r\n addToMap(new export_1.Export());\r\n addToMap(new scan_1.Scan());\r\n addToMap(new transfer_1.Transfer());\r\n addToMap(new split_1.Split());\r\n addToMap(new call_function_1.CallFunction());\r\n addToMap(new delete_internal_1.DeleteInternal());\r\n addToMap(new delete_cluster_1.DeleteCluster());\r\n addToMap(new clear_1.Clear());\r\n addToMap(new receive_1.Receive());\r\n addToMap(new get_bit_1.GetBit());\r\n addToMap(new class_local_friends_1.ClassLocalFriends());\r\n addToMap(new select_1.Select());\r\n addToMap(new modify_screen_1.ModifyScreen());\r\n addToMap(new insert_internal_1.InsertInternal());\r\n addToMap(new pack_1.Pack());\r\n addToMap(new unpack_1.Unpack());\r\n addToMap(new assign_1.Assign());\r\n addToMap(new set_locale_1.SetLocale());\r\n addToMap(new set_parameter_1.SetParameter());\r\n addToMap(new convert_1.Convert());\r\n addToMap(new controls_1.Controls());\r\n addToMap(new when_1.When());\r\n addToMap(new insert_database_1.InsertDatabase());\r\n addToMap(new delete_database_1.DeleteDatabase());\r\n addToMap(new update_database_1.UpdateDatabase());\r\n addToMap(new sort_1.Sort());\r\n addToMap(new wait_1.Wait());\r\n addToMap(new condense_1.Condense());\r\n addToMap(new set_bit_1.SetBit());\r\n addToMap(new open_dataset_1.OpenDataset());\r\n addToMap(new close_dataset_1.CloseDataset());\r\n addToMap(new read_report_1.ReadReport());\r\n addToMap(new do_1.Do());\r\n addToMap(new describe_1.Describe());\r\n addToMap(new find_1.Find());\r\n addToMap(new message_1.Message());\r\n addToMap(new system_call_1.SystemCall());\r\n addToMap(new get_time_1.GetTime());\r\n addToMap(new unassign_1.Unassign());\r\n addToMap(new get_parameter_1.GetParameter());\r\n addToMap(new format_1.Format());\r\n addToMap(new when_type_1.WhenType());\r\n addToMap(new if_1.If());\r\n addToMap(new log_point_1.LogPoint());\r\n addToMap(new while_1.While());\r\n addToMap(new with_1.With());\r\n addToMap(new with_loop_1.WithLoop());\r\n addToMap(new call_transformation_1.CallTransformation());\r\n addToMap(new call_transaction_1.CallTransaction());\r\n addToMap(new get_locale_1.GetLocale());\r\n addToMap(new get_reference_1.GetReference());\r\n addToMap(new else_if_1.ElseIf());\r\n addToMap(new get_run_time_1.GetRunTime());\r\n addToMap(new create_object_1.CreateObject());\r\n addToMap(new import_dynpro_1.ImportDynpro());\r\n addToMap(new create_data_1.CreateData());\r\n addToMap(new case_1.Case());\r\n addToMap(new shift_1.Shift());\r\n addToMap(new raise_1.Raise());\r\n addToMap(new concatenate_1.Concatenate());\r\n addToMap(new append_1.Append());\r\n addToMap(new select_loop_1.SelectLoop());\r\n addToMap(new write_1.Write());\r\n addToMap(new move_corresponding_1.MoveCorresponding());\r\n addToMap(new authority_check_1.AuthorityCheck());\r\n addToMap(new insert_report_1.InsertReport());\r\n addToMap(new selection_screen_1.SelectionScreen());\r\n addToMap(new ranges_1.Ranges());\r\n addToMap(new add_1.Add());\r\n addToMap(new raise_event_1.RaiseEvent());\r\n addToMap(new subtract_1.Subtract());\r\n addToMap(new add_corresponding_1.AddCorresponding());\r\n addToMap(new subtract_corresponding_1.SubtractCorresponding());\r\n addToMap(new multiply_1.Multiply());\r\n addToMap(new divide_1.Divide());\r\n addToMap(new check_1.Check());\r\n addToMap(new modify_database_1.ModifyDatabase());\r\n addToMap(new form_1.Form());\r\n addToMap(new selectoption_1.SelectOption());\r\n addToMap(new tables_1.Tables());\r\n addToMap(new parameter_1.Parameter());\r\n addToMap(new fieldsymbol_1.FieldSymbol());\r\n}\r\n// -----------------------------------\r\nclass SyntaxLogic {\r\n constructor(reg, object) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.object = object;\r\n this.scope = _current_scope_1.CurrentScope.buildDefault(this.reg, object);\r\n this.helpers = {\r\n oooc: new _object_oriented_1.ObjectOriented(this.scope),\r\n proc: new _procedural_1.Procedural(this.reg, this.scope),\r\n };\r\n }\r\n run() {\r\n if (this.object.syntaxResult !== undefined) {\r\n return this.object.syntaxResult;\r\n }\r\n this.issues = [];\r\n this.reg.getDDICReferences().clear(this.object);\r\n if (this.object instanceof objects_1.Program && this.object.isInclude()) {\r\n // todo, show some kind of error?\r\n return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };\r\n }\r\n this.traverseObject();\r\n for (;;) {\r\n const spaghetti = this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)); // pop built-in scopes\r\n if (spaghetti.getTop().getIdentifier().stype === _scope_type_1.ScopeType.BuiltIn) {\r\n const result = { issues: this.issues, spaghetti };\r\n this.object.syntaxResult = result;\r\n return result;\r\n }\r\n }\r\n }\r\n /////////////////////////////\r\n traverseObject() {\r\n const traversal = this.object.getSequencedFiles();\r\n if (this.object instanceof objects_1.Program\r\n || this.object instanceof objects_1.FunctionGroup) {\r\n for (const f of this.object.getSequencedFiles()) {\r\n // add FORM defintions to the _global object scope\r\n this.helpers.proc.addAllFormDefinitions(f, this.object);\r\n }\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n let stype = _scope_type_1.ScopeType.Program;\r\n if (this.object instanceof objects_1.FunctionGroup) {\r\n stype = _scope_type_1.ScopeType.FunctionGroup;\r\n }\r\n this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n else if (this.object instanceof objects_1.TypePool) {\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n this.scope.push(_scope_type_1.ScopeType.TypePool, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n for (const file of traversal) {\r\n this.currentFile = file;\r\n const structure = this.currentFile.getStructure();\r\n if (structure === undefined) {\r\n return this.scope;\r\n }\r\n else {\r\n this.traverse(structure);\r\n }\r\n }\r\n return this.scope;\r\n }\r\n newIssue(token, message) {\r\n const issue = issue_1.Issue.atToken(this.currentFile, token, message, \"check_syntax\", severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n traverse(node) {\r\n for (const child of node.getChildren()) {\r\n const isStructure = child instanceof nodes_1.StructureNode;\r\n const isStatement = child instanceof nodes_1.StatementNode;\r\n try {\r\n if (isStructure) {\r\n const gotoNext = this.updateScopeStructure(child);\r\n if (gotoNext === true) {\r\n continue;\r\n }\r\n }\r\n else if (isStatement) {\r\n this.updateScopeStatement(child);\r\n }\r\n }\r\n catch (e) {\r\n this.newIssue(child.getFirstToken(), e.message);\r\n break;\r\n }\r\n // walk into INCLUDEs\r\n if (isStatement && child.get() instanceof Statements.Include) {\r\n const file = this.helpers.proc.findInclude(child, this.object);\r\n if (file !== undefined && file.getStructure() !== undefined) {\r\n const old = this.currentFile;\r\n this.currentFile = file;\r\n this.traverse(file.getStructure());\r\n this.currentFile = old;\r\n }\r\n }\r\n if (isStructure || isStatement) {\r\n this.traverse(child);\r\n }\r\n }\r\n }\r\n // if this returns true, then the traversal should continue with next child\r\n updateScopeStructure(node) {\r\n const filename = this.currentFile.getFilename();\r\n const stru = node.get();\r\n if (stru instanceof Structures.ClassDefinition) {\r\n new class_definition_1.ClassDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Interface) {\r\n new interface_definition_1.InterfaceDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Types) {\r\n this.scope.addType(new types_1.Types().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Constants) {\r\n this.scope.addIdentifier(new constants_1.Constants().runSyntax(node, this.scope, filename).type);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Data) {\r\n this.scope.addIdentifier(new data_1.Data().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Statics) {\r\n this.scope.addIdentifier(new statics_1.Statics().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.TypeEnum) {\r\n const values = new type_enum_1.TypeEnum().runSyntax(node, this.scope, filename).values;\r\n this.scope.addList(values);\r\n return true;\r\n }\r\n return false;\r\n }\r\n updateScopeStatement(node) {\r\n const filename = this.currentFile.getFilename();\r\n const s = node.get();\r\n // todo, refactor\r\n if (s instanceof Statements.Type) {\r\n this.scope.addType(new type_1.Type().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Constant) {\r\n this.scope.addIdentifier(new constant_1.Constant().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Static) {\r\n this.scope.addIdentifier(new static_1.Static().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Data) {\r\n this.scope.addIdentifier(new data_2.Data().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n const name = s.constructor.name;\r\n if (map[name]) {\r\n map[name].runSyntax(node, this.scope, filename);\r\n return;\r\n }\r\n if (s instanceof Statements.FunctionModule) {\r\n this.helpers.proc.findFunctionScope(this.object, node, filename);\r\n }\r\n else if (s instanceof Statements.EndForm\r\n || s instanceof Statements.EndFunction\r\n || s instanceof Statements.EndClass\r\n || s instanceof Statements.EndInterface) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n else if (s instanceof Statements.EndMethod) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n if (this.scope.getType() === _scope_type_1.ScopeType.MethodInstance) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n }\r\n }\r\n}\r\nexports.SyntaxLogic = SyntaxLogic;\r\n//# sourceMappingURL=syntax.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js?");
|
|
8467
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyntaxLogic = void 0;\r\nconst Statements = __webpack_require__(/*! ../2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _current_scope_1 = __webpack_require__(/*! ./_current_scope */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_current_scope.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ./_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _object_oriented_1 = __webpack_require__(/*! ./_object_oriented */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_object_oriented.js\");\r\nconst _procedural_1 = __webpack_require__(/*! ./_procedural */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_procedural.js\");\r\nconst objects_1 = __webpack_require__(/*! ../../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst data_1 = __webpack_require__(/*! ./structures/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/data.js\");\r\nconst type_enum_1 = __webpack_require__(/*! ./structures/type_enum */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/type_enum.js\");\r\nconst types_1 = __webpack_require__(/*! ./structures/types */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/types.js\");\r\nconst statics_1 = __webpack_require__(/*! ./structures/statics */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/statics.js\");\r\nconst constants_1 = __webpack_require__(/*! ./structures/constants */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/structures/constants.js\");\r\nconst class_definition_1 = __webpack_require__(/*! ../types/class_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/class_definition.js\");\r\nconst interface_definition_1 = __webpack_require__(/*! ../types/interface_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/interface_definition.js\");\r\nconst perform_1 = __webpack_require__(/*! ./statements/perform */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/perform.js\");\r\nconst type_1 = __webpack_require__(/*! ./statements/type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/type.js\");\r\nconst constant_1 = __webpack_require__(/*! ./statements/constant */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/constant.js\");\r\nconst static_1 = __webpack_require__(/*! ./statements/static */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/static.js\");\r\nconst data_2 = __webpack_require__(/*! ./statements/data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/data.js\");\r\nconst parameter_1 = __webpack_require__(/*! ./statements/parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/parameter.js\");\r\nconst fieldsymbol_1 = __webpack_require__(/*! ./statements/fieldsymbol */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/fieldsymbol.js\");\r\nconst tables_1 = __webpack_require__(/*! ./statements/tables */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/tables.js\");\r\nconst selectoption_1 = __webpack_require__(/*! ./statements/selectoption */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selectoption.js\");\r\nconst interface_deferred_1 = __webpack_require__(/*! ./statements/interface_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/interface_deferred.js\");\r\nconst class_deferred_1 = __webpack_require__(/*! ./statements/class_deferred */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_deferred.js\");\r\nconst call_1 = __webpack_require__(/*! ./statements/call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call.js\");\r\nconst class_implementation_1 = __webpack_require__(/*! ./statements/class_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_implementation.js\");\r\nconst method_implementation_1 = __webpack_require__(/*! ./statements/method_implementation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/method_implementation.js\");\r\nconst move_1 = __webpack_require__(/*! ./statements/move */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move.js\");\r\nconst move_corresponding_1 = __webpack_require__(/*! ./statements/move_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/move_corresponding.js\");\r\nconst catch_1 = __webpack_require__(/*! ./statements/catch */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/catch.js\");\r\nconst loop_1 = __webpack_require__(/*! ./statements/loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop.js\");\r\nconst read_table_1 = __webpack_require__(/*! ./statements/read_table */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_table.js\");\r\nconst select_1 = __webpack_require__(/*! ./statements/select */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select.js\");\r\nconst insert_internal_1 = __webpack_require__(/*! ./statements/insert_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_internal.js\");\r\nconst split_1 = __webpack_require__(/*! ./statements/split */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/split.js\");\r\nconst assign_1 = __webpack_require__(/*! ./statements/assign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assign.js\");\r\nconst convert_1 = __webpack_require__(/*! ./statements/convert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/convert.js\");\r\nconst describe_1 = __webpack_require__(/*! ./statements/describe */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/describe.js\");\r\nconst find_1 = __webpack_require__(/*! ./statements/find */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/find.js\");\r\nconst message_1 = __webpack_require__(/*! ./statements/message */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/message.js\");\r\nconst get_time_1 = __webpack_require__(/*! ./statements/get_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_time.js\");\r\nconst get_parameter_1 = __webpack_require__(/*! ./statements/get_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_parameter.js\");\r\nconst when_type_1 = __webpack_require__(/*! ./statements/when_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when_type.js\");\r\nconst if_1 = __webpack_require__(/*! ./statements/if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/if.js\");\r\nconst else_if_1 = __webpack_require__(/*! ./statements/else_if */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/else_if.js\");\r\nconst append_1 = __webpack_require__(/*! ./statements/append */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/append.js\");\r\nconst selection_screen_1 = __webpack_require__(/*! ./statements/selection_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/selection_screen.js\");\r\nconst ranges_1 = __webpack_require__(/*! ./statements/ranges */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/ranges.js\");\r\nconst write_1 = __webpack_require__(/*! ./statements/write */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/write.js\");\r\nconst case_1 = __webpack_require__(/*! ./statements/case */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/case.js\");\r\nconst create_object_1 = __webpack_require__(/*! ./statements/create_object */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_object.js\");\r\nconst do_1 = __webpack_require__(/*! ./statements/do */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/do.js\");\r\nconst concatenate_1 = __webpack_require__(/*! ./statements/concatenate */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/concatenate.js\");\r\nconst call_function_1 = __webpack_require__(/*! ./statements/call_function */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_function.js\");\r\nconst clear_1 = __webpack_require__(/*! ./statements/clear */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/clear.js\");\r\nconst replace_1 = __webpack_require__(/*! ./statements/replace */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/replace.js\");\r\nconst get_bit_1 = __webpack_require__(/*! ./statements/get_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_bit.js\");\r\nconst raise_1 = __webpack_require__(/*! ./statements/raise */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise.js\");\r\nconst delete_internal_1 = __webpack_require__(/*! ./statements/delete_internal */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_internal.js\");\r\nconst receive_1 = __webpack_require__(/*! ./statements/receive */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/receive.js\");\r\nconst when_1 = __webpack_require__(/*! ./statements/when */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/when.js\");\r\nconst create_data_1 = __webpack_require__(/*! ./statements/create_data */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/create_data.js\");\r\nconst call_transformation_1 = __webpack_require__(/*! ./statements/call_transformation */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transformation.js\");\r\nconst get_locale_1 = __webpack_require__(/*! ./statements/get_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_locale.js\");\r\nconst set_locale_1 = __webpack_require__(/*! ./statements/set_locale */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_locale.js\");\r\nconst sort_1 = __webpack_require__(/*! ./statements/sort */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/sort.js\");\r\nconst read_report_1 = __webpack_require__(/*! ./statements/read_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/read_report.js\");\r\nconst authority_check_1 = __webpack_require__(/*! ./statements/authority_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/authority_check.js\");\r\nconst insert_report_1 = __webpack_require__(/*! ./statements/insert_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_report.js\");\r\nconst get_reference_1 = __webpack_require__(/*! ./statements/get_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_reference.js\");\r\nconst insert_database_1 = __webpack_require__(/*! ./statements/insert_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_database.js\");\r\nconst delete_database_1 = __webpack_require__(/*! ./statements/delete_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_database.js\");\r\nconst import_dynpro_1 = __webpack_require__(/*! ./statements/import_dynpro */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import_dynpro.js\");\r\nconst syntax_check_1 = __webpack_require__(/*! ./statements/syntax_check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/syntax_check.js\");\r\nconst import_1 = __webpack_require__(/*! ./statements/import */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/import.js\");\r\nconst export_1 = __webpack_require__(/*! ./statements/export */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/export.js\");\r\nconst scan_1 = __webpack_require__(/*! ./statements/scan */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/scan.js\");\r\nconst submit_1 = __webpack_require__(/*! ./statements/submit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/submit.js\");\r\nconst open_dataset_1 = __webpack_require__(/*! ./statements/open_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/open_dataset.js\");\r\nconst close_dataset_1 = __webpack_require__(/*! ./statements/close_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/close_dataset.js\");\r\nconst get_run_time_1 = __webpack_require__(/*! ./statements/get_run_time */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_run_time.js\");\r\nconst update_database_1 = __webpack_require__(/*! ./statements/update_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/update_database.js\");\r\nconst add_1 = __webpack_require__(/*! ./statements/add */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add.js\");\r\nconst subtract_1 = __webpack_require__(/*! ./statements/subtract */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract.js\");\r\nconst add_corresponding_1 = __webpack_require__(/*! ./statements/add_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/add_corresponding.js\");\r\nconst subtract_corresponding_1 = __webpack_require__(/*! ./statements/subtract_corresponding */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/subtract_corresponding.js\");\r\nconst multiply_1 = __webpack_require__(/*! ./statements/multiply */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/multiply.js\");\r\nconst divide_1 = __webpack_require__(/*! ./statements/divide */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/divide.js\");\r\nconst condense_1 = __webpack_require__(/*! ./statements/condense */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/condense.js\");\r\nconst controls_1 = __webpack_require__(/*! ./statements/controls */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/controls.js\");\r\nconst while_1 = __webpack_require__(/*! ./statements/while */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/while.js\");\r\nconst select_loop_1 = __webpack_require__(/*! ./statements/select_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/select_loop.js\");\r\nconst check_1 = __webpack_require__(/*! ./statements/check */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/check.js\");\r\nconst log_point_1 = __webpack_require__(/*! ./statements/log_point */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/log_point.js\");\r\nconst severity_1 = __webpack_require__(/*! ../../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\nconst raise_event_1 = __webpack_require__(/*! ./statements/raise_event */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/raise_event.js\");\r\nconst form_1 = __webpack_require__(/*! ./statements/form */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/form.js\");\r\nconst assert_1 = __webpack_require__(/*! ./statements/assert */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/assert.js\");\r\nconst set_parameter_1 = __webpack_require__(/*! ./statements/set_parameter */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_parameter.js\");\r\nconst class_local_friends_1 = __webpack_require__(/*! ./statements/class_local_friends */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/class_local_friends.js\");\r\nconst get_badi_1 = __webpack_require__(/*! ./statements/get_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_badi.js\");\r\nconst with_1 = __webpack_require__(/*! ./statements/with */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with.js\");\r\nconst with_loop_1 = __webpack_require__(/*! ./statements/with_loop */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/with_loop.js\");\r\nconst system_call_1 = __webpack_require__(/*! ./statements/system_call */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/system_call.js\");\r\nconst collect_1 = __webpack_require__(/*! ./statements/collect */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/collect.js\");\r\nconst transfer_1 = __webpack_require__(/*! ./statements/transfer */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/transfer.js\");\r\nconst modify_database_1 = __webpack_require__(/*! ./statements/modify_database */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_database.js\");\r\nconst truncate_dataset_1 = __webpack_require__(/*! ./statements/truncate_dataset */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/truncate_dataset.js\");\r\nconst call_badi_1 = __webpack_require__(/*! ./statements/call_badi */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_badi.js\");\r\nconst pack_1 = __webpack_require__(/*! ./statements/pack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/pack.js\");\r\nconst unpack_1 = __webpack_require__(/*! ./statements/unpack */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unpack.js\");\r\nconst format_1 = __webpack_require__(/*! ./statements/format */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/format.js\");\r\nconst set_pf_status_1 = __webpack_require__(/*! ./statements/set_pf_status */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_pf_status.js\");\r\nconst set_titlebar_1 = __webpack_require__(/*! ./statements/set_titlebar */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_titlebar.js\");\r\nconst call_transaction_1 = __webpack_require__(/*! ./statements/call_transaction */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/call_transaction.js\");\r\nconst set_handler_1 = __webpack_require__(/*! ./statements/set_handler */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_handler.js\");\r\nconst wait_1 = __webpack_require__(/*! ./statements/wait */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/wait.js\");\r\nconst delete_report_1 = __webpack_require__(/*! ./statements/delete_report */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_report.js\");\r\nconst shift_1 = __webpack_require__(/*! ./statements/shift */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/shift.js\");\r\nconst set_bit_1 = __webpack_require__(/*! ./statements/set_bit */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/set_bit.js\");\r\nconst modify_screen_1 = __webpack_require__(/*! ./statements/modify_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/modify_screen.js\");\r\nconst delete_cluster_1 = __webpack_require__(/*! ./statements/delete_cluster */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/delete_cluster.js\");\r\nconst unassign_1 = __webpack_require__(/*! ./statements/unassign */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/unassign.js\");\r\nconst insert_textpool_1 = __webpack_require__(/*! ./statements/insert_textpool */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/insert_textpool.js\");\r\nconst get_cursor_1 = __webpack_require__(/*! ./statements/get_cursor */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/get_cursor.js\");\r\nconst loop_at_screen_1 = __webpack_require__(/*! ./statements/loop_at_screen */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/statements/loop_at_screen.js\");\r\n// -----------------------------------\r\nconst map = {};\r\nfunction addToMap(handler) {\r\n if (map[handler.constructor.name] !== undefined) {\r\n throw new Error(\"syntax.ts duplicate statement syntax handler\");\r\n }\r\n map[handler.constructor.name] = handler;\r\n}\r\nif (Object.keys(map).length === 0) {\r\n addToMap(new interface_deferred_1.InterfaceDeferred());\r\n addToMap(new perform_1.Perform());\r\n addToMap(new class_deferred_1.ClassDeferred());\r\n addToMap(new call_1.Call());\r\n addToMap(new set_handler_1.SetHandler());\r\n addToMap(new class_implementation_1.ClassImplementation());\r\n addToMap(new method_implementation_1.MethodImplementation());\r\n addToMap(new move_1.Move());\r\n addToMap(new get_badi_1.GetBadi());\r\n addToMap(new call_badi_1.CallBadi());\r\n addToMap(new get_cursor_1.GetCursor());\r\n addToMap(new replace_1.Replace());\r\n addToMap(new truncate_dataset_1.TruncateDataset());\r\n addToMap(new assert_1.Assert());\r\n addToMap(new catch_1.Catch());\r\n addToMap(new loop_1.Loop());\r\n addToMap(new loop_at_screen_1.LoopAtScreen());\r\n addToMap(new set_pf_status_1.SetPFStatus());\r\n addToMap(new set_titlebar_1.SetTitlebar());\r\n addToMap(new submit_1.Submit());\r\n addToMap(new insert_textpool_1.InsertTextpool());\r\n addToMap(new read_table_1.ReadTable());\r\n addToMap(new syntax_check_1.SyntaxCheck());\r\n addToMap(new delete_report_1.DeleteReport());\r\n addToMap(new import_1.Import());\r\n addToMap(new collect_1.Collect());\r\n addToMap(new export_1.Export());\r\n addToMap(new scan_1.Scan());\r\n addToMap(new transfer_1.Transfer());\r\n addToMap(new split_1.Split());\r\n addToMap(new call_function_1.CallFunction());\r\n addToMap(new delete_internal_1.DeleteInternal());\r\n addToMap(new delete_cluster_1.DeleteCluster());\r\n addToMap(new clear_1.Clear());\r\n addToMap(new receive_1.Receive());\r\n addToMap(new get_bit_1.GetBit());\r\n addToMap(new class_local_friends_1.ClassLocalFriends());\r\n addToMap(new select_1.Select());\r\n addToMap(new modify_screen_1.ModifyScreen());\r\n addToMap(new insert_internal_1.InsertInternal());\r\n addToMap(new pack_1.Pack());\r\n addToMap(new unpack_1.Unpack());\r\n addToMap(new assign_1.Assign());\r\n addToMap(new set_locale_1.SetLocale());\r\n addToMap(new set_parameter_1.SetParameter());\r\n addToMap(new convert_1.Convert());\r\n addToMap(new controls_1.Controls());\r\n addToMap(new when_1.When());\r\n addToMap(new insert_database_1.InsertDatabase());\r\n addToMap(new delete_database_1.DeleteDatabase());\r\n addToMap(new update_database_1.UpdateDatabase());\r\n addToMap(new sort_1.Sort());\r\n addToMap(new wait_1.Wait());\r\n addToMap(new condense_1.Condense());\r\n addToMap(new set_bit_1.SetBit());\r\n addToMap(new open_dataset_1.OpenDataset());\r\n addToMap(new close_dataset_1.CloseDataset());\r\n addToMap(new read_report_1.ReadReport());\r\n addToMap(new do_1.Do());\r\n addToMap(new describe_1.Describe());\r\n addToMap(new find_1.Find());\r\n addToMap(new message_1.Message());\r\n addToMap(new system_call_1.SystemCall());\r\n addToMap(new get_time_1.GetTime());\r\n addToMap(new unassign_1.Unassign());\r\n addToMap(new get_parameter_1.GetParameter());\r\n addToMap(new format_1.Format());\r\n addToMap(new when_type_1.WhenType());\r\n addToMap(new if_1.If());\r\n addToMap(new log_point_1.LogPoint());\r\n addToMap(new while_1.While());\r\n addToMap(new with_1.With());\r\n addToMap(new with_loop_1.WithLoop());\r\n addToMap(new call_transformation_1.CallTransformation());\r\n addToMap(new call_transaction_1.CallTransaction());\r\n addToMap(new get_locale_1.GetLocale());\r\n addToMap(new get_reference_1.GetReference());\r\n addToMap(new else_if_1.ElseIf());\r\n addToMap(new get_run_time_1.GetRunTime());\r\n addToMap(new create_object_1.CreateObject());\r\n addToMap(new import_dynpro_1.ImportDynpro());\r\n addToMap(new create_data_1.CreateData());\r\n addToMap(new case_1.Case());\r\n addToMap(new shift_1.Shift());\r\n addToMap(new raise_1.Raise());\r\n addToMap(new concatenate_1.Concatenate());\r\n addToMap(new append_1.Append());\r\n addToMap(new select_loop_1.SelectLoop());\r\n addToMap(new write_1.Write());\r\n addToMap(new move_corresponding_1.MoveCorresponding());\r\n addToMap(new authority_check_1.AuthorityCheck());\r\n addToMap(new insert_report_1.InsertReport());\r\n addToMap(new selection_screen_1.SelectionScreen());\r\n addToMap(new ranges_1.Ranges());\r\n addToMap(new add_1.Add());\r\n addToMap(new raise_event_1.RaiseEvent());\r\n addToMap(new subtract_1.Subtract());\r\n addToMap(new add_corresponding_1.AddCorresponding());\r\n addToMap(new subtract_corresponding_1.SubtractCorresponding());\r\n addToMap(new multiply_1.Multiply());\r\n addToMap(new divide_1.Divide());\r\n addToMap(new check_1.Check());\r\n addToMap(new modify_database_1.ModifyDatabase());\r\n addToMap(new form_1.Form());\r\n addToMap(new selectoption_1.SelectOption());\r\n addToMap(new tables_1.Tables());\r\n addToMap(new parameter_1.Parameter());\r\n addToMap(new fieldsymbol_1.FieldSymbol());\r\n}\r\n// -----------------------------------\r\nclass SyntaxLogic {\r\n constructor(reg, object) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.object = object;\r\n this.scope = _current_scope_1.CurrentScope.buildDefault(this.reg, object);\r\n this.helpers = {\r\n oooc: new _object_oriented_1.ObjectOriented(this.scope),\r\n proc: new _procedural_1.Procedural(this.reg, this.scope),\r\n };\r\n }\r\n run() {\r\n if (this.object.syntaxResult !== undefined) {\r\n return this.object.syntaxResult;\r\n }\r\n this.issues = [];\r\n this.reg.getDDICReferences().clear(this.object);\r\n if (this.object instanceof objects_1.Program && this.object.isInclude()) {\r\n // todo, show some kind of error?\r\n return { issues: [], spaghetti: this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)) };\r\n }\r\n this.traverseObject();\r\n for (;;) {\r\n const spaghetti = this.scope.pop(new position_1.Position(Number.MAX_SAFE_INTEGER, Number.MAX_SAFE_INTEGER)); // pop built-in scopes\r\n if (spaghetti.getTop().getIdentifier().stype === _scope_type_1.ScopeType.BuiltIn) {\r\n const result = { issues: this.issues, spaghetti };\r\n this.object.syntaxResult = result;\r\n return result;\r\n }\r\n }\r\n }\r\n /////////////////////////////\r\n traverseObject() {\r\n const traversal = this.object.getSequencedFiles();\r\n if (this.object instanceof objects_1.Program\r\n || this.object instanceof objects_1.FunctionGroup) {\r\n for (const f of this.object.getSequencedFiles()) {\r\n // add FORM defintions to the _global object scope\r\n this.helpers.proc.addAllFormDefinitions(f, this.object);\r\n }\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n let stype = _scope_type_1.ScopeType.Program;\r\n if (this.object instanceof objects_1.FunctionGroup) {\r\n stype = _scope_type_1.ScopeType.FunctionGroup;\r\n }\r\n this.scope.push(stype, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n else if (this.object instanceof objects_1.TypePool) {\r\n const main = this.object.getMainABAPFile();\r\n if (main !== undefined) {\r\n this.scope.push(_scope_type_1.ScopeType.TypePool, this.object.getName(), new position_1.Position(1, 1), main.getFilename());\r\n }\r\n }\r\n for (const file of traversal) {\r\n this.currentFile = file;\r\n const structure = this.currentFile.getStructure();\r\n if (structure === undefined) {\r\n return this.scope;\r\n }\r\n else {\r\n this.traverse(structure);\r\n }\r\n }\r\n return this.scope;\r\n }\r\n newIssue(token, message) {\r\n const issue = issue_1.Issue.atToken(this.currentFile, token, message, \"check_syntax\", severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n traverse(node) {\r\n for (const child of node.getChildren()) {\r\n const isStructure = child instanceof nodes_1.StructureNode;\r\n const isStatement = child instanceof nodes_1.StatementNode;\r\n try {\r\n if (isStructure) {\r\n const gotoNext = this.updateScopeStructure(child);\r\n if (gotoNext === true) {\r\n continue;\r\n }\r\n }\r\n else if (isStatement) {\r\n this.updateScopeStatement(child);\r\n }\r\n }\r\n catch (e) {\r\n this.newIssue(child.getFirstToken(), e.message);\r\n break;\r\n }\r\n // walk into INCLUDEs\r\n if (isStatement && child.get() instanceof Statements.Include) {\r\n const file = this.helpers.proc.findInclude(child, this.object);\r\n if (file !== undefined && file.getStructure() !== undefined) {\r\n const old = this.currentFile;\r\n this.currentFile = file;\r\n this.traverse(file.getStructure());\r\n this.currentFile = old;\r\n }\r\n }\r\n if (isStructure || isStatement) {\r\n this.traverse(child);\r\n }\r\n }\r\n }\r\n // if this returns true, then the traversal should continue with next child\r\n updateScopeStructure(node) {\r\n const filename = this.currentFile.getFilename();\r\n const stru = node.get();\r\n if (stru instanceof Structures.ClassDefinition) {\r\n new class_definition_1.ClassDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Interface) {\r\n new interface_definition_1.InterfaceDefinition(node, filename, this.scope);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Types) {\r\n this.scope.addType(new types_1.Types().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Constants) {\r\n this.scope.addIdentifier(new constants_1.Constants().runSyntax(node, this.scope, filename).type);\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Data) {\r\n this.scope.addIdentifier(new data_1.Data().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.Statics) {\r\n this.scope.addIdentifier(new statics_1.Statics().runSyntax(node, this.scope, filename));\r\n return true;\r\n }\r\n else if (stru instanceof Structures.TypeEnum) {\r\n const values = new type_enum_1.TypeEnum().runSyntax(node, this.scope, filename).values;\r\n this.scope.addList(values);\r\n return true;\r\n }\r\n return false;\r\n }\r\n updateScopeStatement(node) {\r\n const filename = this.currentFile.getFilename();\r\n const s = node.get();\r\n // todo, refactor\r\n if (s instanceof Statements.Type) {\r\n this.scope.addType(new type_1.Type().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Constant) {\r\n this.scope.addIdentifier(new constant_1.Constant().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Static) {\r\n this.scope.addIdentifier(new static_1.Static().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n else if (s instanceof Statements.Data) {\r\n this.scope.addIdentifier(new data_2.Data().runSyntax(node, this.scope, filename));\r\n return;\r\n }\r\n const name = s.constructor.name;\r\n if (map[name]) {\r\n map[name].runSyntax(node, this.scope, filename);\r\n return;\r\n }\r\n if (s instanceof Statements.FunctionModule) {\r\n this.helpers.proc.findFunctionScope(this.object, node, filename);\r\n }\r\n else if (s instanceof Statements.EndForm\r\n || s instanceof Statements.EndFunction\r\n || s instanceof Statements.EndClass\r\n || s instanceof Statements.EndInterface) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n else if (s instanceof Statements.EndMethod) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n if (this.scope.getType() === _scope_type_1.ScopeType.MethodInstance) {\r\n this.scope.pop(node.getLastToken().getEnd());\r\n }\r\n }\r\n }\r\n}\r\nexports.SyntaxLogic = SyntaxLogic;\r\n//# sourceMappingURL=syntax.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js?");
|
|
8435
8468
|
|
|
8436
8469
|
/***/ }),
|
|
8437
8470
|
|
|
@@ -8475,7 +8508,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
8475
8508
|
/***/ ((__unused_webpack_module, exports) => {
|
|
8476
8509
|
|
|
8477
8510
|
"use strict";
|
|
8478
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FlowGraph = void 0;\r\nclass FlowGraph {\r\n constructor(counter) {\r\n this.label = \"undefined\";\r\n this.edges = {};\r\n this.start = \"start#\" + counter;\r\n this.end = \"end#\" + counter;\r\n }\r\n getStart() {\r\n return this.start;\r\n }\r\n getEnd() {\r\n return this.end;\r\n }\r\n addEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n this.edges[from] = {};\r\n }\r\n this.edges[from][to] = true;\r\n }\r\n removeEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n return;\r\n }\r\n delete this.edges[from][to];\r\n if (Object.keys(this.edges[from]).length === 0) {\r\n delete this.edges[from];\r\n }\r\n }\r\n listEdges() {\r\n const list = [];\r\n for (const from of Object.keys(this.edges)) {\r\n for (const to of Object.keys(this.edges[from])) {\r\n list.push({ from, to });\r\n }\r\n }\r\n return list;\r\n }\r\n listNodes() {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n set.add(l.from);\r\n set.add(l.to);\r\n }\r\n return Array.from(set.values());\r\n }\r\n hasEdges() {\r\n return Object.keys(this.edges).length > 0;\r\n }\r\n /** return value: end node of to graph */\r\n addGraph(from, to) {\r\n if (to.hasEdges() === false) {\r\n return from;\r\n }\r\n this.addEdge(from, to.getStart());\r\n to.listEdges().forEach(e => this.addEdge(e.from, e.to));\r\n return to.getEnd();\r\n }\r\n toJSON() {\r\n return JSON.stringify(this.edges);\r\n }\r\n toTextEdges() {\r\n let graph = \"\";\r\n for (const l of this.listEdges()) {\r\n graph += `\"${l.from}\" -> \"${l.to}\";\\n`;\r\n }\r\n return graph.trim();\r\n }\r\n setLabel(label) {\r\n this.label = label;\r\n }\r\n toDigraph() {\r\n return `digraph G {\nlabelloc=\"t\";\nlabel=\"${this.label}\";\ngraph [fontname = \"helvetica\"];\nnode [fontname = \"helvetica\", shape=\"box\"];\nedge [fontname = \"helvetica\"];\n${this.toTextEdges()}\n}`;\r\n }\r\n listSources(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.to) {\r\n set.add(l.from);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n listTargets(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.from) {\r\n set.add(l.to);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n /** removes all nodes containing \"#\" that have one ingoing and one outgoing edge */\r\n reduce() {\r\n for (const node of this.listNodes()) {\r\n if (node.includes(\"#\") === false) {\r\n continue;\r\n }\r\n const sources = this.listSources(node);\r\n const targets = this.listTargets(node);\r\n if (sources.length > 0 && targets.length > 0) {\r\n // hash node in the middle of the graph\r\n for (const s of sources) {\r\n this.removeEdge(s, node);\r\n }\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n for (const s of sources) {\r\n for (const t of targets) {\r\n this.addEdge(s, t);\r\n }\r\n }\r\n }\r\n if (node.startsWith(\"end#\") && sources.length === 0) {\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n }\r\n }\r\n return this;\r\n }\r\n}\r\nexports.FlowGraph = FlowGraph;\r\n//# sourceMappingURL=flow_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js?");
|
|
8511
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FlowGraph = void 0;\r\nclass FlowGraph {\r\n constructor(counter) {\r\n this.label = \"undefined\";\r\n this.edges = {};\r\n this.start = \"start#\" + counter;\r\n this.end = \"end#\" + counter;\r\n }\r\n getStart() {\r\n return this.start;\r\n }\r\n getEnd() {\r\n return this.end;\r\n }\r\n addEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n this.edges[from] = {};\r\n }\r\n this.edges[from][to] = true;\r\n }\r\n removeEdge(from, to) {\r\n if (this.edges[from] === undefined) {\r\n return;\r\n }\r\n delete this.edges[from][to];\r\n if (Object.keys(this.edges[from]).length === 0) {\r\n delete this.edges[from];\r\n }\r\n }\r\n listEdges() {\r\n const list = [];\r\n for (const from of Object.keys(this.edges)) {\r\n for (const to of Object.keys(this.edges[from])) {\r\n list.push({ from, to });\r\n }\r\n }\r\n return list;\r\n }\r\n listNodes() {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n set.add(l.from);\r\n set.add(l.to);\r\n }\r\n return Array.from(set.values());\r\n }\r\n hasEdges() {\r\n return Object.keys(this.edges).length > 0;\r\n }\r\n /** return value: end node of to graph */\r\n addGraph(from, to) {\r\n if (to.hasEdges() === false) {\r\n return from;\r\n }\r\n this.addEdge(from, to.getStart());\r\n to.listEdges().forEach(e => this.addEdge(e.from, e.to));\r\n return to.getEnd();\r\n }\r\n toJSON() {\r\n return JSON.stringify(this.edges);\r\n }\r\n toTextEdges() {\r\n let graph = \"\";\r\n for (const l of this.listEdges()) {\r\n graph += `\"${l.from}\" -> \"${l.to}\";\\n`;\r\n }\r\n return graph.trim();\r\n }\r\n setLabel(label) {\r\n this.label = label;\r\n }\r\n toDigraph() {\r\n return `digraph G {\r\nlabelloc=\"t\";\r\nlabel=\"${this.label}\";\r\ngraph [fontname = \"helvetica\"];\r\nnode [fontname = \"helvetica\", shape=\"box\"];\r\nedge [fontname = \"helvetica\"];\r\n${this.toTextEdges()}\r\n}`;\r\n }\r\n listSources(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.to) {\r\n set.add(l.from);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n listTargets(node) {\r\n const set = new Set();\r\n for (const l of this.listEdges()) {\r\n if (node === l.from) {\r\n set.add(l.to);\r\n }\r\n }\r\n return Array.from(set.values());\r\n }\r\n /** removes all nodes containing \"#\" that have one ingoing and one outgoing edge */\r\n reduce() {\r\n for (const node of this.listNodes()) {\r\n if (node.includes(\"#\") === false) {\r\n continue;\r\n }\r\n const sources = this.listSources(node);\r\n const targets = this.listTargets(node);\r\n if (sources.length > 0 && targets.length > 0) {\r\n // hash node in the middle of the graph\r\n for (const s of sources) {\r\n this.removeEdge(s, node);\r\n }\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n for (const s of sources) {\r\n for (const t of targets) {\r\n this.addEdge(s, t);\r\n }\r\n }\r\n }\r\n if (node.startsWith(\"end#\") && sources.length === 0) {\r\n for (const t of targets) {\r\n this.removeEdge(node, t);\r\n }\r\n }\r\n }\r\n return this;\r\n }\r\n}\r\nexports.FlowGraph = FlowGraph;\r\n//# sourceMappingURL=flow_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/abap/flow/flow_graph.js?");
|
|
8479
8512
|
|
|
8480
8513
|
/***/ }),
|
|
8481
8514
|
|
|
@@ -9773,7 +9806,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
9773
9806
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
9774
9807
|
|
|
9775
9808
|
"use strict";
|
|
9776
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Help = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst dump_scope_1 = __webpack_require__(/*! ./dump_scope */ \"./node_modules/@abaplint/core/build/src/lsp/dump_scope.js\");\r\nclass Help {\r\n static find(reg, textDocument, position) {\r\n const file = _lsp_utils_1.LSPUtils.getABAPFile(reg, textDocument.uri);\r\n if (file === undefined) {\r\n return \"file not found\";\r\n }\r\n else {\r\n return this.dumpABAP(file, reg, textDocument, position);\r\n }\r\n }\r\n /////////////////////////////////////////////////\r\n static dumpABAP(file, reg, textDocument, position) {\r\n let content = \"\";\r\n content = `\n <a href=\"#_tokens\" rel=\"no-refresh\">Tokens</a> |\n <a href=\"#_statements\" rel=\"no-refresh\">Statements</a> |\n <a href=\"#_structure\" rel=\"no-refresh\">Structure</a> |\n <a href=\"#_files\" rel=\"no-refresh\">Files</a> |\n <a href=\"#_info\" rel=\"no-refresh\">Info Dump</a>\n <hr>\n ` +\r\n \"<tt>\" + textDocument.uri + \" (\" +\r\n (position.line + 1) + \", \" +\r\n (position.character + 1) + \")</tt>\";\r\n content = content + \"<hr>\";\r\n content = content + this.cursorInformation(reg, textDocument, position, file);\r\n content = content + this.fileInformation(file);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpFiles(reg);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpInfo(file);\r\n return content;\r\n }\r\n static dumpInfo(file) {\r\n const info = file.getInfo();\r\n const dump = {\r\n classDefinitions: info.listClassDefinitions(),\r\n classImplementations: info.listClassImplementations(),\r\n interfaceDefinitions: info.listInterfaceDefinitions(),\r\n forms: info.listFormDefinitions(),\r\n };\r\n const text = JSON.stringify(dump, null, 2);\r\n return `<h3 id=\"_info\">Info Dump</h3><pre>` + text + \"</pre>\";\r\n }\r\n static cursorInformation(reg, textDocument, position, file) {\r\n let ret = \"\";\r\n const found = _lsp_utils_1.LSPUtils.findCursor(reg, { textDocument, position });\r\n if (found !== undefined) {\r\n ret = \"Statement: \" + this.linkToStatement(found.snode.get()) + \"<br>\\n\" +\r\n \"Token: \" + found.token.constructor.name + \"<br>\\n\" +\r\n this.fullPath(file, found.token).value;\r\n }\r\n else {\r\n ret = \"No token found at cursor position\";\r\n }\r\n const obj = reg.getObject(file.getObjectType(), file.getObjectName());\r\n if (obj instanceof _abap_object_1.ABAPObject) {\r\n const spaghetti = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti;\r\n ret = ret + dump_scope_1.DumpScope.dump(spaghetti);\r\n if (found !== undefined) {\r\n ret = ret + \"<hr>Spaghetti Scope by Cursor Position:<br><br>\\n\";\r\n const lookup = spaghetti.lookupPosition(found.token.getStart(), textDocument.uri);\r\n if (lookup) {\r\n const identifier = lookup.getIdentifier();\r\n ret = ret + \"<u>\" + identifier.stype + \", <tt>\" + identifier.sname + \"</tt>, \" + identifier.filename;\r\n ret = ret + \", (\" + identifier.start.getRow() + \", \" + identifier.start.getCol() + \")</u><br>\";\r\n }\r\n else {\r\n ret = ret + \"Not found\";\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n static fullPath(file, token) {\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n const found = this.traverse(structure, \"\", token);\r\n if (found === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n return { value: \"\\n\\n\" + found.value, keyword: found.keyword };\r\n }\r\n static traverse(node, parents, search) {\r\n let local = parents;\r\n if (local !== \"\") {\r\n local = local + \" -> \";\r\n }\r\n if (node instanceof nodes_1.StructureNode) {\r\n local = local + \"Structure: \" + this.linkToStructure(node.get());\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n local = local + \"Statement: \" + this.linkToStatement(node.get());\r\n }\r\n else if (node instanceof nodes_1.ExpressionNode) {\r\n local = local + \"Expression: \" + this.linkToExpression(node.get());\r\n }\r\n else if (node instanceof nodes_1.TokenNode) {\r\n local = local + \"Token: \" + node.get().constructor.name;\r\n const token = node.get();\r\n if (token.getStr() === search.getStr()\r\n && token.getCol() === search.getCol()\r\n && token.getRow() === search.getRow()) {\r\n const keyword = !(node instanceof nodes_1.TokenNodeRegex);\r\n return { value: local, keyword };\r\n }\r\n }\r\n else {\r\n throw new Error(\"hover, traverse, unexpected node type\");\r\n }\r\n for (const child of node.getChildren()) {\r\n const ret = this.traverse(child, local, search);\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n return undefined;\r\n }\r\n static fileInformation(file) {\r\n let content = \"\";\r\n content = content + `<hr><h3 id=\"_tokens\">Tokens</h3>\\n`;\r\n content = content + this.tokens(file);\r\n content = content + `<hr><h3 id=\"_statements\">Statements</h3>\\n`;\r\n content = content + this.buildStatements(file);\r\n content = content + `<hr><h3 id=\"_structure\">Structure</h3>\\n`;\r\n const structure = file.getStructure();\r\n if (structure !== undefined) {\r\n content = content + this.buildStructure([structure]);\r\n }\r\n else {\r\n content = content + \"structure undefined\";\r\n }\r\n return content;\r\n }\r\n static escape(str) {\r\n str = str.replace(/&/g, \"&\");\r\n str = str.replace(/>/g, \">\");\r\n str = str.replace(/</g, \"<\");\r\n str = str.replace(/\"/g, \""\");\r\n str = str.replace(/'/g, \"'\");\r\n return str;\r\n }\r\n static linkToStatement(statement) {\r\n return `<a href=\"https://syntax.abaplint.org/#/statement/${statement.constructor.name}\" target=\"_blank\">${statement.constructor.name}</a>\\n`;\r\n }\r\n static linkToStructure(structure) {\r\n return `<a href=\"https://syntax.abaplint.org/#/structure/${structure.constructor.name}\" target=\"_blank\">${structure.constructor.name}</a>\\n`;\r\n }\r\n static linkToExpression(expression) {\r\n return `<a href=\"https://syntax.abaplint.org/#/expression/${expression.constructor.name}\" target=\"_blank\">${expression.constructor.name}</a>\\n`;\r\n }\r\n static outputNodes(nodes) {\r\n let ret = \"<ul>\";\r\n for (const node of nodes) {\r\n let extra = \"\";\r\n switch (node.constructor.name) {\r\n case \"TokenNode\":\r\n case \"TokenNodeRegex\":\r\n extra = node.get().constructor.name + \", \\\"\" + node.get().getStr() + \"\\\"\";\r\n break;\r\n case \"ExpressionNode\":\r\n extra = this.linkToExpression(node.get()) + this.outputNodes(node.getChildren());\r\n break;\r\n default:\r\n break;\r\n }\r\n ret = ret + \"<li>\" + node.constructor.name + \", \" + extra + \"</li>\";\r\n }\r\n return ret + \"</ul>\";\r\n }\r\n static tokens(file) {\r\n let inner = \"<table><tr><td><b>String</b></td><td><b>Type</b></td><td><b>Row</b></td><td><b>Column</b></td></tr>\";\r\n for (const token of file.getTokens()) {\r\n inner = inner + \"<tr><td><tt>\" +\r\n this.escape(token.getStr()) + \"</tt></td><td>\" +\r\n token.constructor.name + \"</td><td align=\\\"right\\\">\" +\r\n token.getRow() + \"</td><td align=\\\"right\\\">\" +\r\n token.getCol() + \"</td></tr>\";\r\n }\r\n inner = inner + \"</table>\";\r\n return inner;\r\n }\r\n static buildStatements(file) {\r\n let output = \"\";\r\n for (const statement of file.getStatements()) {\r\n const row = statement.getStart().getRow();\r\n // getting the class name only works if uglify does not mangle names\r\n output = output +\r\n row + \": \" +\r\n this.linkToStatement(statement.get()) +\r\n \"</div></b>\\n\" + this.outputNodes(statement.getChildren());\r\n }\r\n return output;\r\n }\r\n static buildStructure(nodes) {\r\n let output = \"<ul>\";\r\n for (const node of nodes) {\r\n if (node instanceof nodes_1.StructureNode) {\r\n output = output + \"<li>\" + this.linkToStructure(node.get()) + \", Structure \" + this.buildStructure(node.getChildren()) + \"</li>\";\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n output = output + \"<li>\" + this.linkToStatement(node.get()) + \", Statement</li>\";\r\n }\r\n }\r\n return output + \"</ul>\";\r\n }\r\n static dumpFiles(reg) {\r\n let output = `<h3 id=\"_files\">Files</h3><table>\\n`;\r\n for (const o of reg.getObjects()) {\r\n if (reg.isDependency(o) === true) {\r\n continue;\r\n }\r\n output = output + \"<tr><td valign=\\\"top\\\">\" + o.getType() + \" \" + o.getName() + \"</td><td>\";\r\n for (const f of o.getFiles()) {\r\n output = output + f.getFilename() + \"<br>\";\r\n }\r\n output = output + \"</td></tr>\\n\";\r\n }\r\n return output + \"</table>\\n\";\r\n }\r\n}\r\nexports.Help = Help;\r\n//# sourceMappingURL=help.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/help.js?");
|
|
9809
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Help = void 0;\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _lsp_utils_1 = __webpack_require__(/*! ./_lsp_utils */ \"./node_modules/@abaplint/core/build/src/lsp/_lsp_utils.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst dump_scope_1 = __webpack_require__(/*! ./dump_scope */ \"./node_modules/@abaplint/core/build/src/lsp/dump_scope.js\");\r\nclass Help {\r\n static find(reg, textDocument, position) {\r\n const file = _lsp_utils_1.LSPUtils.getABAPFile(reg, textDocument.uri);\r\n if (file === undefined) {\r\n return \"file not found\";\r\n }\r\n else {\r\n return this.dumpABAP(file, reg, textDocument, position);\r\n }\r\n }\r\n /////////////////////////////////////////////////\r\n static dumpABAP(file, reg, textDocument, position) {\r\n let content = \"\";\r\n content = `\r\n <a href=\"#_tokens\" rel=\"no-refresh\">Tokens</a> |\r\n <a href=\"#_statements\" rel=\"no-refresh\">Statements</a> |\r\n <a href=\"#_structure\" rel=\"no-refresh\">Structure</a> |\r\n <a href=\"#_files\" rel=\"no-refresh\">Files</a> |\r\n <a href=\"#_info\" rel=\"no-refresh\">Info Dump</a>\r\n <hr>\r\n ` +\r\n \"<tt>\" + textDocument.uri + \" (\" +\r\n (position.line + 1) + \", \" +\r\n (position.character + 1) + \")</tt>\";\r\n content = content + \"<hr>\";\r\n content = content + this.cursorInformation(reg, textDocument, position, file);\r\n content = content + this.fileInformation(file);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpFiles(reg);\r\n content = content + \"<hr>\";\r\n content = content + this.dumpInfo(file);\r\n return content;\r\n }\r\n static dumpInfo(file) {\r\n const info = file.getInfo();\r\n const dump = {\r\n classDefinitions: info.listClassDefinitions(),\r\n classImplementations: info.listClassImplementations(),\r\n interfaceDefinitions: info.listInterfaceDefinitions(),\r\n forms: info.listFormDefinitions(),\r\n };\r\n const text = JSON.stringify(dump, null, 2);\r\n return `<h3 id=\"_info\">Info Dump</h3><pre>` + text + \"</pre>\";\r\n }\r\n static cursorInformation(reg, textDocument, position, file) {\r\n let ret = \"\";\r\n const found = _lsp_utils_1.LSPUtils.findCursor(reg, { textDocument, position });\r\n if (found !== undefined) {\r\n ret = \"Statement: \" + this.linkToStatement(found.snode.get()) + \"<br>\\n\" +\r\n \"Token: \" + found.token.constructor.name + \"<br>\\n\" +\r\n this.fullPath(file, found.token).value;\r\n }\r\n else {\r\n ret = \"No token found at cursor position\";\r\n }\r\n const obj = reg.getObject(file.getObjectType(), file.getObjectName());\r\n if (obj instanceof _abap_object_1.ABAPObject) {\r\n const spaghetti = new syntax_1.SyntaxLogic(reg, obj).run().spaghetti;\r\n ret = ret + dump_scope_1.DumpScope.dump(spaghetti);\r\n if (found !== undefined) {\r\n ret = ret + \"<hr>Spaghetti Scope by Cursor Position:<br><br>\\n\";\r\n const lookup = spaghetti.lookupPosition(found.token.getStart(), textDocument.uri);\r\n if (lookup) {\r\n const identifier = lookup.getIdentifier();\r\n ret = ret + \"<u>\" + identifier.stype + \", <tt>\" + identifier.sname + \"</tt>, \" + identifier.filename;\r\n ret = ret + \", (\" + identifier.start.getRow() + \", \" + identifier.start.getCol() + \")</u><br>\";\r\n }\r\n else {\r\n ret = ret + \"Not found\";\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n static fullPath(file, token) {\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n const found = this.traverse(structure, \"\", token);\r\n if (found === undefined) {\r\n return { value: \"\", keyword: false };\r\n }\r\n return { value: \"\\n\\n\" + found.value, keyword: found.keyword };\r\n }\r\n static traverse(node, parents, search) {\r\n let local = parents;\r\n if (local !== \"\") {\r\n local = local + \" -> \";\r\n }\r\n if (node instanceof nodes_1.StructureNode) {\r\n local = local + \"Structure: \" + this.linkToStructure(node.get());\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n local = local + \"Statement: \" + this.linkToStatement(node.get());\r\n }\r\n else if (node instanceof nodes_1.ExpressionNode) {\r\n local = local + \"Expression: \" + this.linkToExpression(node.get());\r\n }\r\n else if (node instanceof nodes_1.TokenNode) {\r\n local = local + \"Token: \" + node.get().constructor.name;\r\n const token = node.get();\r\n if (token.getStr() === search.getStr()\r\n && token.getCol() === search.getCol()\r\n && token.getRow() === search.getRow()) {\r\n const keyword = !(node instanceof nodes_1.TokenNodeRegex);\r\n return { value: local, keyword };\r\n }\r\n }\r\n else {\r\n throw new Error(\"hover, traverse, unexpected node type\");\r\n }\r\n for (const child of node.getChildren()) {\r\n const ret = this.traverse(child, local, search);\r\n if (ret) {\r\n return ret;\r\n }\r\n }\r\n return undefined;\r\n }\r\n static fileInformation(file) {\r\n let content = \"\";\r\n content = content + `<hr><h3 id=\"_tokens\">Tokens</h3>\\n`;\r\n content = content + this.tokens(file);\r\n content = content + `<hr><h3 id=\"_statements\">Statements</h3>\\n`;\r\n content = content + this.buildStatements(file);\r\n content = content + `<hr><h3 id=\"_structure\">Structure</h3>\\n`;\r\n const structure = file.getStructure();\r\n if (structure !== undefined) {\r\n content = content + this.buildStructure([structure]);\r\n }\r\n else {\r\n content = content + \"structure undefined\";\r\n }\r\n return content;\r\n }\r\n static escape(str) {\r\n str = str.replace(/&/g, \"&\");\r\n str = str.replace(/>/g, \">\");\r\n str = str.replace(/</g, \"<\");\r\n str = str.replace(/\"/g, \""\");\r\n str = str.replace(/'/g, \"'\");\r\n return str;\r\n }\r\n static linkToStatement(statement) {\r\n return `<a href=\"https://syntax.abaplint.org/#/statement/${statement.constructor.name}\" target=\"_blank\">${statement.constructor.name}</a>\\n`;\r\n }\r\n static linkToStructure(structure) {\r\n return `<a href=\"https://syntax.abaplint.org/#/structure/${structure.constructor.name}\" target=\"_blank\">${structure.constructor.name}</a>\\n`;\r\n }\r\n static linkToExpression(expression) {\r\n return `<a href=\"https://syntax.abaplint.org/#/expression/${expression.constructor.name}\" target=\"_blank\">${expression.constructor.name}</a>\\n`;\r\n }\r\n static outputNodes(nodes) {\r\n let ret = \"<ul>\";\r\n for (const node of nodes) {\r\n let extra = \"\";\r\n switch (node.constructor.name) {\r\n case \"TokenNode\":\r\n case \"TokenNodeRegex\":\r\n extra = node.get().constructor.name + \", \\\"\" + node.get().getStr() + \"\\\"\";\r\n break;\r\n case \"ExpressionNode\":\r\n extra = this.linkToExpression(node.get()) + this.outputNodes(node.getChildren());\r\n break;\r\n default:\r\n break;\r\n }\r\n ret = ret + \"<li>\" + node.constructor.name + \", \" + extra + \"</li>\";\r\n }\r\n return ret + \"</ul>\";\r\n }\r\n static tokens(file) {\r\n let inner = \"<table><tr><td><b>String</b></td><td><b>Type</b></td><td><b>Row</b></td><td><b>Column</b></td></tr>\";\r\n for (const token of file.getTokens()) {\r\n inner = inner + \"<tr><td><tt>\" +\r\n this.escape(token.getStr()) + \"</tt></td><td>\" +\r\n token.constructor.name + \"</td><td align=\\\"right\\\">\" +\r\n token.getRow() + \"</td><td align=\\\"right\\\">\" +\r\n token.getCol() + \"</td></tr>\";\r\n }\r\n inner = inner + \"</table>\";\r\n return inner;\r\n }\r\n static buildStatements(file) {\r\n let output = \"\";\r\n for (const statement of file.getStatements()) {\r\n const row = statement.getStart().getRow();\r\n // getting the class name only works if uglify does not mangle names\r\n output = output +\r\n row + \": \" +\r\n this.linkToStatement(statement.get()) +\r\n \"</div></b>\\n\" + this.outputNodes(statement.getChildren());\r\n }\r\n return output;\r\n }\r\n static buildStructure(nodes) {\r\n let output = \"<ul>\";\r\n for (const node of nodes) {\r\n if (node instanceof nodes_1.StructureNode) {\r\n output = output + \"<li>\" + this.linkToStructure(node.get()) + \", Structure \" + this.buildStructure(node.getChildren()) + \"</li>\";\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n output = output + \"<li>\" + this.linkToStatement(node.get()) + \", Statement</li>\";\r\n }\r\n }\r\n return output + \"</ul>\";\r\n }\r\n static dumpFiles(reg) {\r\n let output = `<h3 id=\"_files\">Files</h3><table>\\n`;\r\n for (const o of reg.getObjects()) {\r\n if (reg.isDependency(o) === true) {\r\n continue;\r\n }\r\n output = output + \"<tr><td valign=\\\"top\\\">\" + o.getType() + \" \" + o.getName() + \"</td><td>\";\r\n for (const f of o.getFiles()) {\r\n output = output + f.getFilename() + \"<br>\";\r\n }\r\n output = output + \"</td></tr>\\n\";\r\n }\r\n return output + \"</table>\\n\";\r\n }\r\n}\r\nexports.Help = Help;\r\n//# sourceMappingURL=help.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/lsp/help.js?");
|
|
9777
9810
|
|
|
9778
9811
|
/***/ }),
|
|
9779
9812
|
|
|
@@ -11159,7 +11192,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11159
11192
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11160
11193
|
|
|
11161
11194
|
"use strict";
|
|
11162
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Indent = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\n// todo, will break if there is multiple statements per line?\r\nclass Indent {\r\n constructor(options) {\r\n this.globalClasses = new Set();\r\n this.options = options || {};\r\n }\r\n execute(original, modified) {\r\n const statements = original.getStatements();\r\n const expected = this.getExpectedIndents(original);\r\n const lines = modified.split(\"\\n\");\r\n for (const statement of statements) {\r\n if (statement.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n continue; // macro contents\r\n }\r\n const exp = expected.shift();\r\n if (exp === undefined || exp < 0) {\r\n continue;\r\n }\r\n const row = statement.getFirstToken().getStart().getRow() - 1;\r\n lines[row] = lines[row].trim();\r\n for (let i = 1; i < exp; i++) {\r\n lines[row] = \" \" + lines[row];\r\n }\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n // returns list of expected indentation for each line/statement?\r\n getExpectedIndents(file) {\r\n const ret = [];\r\n const init = 1;\r\n const stack = new Stack();\r\n let indent = init;\r\n let parentIsEvent = false;\r\n let previousStatement = undefined;\r\n for (const statement of file.getStatements()) {\r\n if (statement.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n continue; // skip macro contents\r\n }\r\n const type = statement.get();\r\n if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndModule\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndMethod\r\n || type instanceof Statements.EndAt\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.EndExec\r\n || type instanceof Statements.EndOfDefinition\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndTestInjection\r\n || type instanceof Statements.EndTestSeam\r\n || type instanceof Statements.EndForm\r\n || type instanceof Statements.EndCatch\r\n || (this.options.selectionScreenBlockIndentation === true\r\n && type instanceof Statements.SelectionScreen\r\n && statement.concatTokens().toUpperCase().includes(\"END OF BLOCK\"))\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.EndFunction\r\n || type instanceof Statements.EndInterface\r\n || type instanceof Statements.EndDo) {\r\n indent = indent - 2;\r\n }\r\n else if (type instanceof Statements.StartOfSelection\r\n || type instanceof Statements.AtSelectionScreen\r\n || type instanceof Statements.AtLineSelection\r\n || type instanceof Statements.Initialization\r\n || type instanceof Statements.AtUserCommand\r\n || type instanceof Statements.TopOfPage\r\n || type instanceof Statements.EndOfSelection\r\n || type instanceof Statements.LoadOfProgram) {\r\n indent = init;\r\n parentIsEvent = true;\r\n }\r\n else if (type instanceof Statements.Form\r\n || (type instanceof Statements.Include && parentIsEvent)\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.ClassImplementation\r\n || type instanceof Statements.ClassDefinition) {\r\n indent = init;\r\n parentIsEvent = false;\r\n }\r\n else if (type instanceof Statements.Cleanup\r\n || type instanceof Statements.Catch) {\r\n indent = stack.peek() - 2;\r\n }\r\n else if (type instanceof Statements.Public\r\n || type instanceof Statements.Protected\r\n || type instanceof Statements.Private\r\n || type instanceof Statements.WhenType\r\n || type instanceof Statements.WhenOthers\r\n || type instanceof Statements.When) {\r\n indent = stack.peek();\r\n }\r\n else if (type instanceof Statements.EndTry) {\r\n indent = stack.pop() - (this.options.alignTryCatch ? 2 : 4);\r\n }\r\n else if (type instanceof Statements.EndClass\r\n || type instanceof Statements.EndCase) {\r\n indent = stack.pop() - 2;\r\n indent = Math.max(indent, init); // maybe move this out of switch before ret.push(indent)\r\n }\r\n else if (type instanceof _statement_1.Comment\r\n || type instanceof Statements.IncludeType\r\n || type instanceof _statement_1.Empty\r\n || type instanceof _statement_1.MacroContent) {\r\n ret.push(-1);\r\n previousStatement = statement;\r\n continue;\r\n }\r\n if (previousStatement\r\n && !(previousStatement.get() instanceof _statement_1.Comment)\r\n && previousStatement.getLastToken().getEnd().getRow() === statement.getFirstToken().getStart().getRow()) {\r\n // any indentation allowed if there are multiple statements on the same line\r\n ret.push(-1);\r\n previousStatement = statement;\r\n continue;\r\n }\r\n ret.push(indent);\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Interface\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.ExecSQL\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Define\r\n || type instanceof Statements.When\r\n || type instanceof Statements.WhenType\r\n || type instanceof Statements.WhenOthers\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.CatchSystemExceptions\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation\r\n || type instanceof Statements.TestInjection\r\n || type instanceof Statements.TestSeam\r\n || (this.options.selectionScreenBlockIndentation === true\r\n && type instanceof Statements.SelectionScreen\r\n && statement.concatTokens().toUpperCase().includes(\"BEGIN OF BLOCK\"))\r\n || type instanceof Statements.StartOfSelection\r\n || type instanceof Statements.AtSelectionScreen\r\n || type instanceof Statements.AtLineSelection\r\n || type instanceof Statements.LoadOfProgram\r\n || type instanceof Statements.Initialization\r\n || type instanceof Statements.AtUserCommand\r\n || type instanceof Statements.TopOfPage\r\n || type instanceof Statements.EndOfSelection\r\n || type instanceof Statements.Public\r\n || type instanceof Statements.Protected\r\n || type instanceof Statements.Private) {\r\n indent = indent + 2;\r\n }\r\n else if (type instanceof Statements.Try) {\r\n indent = indent + (this.options.alignTryCatch ? 2 : 4);\r\n stack.push(indent);\r\n }\r\n else if (type instanceof Statements.ClassDefinition\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.CaseType\r\n || type instanceof Statements.ClassImplementation) {\r\n indent = indent + (this.skipIndentForGlobalClass(statement) ? 0 : 2);\r\n stack.push(indent);\r\n }\r\n previousStatement = statement;\r\n }\r\n return ret;\r\n }\r\n skipIndentForGlobalClass(statement) {\r\n if (!this.options.globalClassSkipFirst) {\r\n return false;\r\n }\r\n const type = statement.get();\r\n if (type instanceof Statements.ClassDefinition && statement.findFirstExpression(Expressions.ClassGlobal)) {\r\n const className = statement.findFirstExpression(Expressions.ClassName);\r\n if (className) {\r\n this.globalClasses.add(className.getFirstToken().getStr().toUpperCase());\r\n }\r\n return true;\r\n }\r\n else if (type instanceof Statements.ClassImplementation) {\r\n const className = statement.findFirstExpression(Expressions.ClassName);\r\n if (className && this.globalClasses.has(className.getFirstToken().getStr().toUpperCase())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.Indent = Indent;\r\nclass Stack {\r\n constructor() {\r\n this.items = [];\r\n }\r\n push(item) {\r\n this.items.push(item);\r\n }\r\n peek() {\r\n return this.items[this.items.length - 1];\r\n }\r\n pop() {\r\n const peek = this.peek();\r\n this.items = this.items.slice(0, this.items.length - 1);\r\n return peek;\r\n }\r\n}\r\n//# sourceMappingURL=indent.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/pretty_printer/indent.js?");
|
|
11195
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Indent = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\n// todo, will break if there is multiple statements per line?\r\nclass Indent {\r\n constructor(options) {\r\n this.globalClasses = new Set();\r\n this.options = options || {};\r\n }\r\n execute(original, modified) {\r\n const statements = original.getStatements();\r\n const expected = this.getExpectedIndents(original);\r\n const lines = modified.split(\"\\n\");\r\n for (const statement of statements) {\r\n if (statement.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n continue; // macro contents\r\n }\r\n const exp = expected.shift();\r\n if (exp === undefined || exp < 0) {\r\n continue;\r\n }\r\n const row = statement.getFirstToken().getStart().getRow() - 1;\r\n lines[row] = lines[row].trim();\r\n for (let i = 1; i < exp; i++) {\r\n lines[row] = \" \" + lines[row];\r\n }\r\n }\r\n return lines.join(\"\\n\");\r\n }\r\n // returns list of expected indentation for each line/statement?\r\n getExpectedIndents(file) {\r\n const ret = [];\r\n const init = 1;\r\n const stack = new Stack();\r\n let indent = init;\r\n let parentIsEvent = false;\r\n let previousStatement = undefined;\r\n for (const statement of file.getStatements()) {\r\n if (statement.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n continue; // skip macro contents\r\n }\r\n const type = statement.get();\r\n if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndModule\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndMethod\r\n || type instanceof Statements.EndAt\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.EndExec\r\n || type instanceof Statements.EndOfDefinition\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndTestInjection\r\n || type instanceof Statements.EndTestSeam\r\n || type instanceof Statements.EndForm\r\n || type instanceof Statements.EndCatch\r\n || (this.options.selectionScreenBlockIndentation === true\r\n && type instanceof Statements.SelectionScreen\r\n && statement.concatTokens().toUpperCase().includes(\"END OF BLOCK\"))\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.EndFunction\r\n || type instanceof Statements.EndInterface\r\n || type instanceof Statements.EndDo) {\r\n indent = indent - 2;\r\n }\r\n else if (type instanceof Statements.StartOfSelection\r\n || type instanceof Statements.AtSelectionScreen\r\n || type instanceof Statements.AtLineSelection\r\n || type instanceof Statements.Initialization\r\n || type instanceof Statements.AtUserCommand\r\n || type instanceof Statements.TopOfPage\r\n || type instanceof Statements.EndOfSelection\r\n || type instanceof Statements.LoadOfProgram) {\r\n indent = init;\r\n parentIsEvent = true;\r\n }\r\n else if (type instanceof Statements.Form\r\n || (type instanceof Statements.Include && parentIsEvent)\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.ClassImplementation\r\n || type instanceof Statements.ClassDefinition) {\r\n indent = init;\r\n parentIsEvent = false;\r\n }\r\n else if (type instanceof Statements.Cleanup\r\n || type instanceof Statements.Catch) {\r\n indent = stack.peek() - 2;\r\n }\r\n else if (type instanceof Statements.Public\r\n || type instanceof Statements.Protected\r\n || type instanceof Statements.Private\r\n || type instanceof Statements.WhenType\r\n || type instanceof Statements.WhenOthers\r\n || type instanceof Statements.When) {\r\n indent = stack.peek();\r\n }\r\n else if (type instanceof Statements.EndTry) {\r\n indent = stack.pop() - (this.options.alignTryCatch ? 2 : 4);\r\n }\r\n else if (type instanceof Statements.EndClass\r\n || type instanceof Statements.EndCase) {\r\n indent = stack.pop() - 2;\r\n indent = Math.max(indent, init); // maybe move this out of switch before ret.push(indent)\r\n }\r\n else if (type instanceof _statement_1.Comment\r\n || type instanceof Statements.IncludeType\r\n || type instanceof _statement_1.Empty\r\n || type instanceof _statement_1.MacroContent) {\r\n ret.push(-1);\r\n previousStatement = statement;\r\n continue;\r\n }\r\n if (previousStatement\r\n && !(previousStatement.get() instanceof _statement_1.Comment)\r\n && previousStatement.getLastToken().getEnd().getRow() === statement.getFirstToken().getStart().getRow()) {\r\n // any indentation allowed if there are multiple statements on the same line\r\n ret.push(-1);\r\n previousStatement = statement;\r\n continue;\r\n }\r\n ret.push(indent);\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Interface\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.ExecSQL\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Define\r\n || type instanceof Statements.When\r\n || type instanceof Statements.WhenType\r\n || type instanceof Statements.WhenOthers\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.LoopAtScreen\r\n || type instanceof Statements.CatchSystemExceptions\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation\r\n || type instanceof Statements.TestInjection\r\n || type instanceof Statements.TestSeam\r\n || (this.options.selectionScreenBlockIndentation === true\r\n && type instanceof Statements.SelectionScreen\r\n && statement.concatTokens().toUpperCase().includes(\"BEGIN OF BLOCK\"))\r\n || type instanceof Statements.StartOfSelection\r\n || type instanceof Statements.AtSelectionScreen\r\n || type instanceof Statements.AtLineSelection\r\n || type instanceof Statements.LoadOfProgram\r\n || type instanceof Statements.Initialization\r\n || type instanceof Statements.AtUserCommand\r\n || type instanceof Statements.TopOfPage\r\n || type instanceof Statements.EndOfSelection\r\n || type instanceof Statements.Public\r\n || type instanceof Statements.Protected\r\n || type instanceof Statements.Private) {\r\n indent = indent + 2;\r\n }\r\n else if (type instanceof Statements.Try) {\r\n indent = indent + (this.options.alignTryCatch ? 2 : 4);\r\n stack.push(indent);\r\n }\r\n else if (type instanceof Statements.ClassDefinition\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.CaseType\r\n || type instanceof Statements.ClassImplementation) {\r\n indent = indent + (this.skipIndentForGlobalClass(statement) ? 0 : 2);\r\n stack.push(indent);\r\n }\r\n previousStatement = statement;\r\n }\r\n return ret;\r\n }\r\n skipIndentForGlobalClass(statement) {\r\n if (!this.options.globalClassSkipFirst) {\r\n return false;\r\n }\r\n const type = statement.get();\r\n if (type instanceof Statements.ClassDefinition && statement.findFirstExpression(Expressions.ClassGlobal)) {\r\n const className = statement.findFirstExpression(Expressions.ClassName);\r\n if (className) {\r\n this.globalClasses.add(className.getFirstToken().getStr().toUpperCase());\r\n }\r\n return true;\r\n }\r\n else if (type instanceof Statements.ClassImplementation) {\r\n const className = statement.findFirstExpression(Expressions.ClassName);\r\n if (className && this.globalClasses.has(className.getFirstToken().getStr().toUpperCase())) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.Indent = Indent;\r\nclass Stack {\r\n constructor() {\r\n this.items = [];\r\n }\r\n push(item) {\r\n this.items.push(item);\r\n }\r\n peek() {\r\n return this.items[this.items.length - 1];\r\n }\r\n pop() {\r\n const peek = this.peek();\r\n this.items = this.items.slice(0, this.items.length - 1);\r\n return peek;\r\n }\r\n}\r\n//# sourceMappingURL=indent.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/pretty_printer/indent.js?");
|
|
11163
11196
|
|
|
11164
11197
|
/***/ }),
|
|
11165
11198
|
|
|
@@ -11192,7 +11225,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11192
11225
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11193
11226
|
|
|
11194
11227
|
"use strict";
|
|
11195
|
-
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.85.39\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11228
|
+
eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Registry = void 0;\nconst config_1 = __webpack_require__(/*! ./config */ \"./node_modules/@abaplint/core/build/src/config.js\");\nconst artifacts_objects_1 = __webpack_require__(/*! ./artifacts_objects */ \"./node_modules/@abaplint/core/build/src/artifacts_objects.js\");\nconst artifacts_rules_1 = __webpack_require__(/*! ./artifacts_rules */ \"./node_modules/@abaplint/core/build/src/artifacts_rules.js\");\nconst skip_logic_1 = __webpack_require__(/*! ./skip_logic */ \"./node_modules/@abaplint/core/build/src/skip_logic.js\");\nconst _abap_object_1 = __webpack_require__(/*! ./objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\nconst find_global_definitions_1 = __webpack_require__(/*! ./abap/5_syntax/global_definitions/find_global_definitions */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/global_definitions/find_global_definitions.js\");\nconst syntax_1 = __webpack_require__(/*! ./abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\nconst excludeHelper_1 = __webpack_require__(/*! ./utils/excludeHelper */ \"./node_modules/@abaplint/core/build/src/utils/excludeHelper.js\");\nconst ddic_references_1 = __webpack_require__(/*! ./ddic_references */ \"./node_modules/@abaplint/core/build/src/ddic_references.js\");\n// todo, this should really be an instance in case there are multiple Registry'ies\nclass ParsingPerformance {\n static clear() {\n this.results = [];\n this.lexing = 0;\n this.statements = 0;\n this.structure = 0;\n }\n static push(obj, result) {\n if (result.runtimeExtra) {\n this.lexing += result.runtimeExtra.lexing;\n this.statements += result.runtimeExtra.statements;\n this.structure += result.runtimeExtra.structure;\n }\n if (result.runtime < 100) {\n return;\n }\n if (this.results === undefined) {\n this.results = [];\n }\n let extra = \"\";\n if (result.runtimeExtra) {\n extra = `\\t(lexing: ${result.runtimeExtra.lexing}ms, statements: ${result.runtimeExtra.statements}ms, structure: ${result.runtimeExtra.structure}ms)`;\n }\n this.results.push({\n runtime: result.runtime,\n extra,\n name: obj.getType() + \" \" + obj.getName(),\n });\n }\n static output() {\n const MAX = 10;\n this.results.sort((a, b) => { return b.runtime - a.runtime; });\n for (let i = 0; i < MAX; i++) {\n const row = this.results[i];\n if (row === undefined) {\n break;\n }\n process.stderr.write(`\\t${row.runtime}ms\\t${row.name} ${row.extra}\\n`);\n }\n process.stderr.write(`\\tTotal lexing: ${this.lexing}ms\\n`);\n process.stderr.write(`\\tTotal statements: ${this.statements}ms\\n`);\n process.stderr.write(`\\tTotal structure: ${this.structure}ms\\n`);\n }\n}\n///////////////////////////////////////////////////////////////////////////////////////////////\nclass Registry {\n constructor(conf) {\n this.objects = {};\n this.objectsByType = {};\n /** object containing filenames of dependencies */\n this.dependencies = {};\n this.issues = [];\n this.conf = conf ? conf : config_1.Config.getDefault();\n this.references = new ddic_references_1.DDICReferences();\n }\n static abaplintVersion() {\n // magic, see build script \"version.sh\"\n return \"2.85.42\";\n }\n getDDICReferences() {\n return this.references;\n }\n *getObjects() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n yield this.objects[name][type];\n }\n }\n }\n *getObjectsByType(type) {\n for (const name in this.objectsByType[type] || []) {\n yield this.objectsByType[type][name];\n }\n }\n *getFiles() {\n for (const obj of this.getObjects()) {\n for (const file of obj.getFiles()) {\n yield file;\n }\n }\n }\n getFirstObject() {\n for (const name in this.objects) {\n for (const type in this.objects[name]) {\n return this.objects[name][type];\n }\n }\n return undefined;\n }\n getObjectCount(skipDependencies = true) {\n let res = 0;\n for (const o of this.getObjects()) {\n if (skipDependencies === true && this.isDependency(o)) {\n continue;\n }\n res = res + 1;\n }\n return res;\n }\n getFileByName(filename) {\n const upper = filename.toUpperCase();\n for (const o of this.getObjects()) {\n for (const f of o.getFiles()) {\n if (f.getFilename().toUpperCase() === upper) {\n return f;\n }\n }\n }\n return undefined;\n }\n getObject(type, name) {\n if (type === undefined || name === undefined) {\n return undefined;\n }\n const searchName = name.toUpperCase();\n if (this.objects[searchName]) {\n return this.objects[searchName][type];\n }\n return undefined;\n }\n getConfig() {\n return this.conf;\n }\n // assumption: Config is immutable, and can only be changed via this method\n setConfig(conf) {\n for (const obj of this.getObjects()) {\n obj.setDirty();\n }\n this.conf = conf;\n return this;\n }\n inErrorNamespace(name) {\n const reg = new RegExp(this.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\n return reg.test(name);\n }\n addFile(file) {\n return this.addFiles([file]);\n }\n updateFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.updateFile(file);\n return this;\n }\n removeFile(file) {\n const obj = this.find(file.getObjectName(), file.getObjectType());\n obj.removeFile(file);\n if (obj.getFiles().length === 0) {\n this.references.clear(obj);\n this.removeObject(obj);\n }\n return this;\n }\n addFiles(files) {\n var _a;\n const globalExclude = ((_a = this.conf.getGlobal().exclude) !== null && _a !== void 0 ? _a : [])\n .map(pattern => new RegExp(pattern, \"i\"));\n for (const f of files) {\n const filename = f.getFilename();\n const isNotAbapgitFile = filename.split(\".\").length <= 2;\n if (isNotAbapgitFile || excludeHelper_1.ExcludeHelper.isExcluded(filename, globalExclude)) {\n continue;\n }\n const found = this.findOrCreate(f.getObjectName(), f.getObjectType());\n found.addFile(f);\n }\n return this;\n }\n addDependencies(files) {\n for (const f of files) {\n this.dependencies[f.getFilename().toUpperCase()] = true;\n }\n return this.addFiles(files);\n }\n addDependency(file) {\n this.dependencies[file.getFilename().toUpperCase()] = true;\n this.addFile(file);\n return this;\n }\n isDependency(obj) {\n const filename = obj.getFiles()[0].getFilename().toUpperCase();\n return this.dependencies[filename] === true;\n }\n isFileDependency(filename) {\n return this.dependencies[filename.toUpperCase()] === true;\n }\n // assumption: the file is already in the registry\n findObjectForFile(file) {\n const filename = file.getFilename();\n for (const obj of this.getObjects()) {\n for (const ofile of obj.getFiles()) {\n if (ofile.getFilename() === filename) {\n return obj;\n }\n }\n }\n return undefined;\n }\n // todo, this will be changed to async sometime\n findIssues(input) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(input);\n }\n // todo, this will be changed to async sometime\n findIssuesObject(iobj) {\n if (this.isDirty() === true) {\n this.parse();\n }\n return this.runRules(undefined, iobj);\n }\n // todo, this will be changed to async sometime\n parse() {\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n this.issues = [];\n for (const o of this.getObjects()) {\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run();\n return this;\n }\n async parseAsync(input) {\n var _a, _b;\n if (this.isDirty() === false) {\n return this;\n }\n ParsingPerformance.clear();\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(this.getObjectCount(false), \"Lexing and parsing\");\n this.issues = [];\n for (const o of this.getObjects()) {\n await ((_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Lexing and parsing(\" + this.conf.getVersion() + \") - \" + o.getType() + \" \" + o.getName()));\n this.parsePrivate(o);\n this.issues.push(...o.getParsingIssues());\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n ParsingPerformance.output();\n }\n new find_global_definitions_1.FindGlobalDefinitions(this).run(input === null || input === void 0 ? void 0 : input.progress);\n return this;\n }\n //////////////////////////////////////////\n // todo, refactor, this is a mess, see where-used, a lot of the code should be in this method instead\n parsePrivate(input) {\n const config = this.getConfig();\n const result = input.parse(config.getVersion(), config.getSyntaxSetttings().globalMacros, this);\n ParsingPerformance.push(input, result);\n }\n isDirty() {\n for (const o of this.getObjects()) {\n const dirty = o.isDirty();\n if (dirty === true) {\n return true;\n }\n }\n return false;\n }\n runRules(input, iobj) {\n var _a, _b, _c, _d, _e, _f;\n const rulePerformance = {};\n const issues = this.issues.slice(0);\n const objects = iobj ? [iobj] : this.getObjects();\n const rules = this.conf.getEnabledRules();\n const skipLogic = new skip_logic_1.SkipLogic(this);\n (_a = input === null || input === void 0 ? void 0 : input.progress) === null || _a === void 0 ? void 0 : _a.set(iobj ? 1 : this.getObjectCount(false), \"Run Syntax\");\n const check = [];\n for (const obj of objects) {\n (_b = input === null || input === void 0 ? void 0 : input.progress) === null || _b === void 0 ? void 0 : _b.tick(\"Run Syntax - \" + obj.getName());\n if (skipLogic.skip(obj) || this.isDependency(obj)) {\n continue;\n }\n if (obj instanceof _abap_object_1.ABAPObject) {\n new syntax_1.SyntaxLogic(this, obj).run();\n }\n check.push(obj);\n }\n (_c = input === null || input === void 0 ? void 0 : input.progress) === null || _c === void 0 ? void 0 : _c.set(rules.length, \"Initialize Rules\");\n for (const rule of rules) {\n (_d = input === null || input === void 0 ? void 0 : input.progress) === null || _d === void 0 ? void 0 : _d.tick(\"Initialize Rules - \" + rule.getMetadata().key);\n if (rule.initialize === undefined) {\n throw new Error(rule.getMetadata().key + \" missing initialize method\");\n }\n rule.initialize(this);\n rulePerformance[rule.getMetadata().key] = 0;\n }\n (_e = input === null || input === void 0 ? void 0 : input.progress) === null || _e === void 0 ? void 0 : _e.set(check.length, \"Finding Issues\");\n for (const obj of check) {\n (_f = input === null || input === void 0 ? void 0 : input.progress) === null || _f === void 0 ? void 0 : _f.tick(\"Finding Issues - \" + obj.getType() + \" \" + obj.getName());\n for (const rule of rules) {\n const before = Date.now();\n issues.push(...rule.run(obj));\n const runtime = Date.now() - before;\n rulePerformance[rule.getMetadata().key] = rulePerformance[rule.getMetadata().key] + runtime;\n }\n }\n if ((input === null || input === void 0 ? void 0 : input.outputPerformance) === true) {\n const perf = [];\n for (const p in rulePerformance) {\n if (rulePerformance[p] > 100) { // ignore rules if it takes less than 100ms\n perf.push({ name: p, time: rulePerformance[p] });\n }\n }\n perf.sort((a, b) => { return b.time - a.time; });\n for (const p of perf) {\n process.stderr.write(\"\\t\" + p.time + \"ms\\t\" + p.name + \"\\n\");\n }\n }\n return this.excludeIssues(issues);\n }\n excludeIssues(issues) {\n var _a;\n const ret = issues;\n const globalNoIssues = this.conf.getGlobal().noIssues || [];\n const globalNoIssuesPatterns = globalNoIssues.map(x => new RegExp(x, \"i\"));\n if (globalNoIssuesPatterns.length > 0) {\n for (let i = ret.length - 1; i >= 0; i--) {\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, globalNoIssuesPatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n // exclude issues, as now we know both the filename and issue key\n for (const rule of artifacts_rules_1.ArtifactsRules.getRules()) {\n const key = rule.getMetadata().key;\n const ruleExclude = (_a = this.conf.readByKey(key, \"exclude\")) !== null && _a !== void 0 ? _a : [];\n if (ruleExclude.length === 0) {\n continue;\n }\n const ruleExcludePatterns = ruleExclude.map(x => new RegExp(x, \"i\"));\n for (let i = ret.length - 1; i >= 0; i--) {\n if (ret[i].getKey() !== key) {\n continue;\n }\n const filename = ret[i].getFilename();\n if (excludeHelper_1.ExcludeHelper.isExcluded(filename, ruleExcludePatterns)) {\n ret.splice(i, 1);\n }\n }\n }\n return ret;\n }\n findOrCreate(name, type) {\n try {\n return this.find(name, type);\n }\n catch (_a) {\n const newName = name.toUpperCase();\n const newType = type ? type : \"UNKNOWN\";\n const add = artifacts_objects_1.ArtifactsObjects.newObject(newName, newType);\n if (this.objects[newName] === undefined) {\n this.objects[newName] = {};\n }\n this.objects[newName][newType] = add;\n if (this.objectsByType[newType] === undefined) {\n this.objectsByType[newType] = {};\n }\n this.objectsByType[newType][newName] = add;\n return add;\n }\n }\n removeObject(remove) {\n if (remove === undefined) {\n return;\n }\n if (this.objects[remove.getName()][remove.getType()] === undefined) {\n throw new Error(\"removeObject: object not found\");\n }\n if (Object.keys(this.objects[remove.getName()]).length === 1) {\n delete this.objects[remove.getName()];\n }\n else {\n delete this.objects[remove.getName()][remove.getType()];\n }\n if (Object.keys(this.objectsByType[remove.getType()]).length === 1) {\n delete this.objectsByType[remove.getType()];\n }\n else {\n delete this.objectsByType[remove.getType()][remove.getName()];\n }\n }\n find(name, type) {\n const searchType = type ? type : \"UNKNOWN\";\n const searchName = name.toUpperCase();\n if (this.objects[searchName] !== undefined\n && this.objects[searchName][searchType]) {\n return this.objects[searchName][searchType];\n }\n throw new Error(\"find: object not found, \" + type + \" \" + name);\n }\n}\nexports.Registry = Registry;\n//# sourceMappingURL=registry.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/registry.js?");
|
|
11196
11229
|
|
|
11197
11230
|
/***/ }),
|
|
11198
11231
|
|
|
@@ -11203,7 +11236,7 @@ eval("\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexpo
|
|
|
11203
11236
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11204
11237
|
|
|
11205
11238
|
"use strict";
|
|
11206
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SevenBitAscii = exports.SevenBitAsciiConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SevenBitAsciiConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SevenBitAsciiConf = SevenBitAsciiConf;\r\nclass SevenBitAscii {\r\n constructor() {\r\n this.conf = new SevenBitAsciiConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"7bit_ascii\",\r\n title: \"Check for 7bit ascii\",\r\n shortDescription: `Only allow characters from the 7bit ASCII set.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/05/\n\nCheckes files with extension \".abap\" and \".asddls\"`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n const filename = file.getFilename();\r\n if (filename.endsWith(\".abap\") || filename.endsWith(\".asddls\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const found = /[\\u007f-\\uffff]/.exec(rows[i]);\r\n if (found !== null) {\r\n const column = found.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Contains non 7 bit ascii character\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n // method getRawRows() splits by newline, so the carraige return\r\n // should always be last character if present\r\n const carriage = /\\r.+$/.exec(rows[i]);\r\n if (carriage !== null) {\r\n const column = carriage.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Dangling carriage return\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.SevenBitAscii = SevenBitAscii;\r\n//# sourceMappingURL=7bit_ascii.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js?");
|
|
11239
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SevenBitAscii = exports.SevenBitAsciiConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SevenBitAsciiConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SevenBitAsciiConf = SevenBitAsciiConf;\r\nclass SevenBitAscii {\r\n constructor() {\r\n this.conf = new SevenBitAsciiConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"7bit_ascii\",\r\n title: \"Check for 7bit ascii\",\r\n shortDescription: `Only allow characters from the 7bit ASCII set.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/05/\r\n\r\nCheckes files with extension \".abap\" and \".asddls\"`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n const filename = file.getFilename();\r\n if (filename.endsWith(\".abap\") || filename.endsWith(\".asddls\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n const found = /[\\u007f-\\uffff]/.exec(rows[i]);\r\n if (found !== null) {\r\n const column = found.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Contains non 7 bit ascii character\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n // method getRawRows() splits by newline, so the carraige return\r\n // should always be last character if present\r\n const carriage = /\\r.+$/.exec(rows[i]);\r\n if (carriage !== null) {\r\n const column = carriage.index + 1;\r\n const start = new position_1.Position(i + 1, column);\r\n const end = new position_1.Position(i + 1, column + 1);\r\n const message = \"Dangling carriage return\";\r\n const issue = issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.SevenBitAscii = SevenBitAscii;\r\n//# sourceMappingURL=7bit_ascii.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/7bit_ascii.js?");
|
|
11207
11240
|
|
|
11208
11241
|
/***/ }),
|
|
11209
11242
|
|
|
@@ -11258,7 +11291,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11258
11291
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11259
11292
|
|
|
11260
11293
|
"use strict";
|
|
11261
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Abapdoc = exports.AbapdocConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check local classes and interfaces for abapdoc. */\r\n this.checkLocal = false;\r\n }\r\n}\r\nexports.AbapdocConf = AbapdocConf;\r\nclass Abapdoc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AbapdocConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"abapdoc\",\r\n title: \"Check abapdoc\",\r\n shortDescription: `Various checks regarding abapdoc.\nBase rule checks for existence of abapdoc for public class methods and all interface methods.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (this.conf.checkLocal === false && classDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));\r\n }\r\n for (const interfaceDef of file.getInfo().listInterfaceDefinitions()) {\r\n if (this.conf.checkLocal === false && interfaceDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(interfaceDef.methods);\r\n }\r\n for (const method of methods) {\r\n if (method.isRedefinition === true) {\r\n continue;\r\n }\r\n const previousRow = method.identifier.getStart().getRow() - 2;\r\n if (!(rows[previousRow].trim().substring(0, 2) === \"\\\"!\")) {\r\n const message = \"Missing ABAP Doc for method \" + method.identifier.getToken().getStr();\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Abapdoc = Abapdoc;\r\n//# sourceMappingURL=abapdoc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/abapdoc.js?");
|
|
11294
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Abapdoc = exports.AbapdocConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AbapdocConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check local classes and interfaces for abapdoc. */\r\n this.checkLocal = false;\r\n }\r\n}\r\nexports.AbapdocConf = AbapdocConf;\r\nclass Abapdoc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AbapdocConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"abapdoc\",\r\n title: \"Check abapdoc\",\r\n shortDescription: `Various checks regarding abapdoc.\r\nBase rule checks for existence of abapdoc for public class methods and all interface methods.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n let methods = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (this.conf.checkLocal === false && classDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(classDef.methods.filter(m => m.visibility === visibility_1.Visibility.Public));\r\n }\r\n for (const interfaceDef of file.getInfo().listInterfaceDefinitions()) {\r\n if (this.conf.checkLocal === false && interfaceDef.isLocal === true) {\r\n continue;\r\n }\r\n methods = methods.concat(interfaceDef.methods);\r\n }\r\n for (const method of methods) {\r\n if (method.isRedefinition === true) {\r\n continue;\r\n }\r\n const previousRow = method.identifier.getStart().getRow() - 2;\r\n if (!(rows[previousRow].trim().substring(0, 2) === \"\\\"!\")) {\r\n const message = \"Missing ABAP Doc for method \" + method.identifier.getToken().getStr();\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Abapdoc = Abapdoc;\r\n//# sourceMappingURL=abapdoc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/abapdoc.js?");
|
|
11262
11295
|
|
|
11263
11296
|
/***/ }),
|
|
11264
11297
|
|
|
@@ -11269,7 +11302,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11269
11302
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11270
11303
|
|
|
11271
11304
|
"use strict";
|
|
11272
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AlignParameters = exports.AlignParametersConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AlignParametersConf = AlignParametersConf;\r\nclass AlignParameters extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AlignParametersConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"align_parameters\",\r\n title: \"Align Parameters\",\r\n shortDescription: `Checks for vertially aligned parameters`,\r\n extendedInformation: `Checks:\n* function module calls\n* method calls\n* VALUE constructors\n* NEW constructors\n* RAISE EXCEPTION statements\n* CREATE OBJECT statements\n* RAISE EVENT statements\n\nhttps://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters\n\nDoes not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/\n\nAlso https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],\r\n badExample: `CALL FUNCTION 'FOOBAR'\n EXPORTING\n foo = 2\n parameter = 3.\n\nfoobar( moo = 1\n param = 1 ).\n\nfoo = VALUE #(\n foo = bar\n moo = 2 ).`,\r\n goodExample: `CALL FUNCTION 'FOOBAR'\n EXPORTING\n foo = 2\n parameter = 3.\n\nfoobar( moo = 1\n param = 1 ).\n\nfoo = VALUE #(\n foo = bar\n moo = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n const candidates = [];\r\n candidates.push(...this.functionParameterCandidates(stru));\r\n candidates.push(...this.methodCallParamCandidates(stru));\r\n candidates.push(...this.valueBodyCandidates(stru));\r\n candidates.push(...this.raiseAndCreateCandidates(stru));\r\n candidates.push(...this.newCandidates(stru));\r\n for (const c of candidates) {\r\n const i = this.checkCandidate(c, file);\r\n if (i) {\r\n issues.push(i);\r\n }\r\n }\r\n return issues;\r\n }\r\n checkCandidate(candidate, file) {\r\n if (candidate.parameters.length === 0) {\r\n return undefined;\r\n }\r\n let expectedEqualsColumn = 0;\r\n for (const p of candidate.parameters) {\r\n const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;\r\n if (currentCol > expectedEqualsColumn) {\r\n expectedEqualsColumn = currentCol;\r\n }\r\n }\r\n for (const p of candidate.parameters) {\r\n if (p.eq.getCol() !== expectedEqualsColumn) {\r\n const message = \"Align parameters to column \" + expectedEqualsColumn;\r\n return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.NewObject)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length >= 2) {\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n continue;\r\n }\r\n }\r\n const list = vb.findDirectExpression(Expressions.ParameterListS);\r\n if (list) {\r\n for (const c of list.getChildren()) {\r\n const children = c.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n }\r\n return candidates;\r\n }\r\n valueBodyCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.ValueBody)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length <= 1) {\r\n continue;\r\n }\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n raiseAndCreateCandidates(stru) {\r\n const candidates = [];\r\n const statements = stru.findAllStatements(__1.Statements.Raise);\r\n statements.push(...stru.findAllStatements(__1.Statements.CreateObject));\r\n statements.push(...stru.findAllStatements(__1.Statements.RaiseEvent));\r\n for (const raise of statements) {\r\n const parameters = [];\r\n const param = raise.findDirectExpression(Expressions.ParameterListS);\r\n for (const p of (param === null || param === void 0 ? void 0 : param.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const ex = raise.findDirectExpression(Expressions.ParameterListExceptions);\r\n for (const e of (ex === null || ex === void 0 ? void 0 : ex.getChildren()) || []) {\r\n const children = e.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n methodCallParamCandidates(stru) {\r\n var _a, _b, _c;\r\n const candidates = [];\r\n for (const mcp of stru.findAllExpressionsRecursive(Expressions.MethodCallParam)) {\r\n const parameters = [];\r\n for (const param of ((_a = mcp.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n const children = param.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const mp = mcp.findDirectExpression(Expressions.MethodParameters);\r\n if (mp) {\r\n for (const p of ((_b = mp.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const l of mp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const p of l.findDirectExpressions(Expressions.ParameterT) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const rec = mp.findDirectExpression(Expressions.ParameterT);\r\n if (rec) {\r\n const children = rec.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const ex of ((_c = mp.findDirectExpression(Expressions.ParameterListExceptions)) === null || _c === void 0 ? void 0 : _c.getChildren()) || []) {\r\n const children = ex.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n functionParameterCandidates(stru) {\r\n const candidates = [];\r\n for (const fp of stru.findAllExpressionsRecursive(Expressions.FunctionParameters)) {\r\n const parameters = [];\r\n for (const p of fp.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const list of fp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterT)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const list = fp.findDirectExpression(Expressions.ParameterListExceptions);\r\n if (list) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterException)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n}\r\nexports.AlignParameters = AlignParameters;\r\n//# sourceMappingURL=align_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/align_parameters.js?");
|
|
11305
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AlignParameters = exports.AlignParametersConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass AlignParametersConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AlignParametersConf = AlignParametersConf;\r\nclass AlignParameters extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AlignParametersConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"align_parameters\",\r\n title: \"Align Parameters\",\r\n shortDescription: `Checks for vertially aligned parameters`,\r\n extendedInformation: `Checks:\r\n* function module calls\r\n* method calls\r\n* VALUE constructors\r\n* NEW constructors\r\n* RAISE EXCEPTION statements\r\n* CREATE OBJECT statements\r\n* RAISE EVENT statements\r\n\r\nhttps://github.com/SAP/styleguides/blob/master/clean-abap/CleanABAP.md#align-parameters\r\n\r\nDoes not take effect on non functional method calls, use https://rules.abaplint.org/functional_writing/\r\n\r\nAlso https://rules.abaplint.org/max_one_method_parameter_per_line/ can help aligning parameter syntax`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide],\r\n badExample: `CALL FUNCTION 'FOOBAR'\r\n EXPORTING\r\n foo = 2\r\n parameter = 3.\r\n\r\nfoobar( moo = 1\r\n param = 1 ).\r\n\r\nfoo = VALUE #(\r\n foo = bar\r\n moo = 2 ).`,\r\n goodExample: `CALL FUNCTION 'FOOBAR'\r\n EXPORTING\r\n foo = 2\r\n parameter = 3.\r\n\r\nfoobar( moo = 1\r\n param = 1 ).\r\n\r\nfoo = VALUE #(\r\n foo = bar\r\n moo = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues; // parser error\r\n }\r\n const candidates = [];\r\n candidates.push(...this.functionParameterCandidates(stru));\r\n candidates.push(...this.methodCallParamCandidates(stru));\r\n candidates.push(...this.valueBodyCandidates(stru));\r\n candidates.push(...this.raiseAndCreateCandidates(stru));\r\n candidates.push(...this.newCandidates(stru));\r\n for (const c of candidates) {\r\n const i = this.checkCandidate(c, file);\r\n if (i) {\r\n issues.push(i);\r\n }\r\n }\r\n return issues;\r\n }\r\n checkCandidate(candidate, file) {\r\n if (candidate.parameters.length === 0) {\r\n return undefined;\r\n }\r\n let expectedEqualsColumn = 0;\r\n for (const p of candidate.parameters) {\r\n const currentCol = p.left.getLastToken().getCol() + p.left.getLastToken().getStr().length + 1;\r\n if (currentCol > expectedEqualsColumn) {\r\n expectedEqualsColumn = currentCol;\r\n }\r\n }\r\n for (const p of candidate.parameters) {\r\n if (p.eq.getCol() !== expectedEqualsColumn) {\r\n const message = \"Align parameters to column \" + expectedEqualsColumn;\r\n return issue_1.Issue.atPosition(file, p.eq, message, this.getMetadata().key);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.NewObject)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length >= 2) {\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n continue;\r\n }\r\n }\r\n const list = vb.findDirectExpression(Expressions.ParameterListS);\r\n if (list) {\r\n for (const c of list.getChildren()) {\r\n const children = c.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n }\r\n return candidates;\r\n }\r\n valueBodyCandidates(stru) {\r\n const candidates = [];\r\n for (const vb of stru.findAllExpressionsRecursive(Expressions.ValueBody)) {\r\n const parameters = [];\r\n const fieldAssignments = vb.findDirectExpressions(Expressions.FieldAssignment);\r\n if (fieldAssignments.length <= 1) {\r\n continue;\r\n }\r\n for (const fs of fieldAssignments) {\r\n const children = fs.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n raiseAndCreateCandidates(stru) {\r\n const candidates = [];\r\n const statements = stru.findAllStatements(__1.Statements.Raise);\r\n statements.push(...stru.findAllStatements(__1.Statements.CreateObject));\r\n statements.push(...stru.findAllStatements(__1.Statements.RaiseEvent));\r\n for (const raise of statements) {\r\n const parameters = [];\r\n const param = raise.findDirectExpression(Expressions.ParameterListS);\r\n for (const p of (param === null || param === void 0 ? void 0 : param.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const ex = raise.findDirectExpression(Expressions.ParameterListExceptions);\r\n for (const e of (ex === null || ex === void 0 ? void 0 : ex.getChildren()) || []) {\r\n const children = e.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n methodCallParamCandidates(stru) {\r\n var _a, _b, _c;\r\n const candidates = [];\r\n for (const mcp of stru.findAllExpressionsRecursive(Expressions.MethodCallParam)) {\r\n const parameters = [];\r\n for (const param of ((_a = mcp.findDirectExpression(Expressions.ParameterListS)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n const children = param.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n const mp = mcp.findDirectExpression(Expressions.MethodParameters);\r\n if (mp) {\r\n for (const p of ((_b = mp.findDirectExpression(Expressions.ParameterListS)) === null || _b === void 0 ? void 0 : _b.getChildren()) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const l of mp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const p of l.findDirectExpressions(Expressions.ParameterT) || []) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const rec = mp.findDirectExpression(Expressions.ParameterT);\r\n if (rec) {\r\n const children = rec.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const ex of ((_c = mp.findDirectExpression(Expressions.ParameterListExceptions)) === null || _c === void 0 ? void 0 : _c.getChildren()) || []) {\r\n const children = ex.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n functionParameterCandidates(stru) {\r\n const candidates = [];\r\n for (const fp of stru.findAllExpressionsRecursive(Expressions.FunctionParameters)) {\r\n const parameters = [];\r\n for (const p of fp.findAllExpressions(Expressions.FunctionExportingParameter)) {\r\n const children = p.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n for (const list of fp.findDirectExpressions(Expressions.ParameterListT)) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterT)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n const list = fp.findDirectExpression(Expressions.ParameterListExceptions);\r\n if (list) {\r\n for (const pt of list.findDirectExpressions(Expressions.ParameterException)) {\r\n const children = pt.getChildren();\r\n if (children.length < 3) {\r\n continue; // unexpected\r\n }\r\n parameters.push({\r\n left: children[0],\r\n eq: children[1].getFirstToken().getStart(),\r\n right: children[2],\r\n });\r\n }\r\n }\r\n if (parameters.length > 0) {\r\n candidates.push({ parameters });\r\n }\r\n }\r\n return candidates;\r\n }\r\n}\r\nexports.AlignParameters = AlignParameters;\r\n//# sourceMappingURL=align_parameters.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/align_parameters.js?");
|
|
11273
11306
|
|
|
11274
11307
|
/***/ }),
|
|
11275
11308
|
|
|
@@ -11302,7 +11335,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11302
11335
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11303
11336
|
|
|
11304
11337
|
"use strict";
|
|
11305
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AmbiguousStatement = exports.AmbiguousStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AmbiguousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AmbiguousStatementConf = AmbiguousStatementConf;\r\nclass AmbiguousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AmbiguousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"ambiguous_statement\",\r\n title: \"Check for ambigious statements\",\r\n shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table\nAdd \"TABLE\" keyword or \"@\" for escaping SQL variables\n\nOnly works if the target version is 740sp05 or above`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `DELETE foo FROM bar.\nMODIFY foo FROM bar.`,\r\n goodExample: `DELETE foo FROM @bar.\nMODIFY TABLE foo FROM bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Ambiguous statement. Use explicit syntax.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n let match = false;\r\n if (statement.get() instanceof Statements.DeleteDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteInternal);\r\n }\r\n else if (statement.get() instanceof Statements.DeleteInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyInternal);\r\n }\r\n if (match) {\r\n const issue = issue_1.Issue.atStatement(file, statement, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n tryMatch(st, reg, type1) {\r\n const ver = reg.getConfig().getVersion();\r\n const tokens = st.getTokens().slice(0);\r\n tokens.pop();\r\n const match = combi_1.Combi.run(new type1().getMatcher(), tokens, ver);\r\n return match !== undefined;\r\n }\r\n}\r\nexports.AmbiguousStatement = AmbiguousStatement;\r\n//# sourceMappingURL=ambiguous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js?");
|
|
11338
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AmbiguousStatement = exports.AmbiguousStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst combi_1 = __webpack_require__(/*! ../abap/2_statements/combi */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/combi.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass AmbiguousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.AmbiguousStatementConf = AmbiguousStatementConf;\r\nclass AmbiguousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AmbiguousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"ambiguous_statement\",\r\n title: \"Check for ambigious statements\",\r\n shortDescription: `Checks for ambiguity between deleting or modifying from internal and database table\r\nAdd \"TABLE\" keyword or \"@\" for escaping SQL variables\r\n\r\nOnly works if the target version is 740sp05 or above`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `DELETE foo FROM bar.\r\nMODIFY foo FROM bar.`,\r\n goodExample: `DELETE foo FROM @bar.\r\nMODIFY TABLE foo FROM bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Ambiguous statement. Use explicit syntax.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp05) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n let match = false;\r\n if (statement.get() instanceof Statements.DeleteDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteInternal);\r\n }\r\n else if (statement.get() instanceof Statements.DeleteInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.DeleteDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyInternal) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyDatabase);\r\n }\r\n else if (statement.get() instanceof Statements.ModifyDatabase) {\r\n match = this.tryMatch(statement, this.reg, Statements.ModifyInternal);\r\n }\r\n if (match) {\r\n const issue = issue_1.Issue.atStatement(file, statement, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n tryMatch(st, reg, type1) {\r\n const ver = reg.getConfig().getVersion();\r\n const tokens = st.getTokens().slice(0);\r\n tokens.pop();\r\n const match = combi_1.Combi.run(new type1().getMatcher(), tokens, ver);\r\n return match !== undefined;\r\n }\r\n}\r\nexports.AmbiguousStatement = AmbiguousStatement;\r\n//# sourceMappingURL=ambiguous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/ambiguous_statement.js?");
|
|
11306
11339
|
|
|
11307
11340
|
/***/ }),
|
|
11308
11341
|
|
|
@@ -11313,7 +11346,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11313
11346
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11314
11347
|
|
|
11315
11348
|
"use strict";
|
|
11316
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\n\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\n\nSTATICS: use CLASS-DATA instead\n\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
|
|
11349
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.AvoidUse = exports.AvoidUseConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass AvoidUseConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects DEFINE (macro definitions) */\r\n this.define = true;\r\n /** Detects statics */\r\n this.statics = true;\r\n /** Detects DEFAULT KEY definitions, from version v740sp02 and up */\r\n this.defaultKey = true;\r\n /** Detects BREAK and BREAK-POINTS */\r\n this.break = true;\r\n /** Detects DESCRIBE TABLE LINES, use lines() instead */\r\n this.describeLines = true;\r\n }\r\n}\r\nexports.AvoidUseConf = AvoidUseConf;\r\nclass AvoidUse extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new AvoidUseConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"avoid_use\",\r\n title: \"Avoid use of certain statements\",\r\n shortDescription: `Detects usage of certain statements.`,\r\n extendedInformation: `DEFAULT KEY: https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-default-key\r\n\r\nMacros: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abenmacros_guidl.htm\r\n\r\nSTATICS: use CLASS-DATA instead\r\n\r\nDESCRIBE TABLE LINES: use lines() instead (quickfix exists)`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Avoid use of \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n let isStaticsBlock = false;\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n let fix = undefined;\r\n if (this.conf.define && statement instanceof Statements.Define) {\r\n message = \"DEFINE\";\r\n }\r\n else if (this.conf.describeLines && statement instanceof Statements.Describe) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 6 && children[3].getFirstToken().getStr().toUpperCase() === \"LINES\") {\r\n message = \"DESCRIBE LINES, use lines() instead\";\r\n fix = this.getDescribeLinesFix(file, statementNode);\r\n }\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticBegin) {\r\n isStaticsBlock = true;\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.StaticEnd) {\r\n isStaticsBlock = false;\r\n }\r\n else if (this.conf.statics && statement instanceof Statements.Static && isStaticsBlock === false) {\r\n message = \"STATICS\";\r\n }\r\n else if (this.conf.break && statement instanceof Statements.Break) {\r\n message = \"BREAK/BREAK-POINT\";\r\n fix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n if (this.conf.defaultKey\r\n && (this.reg.getConfig().getVersion() >= version_1.Version.v740sp02\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud)\r\n && (statement instanceof Statements.Data || statement instanceof Statements.Type)) {\r\n const tt = (_a = statementNode.findFirstExpression(expressions_1.TypeTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(expressions_1.TypeTableKey);\r\n const token = tt === null || tt === void 0 ? void 0 : tt.findDirectTokenByText(\"DEFAULT\");\r\n if (tt && token) {\r\n message = \"DEFAULT KEY\";\r\n issues.push(issue_1.Issue.atToken(file, token, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getDescribeLinesFix(file, statementNode) {\r\n const children = statementNode.getChildren();\r\n const target = children[4].concatTokens();\r\n const source = children[2].concatTokens();\r\n const startPosition = children[0].getFirstToken().getStart();\r\n const insertText = target + \" = lines( \" + source + \" ).\";\r\n const deleteFix = edit_helper_1.EditHelper.deleteStatement(file, statementNode);\r\n const insertFix = edit_helper_1.EditHelper.insertAt(file, startPosition, insertText);\r\n const finalFix = edit_helper_1.EditHelper.merge(deleteFix, insertFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.AvoidUse = AvoidUse;\r\n//# sourceMappingURL=avoid_use.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/avoid_use.js?");
|
|
11317
11350
|
|
|
11318
11351
|
/***/ }),
|
|
11319
11352
|
|
|
@@ -11324,7 +11357,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11324
11357
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11325
11358
|
|
|
11326
11359
|
"use strict";
|
|
11327
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\n field TYPE i,\n END OF structure_not_the_same.`,\r\n goodExample: `DATA: BEGIN OF stru,\n field TYPE i,\n END OF stru.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n output.push(...this.test(struc, Structures.Data, Statements.DataBegin, Statements.DataEnd, file));\r\n output.push(...this.test(struc, Structures.ClassData, Statements.ClassDataBegin, Statements.ClassDataEnd, file));\r\n output.push(...this.test(struc, Structures.Constants, Statements.ConstantBegin, Statements.ConstantEnd, file));\r\n output.push(...this.test(struc, Structures.Statics, Statements.StaticBegin, Statements.StaticEnd, file));\r\n output.push(...this.test(struc, Structures.TypeEnum, Statements.TypeEnumBegin, Statements.TypeEnumEnd, file));\r\n output.push(...this.test(struc, Structures.Types, Statements.TypeBegin, Statements.TypeEnd, file));\r\n return output;\r\n }\r\n test(stru, type, b, e, file) {\r\n const output = [];\r\n for (const sub of stru.findAllStructuresRecursive(type)) {\r\n let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (begin === undefined) {\r\n begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (begin === undefined) {\r\n continue;\r\n }\r\n const first = begin.getFirstToken();\r\n let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (end === undefined) {\r\n end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const last = end.getFirstToken();\r\n if (first.getStr().toUpperCase() !== last.getStr().toUpperCase()) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, last.getStart(), last.getEnd(), first.getStr());\r\n const message = \"BEGIN END names must match\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity, fix);\r\n output.push(issue);\r\n }\r\n if (sub.getChildren().length === 2) {\r\n const message = \"There must be statements between BEGIN and END\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.BeginEndNames = BeginEndNames;\r\n//# sourceMappingURL=begin_end_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_end_names.js?");
|
|
11360
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginEndNames = exports.BeginEndNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass BeginEndNamesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginEndNamesConf = BeginEndNamesConf;\r\nclass BeginEndNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginEndNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_end_names\",\r\n title: \"Check BEGIN END names\",\r\n shortDescription: `Check BEGIN OF and END OF names match, plus there must be statements between BEGIN and END`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF structure_not_the_same.`,\r\n goodExample: `DATA: BEGIN OF stru,\r\n field TYPE i,\r\n END OF stru.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n output.push(...this.test(struc, Structures.Data, Statements.DataBegin, Statements.DataEnd, file));\r\n output.push(...this.test(struc, Structures.ClassData, Statements.ClassDataBegin, Statements.ClassDataEnd, file));\r\n output.push(...this.test(struc, Structures.Constants, Statements.ConstantBegin, Statements.ConstantEnd, file));\r\n output.push(...this.test(struc, Structures.Statics, Statements.StaticBegin, Statements.StaticEnd, file));\r\n output.push(...this.test(struc, Structures.TypeEnum, Statements.TypeEnumBegin, Statements.TypeEnumEnd, file));\r\n output.push(...this.test(struc, Structures.Types, Statements.TypeBegin, Statements.TypeEnd, file));\r\n return output;\r\n }\r\n test(stru, type, b, e, file) {\r\n const output = [];\r\n for (const sub of stru.findAllStructuresRecursive(type)) {\r\n let begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (begin === undefined) {\r\n begin = sub.findDirectStatements(b)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (begin === undefined) {\r\n continue;\r\n }\r\n const first = begin.getFirstToken();\r\n let end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.NamespaceSimpleName);\r\n if (end === undefined) {\r\n end = sub.findDirectStatements(e)[0].findFirstExpression(Expressions.DefinitionName);\r\n }\r\n if (end === undefined) {\r\n continue;\r\n }\r\n const last = end.getFirstToken();\r\n if (first.getStr().toUpperCase() !== last.getStr().toUpperCase()) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, last.getStart(), last.getEnd(), first.getStr());\r\n const message = \"BEGIN END names must match\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity, fix);\r\n output.push(issue);\r\n }\r\n if (sub.getChildren().length === 2) {\r\n const message = \"There must be statements between BEGIN and END\";\r\n const issue = issue_1.Issue.atToken(file, first, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.BeginEndNames = BeginEndNames;\r\n//# sourceMappingURL=begin_end_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_end_names.js?");
|
|
11328
11361
|
|
|
11329
11362
|
/***/ }),
|
|
11330
11363
|
|
|
@@ -11335,7 +11368,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11335
11368
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11336
11369
|
|
|
11337
11370
|
"use strict";
|
|
11338
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginSingleInclude = exports.BeginSingleIncludeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass BeginSingleIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginSingleIncludeConf = BeginSingleIncludeConf;\r\nclass BeginSingleInclude extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginSingleIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_single_include\",\r\n title: \"BEGIN contains single INCLUDE\",\r\n shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TYPES: BEGIN OF dummy1.\n INCLUDE TYPE dselc.\nTYPES: END OF dummy1.\n\nDATA BEGIN OF foo.\nINCLUDE STRUCTURE syst.\nDATA END OF foo.\n\nSTATICS BEGIN OF bar.\nINCLUDE STRUCTURE syst.\nSTATICS END OF bar.`,\r\n goodExample: `DATA BEGIN OF foo.\nINCLUDE STRUCTURE dselc.\nDATA END OF foo.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const t of stru.findAllStructures(Structures.Types)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"TYPE BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Data)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"DATA BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Statics)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"STATICS BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.BeginSingleInclude = BeginSingleInclude;\r\n//# sourceMappingURL=begin_single_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_single_include.js?");
|
|
11371
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.BeginSingleInclude = exports.BeginSingleIncludeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass BeginSingleIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.BeginSingleIncludeConf = BeginSingleIncludeConf;\r\nclass BeginSingleInclude extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new BeginSingleIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"begin_single_include\",\r\n title: \"BEGIN contains single INCLUDE\",\r\n shortDescription: `Finds TYPE BEGIN with just one INCLUDE TYPE, and DATA with single INCLUDE STRUCTURE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TYPES: BEGIN OF dummy1.\r\n INCLUDE TYPE dselc.\r\nTYPES: END OF dummy1.\r\n\r\nDATA BEGIN OF foo.\r\nINCLUDE STRUCTURE syst.\r\nDATA END OF foo.\r\n\r\nSTATICS BEGIN OF bar.\r\nINCLUDE STRUCTURE syst.\r\nSTATICS END OF bar.`,\r\n goodExample: `DATA BEGIN OF foo.\r\nINCLUDE STRUCTURE dselc.\r\nDATA END OF foo.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const t of stru.findAllStructures(Structures.Types)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"TYPE BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Data)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"DATA BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const t of stru.findAllStructures(Structures.Statics)) {\r\n if (t.getChildren().length !== 3) {\r\n continue;\r\n }\r\n if (t.findFirstStatement(Statements.IncludeType)) {\r\n const token = t.getFirstToken();\r\n const message = \"STATICS BEGIN with single INCLUDE\";\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.BeginSingleInclude = BeginSingleInclude;\r\n//# sourceMappingURL=begin_single_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/begin_single_include.js?");
|
|
11339
11372
|
|
|
11340
11373
|
/***/ }),
|
|
11341
11374
|
|
|
@@ -11346,7 +11379,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11346
11379
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11347
11380
|
|
|
11348
11381
|
"use strict";
|
|
11349
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTransactionAuthorityCheck = exports.CallTransactionAuthorityCheckConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallTransactionAuthorityCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CallTransactionAuthorityCheckConf = CallTransactionAuthorityCheckConf;\r\nclass CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CallTransactionAuthorityCheckConf();\r\n this.MINIMUM_VERSION = version_1.Version.v740sp02;\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"call_transaction_authority_check\",\r\n title: \"Call Transaction Authority-Check\",\r\n shortDescription: `Checks that usages of CALL TRANSACTION contain an authority-check.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n badExample: `CALL TRANSACTION 'FOO'.`,\r\n goodExample: `TRY.\n CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.\n CATCH cx_sy_authorization_error.\nENDTRY.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Add an authority check to CALL TRANSACTION\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const currentVersion = this.reg.getConfig().getVersion();\r\n // Cloud version does not support CALL TRANSACTION\r\n if (currentVersion < this.MINIMUM_VERSION || currentVersion === version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statNode of file.getStatements()) {\r\n const statement = statNode.get();\r\n if (statement instanceof Statements.CallTransaction && !statNode.concatTokensWithoutStringsAndComments().toUpperCase().includes(\"WITH AUTHORITY-CHECK\")) {\r\n issues.push(issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CallTransactionAuthorityCheck = CallTransactionAuthorityCheck;\r\n//# sourceMappingURL=call_transaction_authority_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js?");
|
|
11382
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CallTransactionAuthorityCheck = exports.CallTransactionAuthorityCheckConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass CallTransactionAuthorityCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CallTransactionAuthorityCheckConf = CallTransactionAuthorityCheckConf;\r\nclass CallTransactionAuthorityCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CallTransactionAuthorityCheckConf();\r\n this.MINIMUM_VERSION = version_1.Version.v740sp02;\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"call_transaction_authority_check\",\r\n title: \"Call Transaction Authority-Check\",\r\n shortDescription: `Checks that usages of CALL TRANSACTION contain an authority-check.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/54/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n badExample: `CALL TRANSACTION 'FOO'.`,\r\n goodExample: `TRY.\r\n CALL TRANSACTION 'FOO' WITH AUTHORITY-CHECK.\r\n CATCH cx_sy_authorization_error.\r\nENDTRY.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Add an authority check to CALL TRANSACTION\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const currentVersion = this.reg.getConfig().getVersion();\r\n // Cloud version does not support CALL TRANSACTION\r\n if (currentVersion < this.MINIMUM_VERSION || currentVersion === version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statNode of file.getStatements()) {\r\n const statement = statNode.get();\r\n if (statement instanceof Statements.CallTransaction && !statNode.concatTokensWithoutStringsAndComments().toUpperCase().includes(\"WITH AUTHORITY-CHECK\")) {\r\n issues.push(issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CallTransactionAuthorityCheck = CallTransactionAuthorityCheck;\r\n//# sourceMappingURL=call_transaction_authority_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/call_transaction_authority_check.js?");
|
|
11350
11383
|
|
|
11351
11384
|
/***/ }),
|
|
11352
11385
|
|
|
@@ -11368,7 +11401,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11368
11401
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11369
11402
|
|
|
11370
11403
|
"use strict";
|
|
11371
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChainMainlyDeclarations = exports.ChainMainlyDeclarationsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ChainMainlyDeclarationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow definition statements to be chained */\r\n this.definitions = true;\r\n /** Allow WRITE statements to be chained */\r\n this.write = true;\r\n /** Allow MOVE statements to be chained */\r\n this.move = true;\r\n /** Allow REFRESH statements to be chained */\r\n this.refresh = true;\r\n /** Allow UNASSIGN statements to be chained */\r\n this.unassign = true;\r\n /** Allow CLEAR statements to be chained */\r\n this.clear = true;\r\n /** Allow HIDE statements to be chained */\r\n this.hide = true;\r\n /** Allow FREE statements to be chained */\r\n this.free = true;\r\n /** Allow INCLUDE statements to be chained */\r\n this.include = true;\r\n /** Allow CHECK statements to be chained */\r\n this.check = true;\r\n /** Allow SORT statements to be chained */\r\n this.sort = true;\r\n }\r\n}\r\nexports.ChainMainlyDeclarationsConf = ChainMainlyDeclarationsConf;\r\nclass ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChainMainlyDeclarationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"chain_mainly_declarations\",\r\n title: \"Chain mainly declarations\",\r\n shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,\r\n extendedInformation: `\nhttps://docs.abapopenchecks.org/checks/23/\n\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm\n`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `CALL METHOD: bar.`,\r\n goodExample: `CALL METHOD bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n let previousRow;\r\n for (const statementNode of structure.findAllStatementNodes()) {\r\n const colon = statementNode.getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const statement = statementNode.get();\r\n if (this.conf.definitions === true\r\n && (statement instanceof Statements.ClassData\r\n || statement instanceof Statements.ClassDataBegin\r\n || statement instanceof Statements.ClassDataEnd\r\n || statement instanceof Statements.Static\r\n || statement instanceof Statements.StaticBegin\r\n || statement instanceof Statements.StaticEnd\r\n || statement instanceof Statements.Local\r\n || statement instanceof Statements.Constant\r\n || statement instanceof Statements.ConstantBegin\r\n || statement instanceof Statements.ConstantEnd\r\n || statement instanceof Statements.Controls\r\n || statement instanceof Statements.Parameter\r\n || statement instanceof Statements.SelectOption\r\n || statement instanceof Statements.SelectionScreen\r\n || statement instanceof Statements.Aliases\r\n || statement instanceof Statements.Tables\r\n || statement instanceof Statements.MethodDef\r\n || statement instanceof Statements.InterfaceDef\r\n || statement instanceof Statements.Type\r\n || statement instanceof Statements.TypeBegin\r\n || statement instanceof Statements.TypeEnd\r\n || statement instanceof Statements.TypeEnumBegin\r\n || statement instanceof Statements.TypeEnumEnd\r\n || statement instanceof Statements.TypeEnum\r\n || statement instanceof Statements.Events\r\n || statement instanceof Statements.Ranges\r\n || statement instanceof Statements.TypePools\r\n || statement instanceof Statements.FieldSymbol\r\n || statement instanceof Statements.Data\r\n || statement instanceof Statements.DataBegin\r\n || statement instanceof Statements.DataEnd)) {\r\n continue;\r\n }\r\n else if (this.conf.write === true && statement instanceof Statements.Write) {\r\n continue;\r\n }\r\n else if (this.conf.move === true && statement instanceof Statements.Move) {\r\n continue;\r\n }\r\n else if (this.conf.refresh === true && statement instanceof Statements.Refresh) {\r\n continue;\r\n }\r\n else if (this.conf.unassign === true && statement instanceof Statements.Unassign) {\r\n continue;\r\n }\r\n else if (this.conf.clear === true && statement instanceof Statements.Clear) {\r\n continue;\r\n }\r\n else if (this.conf.hide === true && statement instanceof Statements.Hide) {\r\n continue;\r\n }\r\n else if (this.conf.free === true && statement instanceof Statements.Free) {\r\n continue;\r\n }\r\n else if (this.conf.include === true && statement instanceof Statements.Include) {\r\n continue;\r\n }\r\n else if (this.conf.check === true && statement instanceof Statements.Check) {\r\n continue;\r\n }\r\n else if (this.conf.sort === true && statement instanceof Statements.Sort) {\r\n continue;\r\n }\r\n let prevFix;\r\n if (previousRow === colon.getStart().getRow()) {\r\n prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getFix();\r\n }\r\n const fix = this.getFix(file, statement, statementNode, prevFix);\r\n const message = \"Chain mainly declarations\";\r\n issues.push(issue_1.Issue.atToken(file, statementNode.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n previousRow = statementNode.getColon().getStart().getRow();\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode, prevFix) {\r\n if (statement instanceof Statements.ClassDataBegin ||\r\n statement instanceof Statements.ClassDataEnd ||\r\n statement instanceof Statements.StaticBegin ||\r\n statement instanceof Statements.StaticEnd ||\r\n statement instanceof Statements.ConstantBegin ||\r\n statement instanceof Statements.ConstantEnd ||\r\n statement instanceof Statements.TypeBegin ||\r\n statement instanceof Statements.TypeEnd ||\r\n statement instanceof Statements.TypeEnumBegin ||\r\n statement instanceof Statements.TypeEnumEnd ||\r\n statement instanceof Statements.DataBegin ||\r\n statement instanceof Statements.DataEnd) {\r\n return undefined;\r\n }\r\n let replacement = statementNode.concatTokens();\r\n replacement = replacement.replace(\",\", \".\");\r\n let start;\r\n if (prevFix === undefined) {\r\n start = statementNode.getStart();\r\n }\r\n else {\r\n start = statementNode.getTokens()[1].getStart();\r\n }\r\n let fix = edit_helper_1.EditHelper.replaceRange(file, start, statementNode.getEnd(), replacement);\r\n if (prevFix !== undefined) {\r\n fix = edit_helper_1.EditHelper.merge(fix, prevFix);\r\n }\r\n return fix;\r\n }\r\n}\r\nexports.ChainMainlyDeclarations = ChainMainlyDeclarations;\r\n//# sourceMappingURL=chain_mainly_declarations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js?");
|
|
11404
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ChainMainlyDeclarations = exports.ChainMainlyDeclarationsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ChainMainlyDeclarationsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow definition statements to be chained */\r\n this.definitions = true;\r\n /** Allow WRITE statements to be chained */\r\n this.write = true;\r\n /** Allow MOVE statements to be chained */\r\n this.move = true;\r\n /** Allow REFRESH statements to be chained */\r\n this.refresh = true;\r\n /** Allow UNASSIGN statements to be chained */\r\n this.unassign = true;\r\n /** Allow CLEAR statements to be chained */\r\n this.clear = true;\r\n /** Allow HIDE statements to be chained */\r\n this.hide = true;\r\n /** Allow FREE statements to be chained */\r\n this.free = true;\r\n /** Allow INCLUDE statements to be chained */\r\n this.include = true;\r\n /** Allow CHECK statements to be chained */\r\n this.check = true;\r\n /** Allow SORT statements to be chained */\r\n this.sort = true;\r\n }\r\n}\r\nexports.ChainMainlyDeclarationsConf = ChainMainlyDeclarationsConf;\r\nclass ChainMainlyDeclarations extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ChainMainlyDeclarationsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"chain_mainly_declarations\",\r\n title: \"Chain mainly declarations\",\r\n shortDescription: `Chain mainly declarations, allows chaining for the configured statements, reports errors for other statements.`,\r\n extendedInformation: `\r\nhttps://docs.abapopenchecks.org/checks/23/\r\n\r\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenchained_statements_guidl.htm\r\n`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `CALL METHOD: bar.`,\r\n goodExample: `CALL METHOD bar.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n let previousRow;\r\n for (const statementNode of structure.findAllStatementNodes()) {\r\n const colon = statementNode.getColon();\r\n if (colon === undefined) {\r\n continue;\r\n }\r\n const statement = statementNode.get();\r\n if (this.conf.definitions === true\r\n && (statement instanceof Statements.ClassData\r\n || statement instanceof Statements.ClassDataBegin\r\n || statement instanceof Statements.ClassDataEnd\r\n || statement instanceof Statements.Static\r\n || statement instanceof Statements.StaticBegin\r\n || statement instanceof Statements.StaticEnd\r\n || statement instanceof Statements.Local\r\n || statement instanceof Statements.Constant\r\n || statement instanceof Statements.ConstantBegin\r\n || statement instanceof Statements.ConstantEnd\r\n || statement instanceof Statements.Controls\r\n || statement instanceof Statements.Parameter\r\n || statement instanceof Statements.SelectOption\r\n || statement instanceof Statements.SelectionScreen\r\n || statement instanceof Statements.Aliases\r\n || statement instanceof Statements.Tables\r\n || statement instanceof Statements.MethodDef\r\n || statement instanceof Statements.InterfaceDef\r\n || statement instanceof Statements.Type\r\n || statement instanceof Statements.TypeBegin\r\n || statement instanceof Statements.TypeEnd\r\n || statement instanceof Statements.TypeEnumBegin\r\n || statement instanceof Statements.TypeEnumEnd\r\n || statement instanceof Statements.TypeEnum\r\n || statement instanceof Statements.Events\r\n || statement instanceof Statements.Ranges\r\n || statement instanceof Statements.TypePools\r\n || statement instanceof Statements.FieldSymbol\r\n || statement instanceof Statements.Data\r\n || statement instanceof Statements.DataBegin\r\n || statement instanceof Statements.DataEnd)) {\r\n continue;\r\n }\r\n else if (this.conf.write === true && statement instanceof Statements.Write) {\r\n continue;\r\n }\r\n else if (this.conf.move === true && statement instanceof Statements.Move) {\r\n continue;\r\n }\r\n else if (this.conf.refresh === true && statement instanceof Statements.Refresh) {\r\n continue;\r\n }\r\n else if (this.conf.unassign === true && statement instanceof Statements.Unassign) {\r\n continue;\r\n }\r\n else if (this.conf.clear === true && statement instanceof Statements.Clear) {\r\n continue;\r\n }\r\n else if (this.conf.hide === true && statement instanceof Statements.Hide) {\r\n continue;\r\n }\r\n else if (this.conf.free === true && statement instanceof Statements.Free) {\r\n continue;\r\n }\r\n else if (this.conf.include === true && statement instanceof Statements.Include) {\r\n continue;\r\n }\r\n else if (this.conf.check === true && statement instanceof Statements.Check) {\r\n continue;\r\n }\r\n else if (this.conf.sort === true && statement instanceof Statements.Sort) {\r\n continue;\r\n }\r\n let prevFix;\r\n if (previousRow === colon.getStart().getRow()) {\r\n prevFix = (_a = issues.pop()) === null || _a === void 0 ? void 0 : _a.getFix();\r\n }\r\n const fix = this.getFix(file, statement, statementNode, prevFix);\r\n const message = \"Chain mainly declarations\";\r\n issues.push(issue_1.Issue.atToken(file, statementNode.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n previousRow = statementNode.getColon().getStart().getRow();\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode, prevFix) {\r\n if (statement instanceof Statements.ClassDataBegin ||\r\n statement instanceof Statements.ClassDataEnd ||\r\n statement instanceof Statements.StaticBegin ||\r\n statement instanceof Statements.StaticEnd ||\r\n statement instanceof Statements.ConstantBegin ||\r\n statement instanceof Statements.ConstantEnd ||\r\n statement instanceof Statements.TypeBegin ||\r\n statement instanceof Statements.TypeEnd ||\r\n statement instanceof Statements.TypeEnumBegin ||\r\n statement instanceof Statements.TypeEnumEnd ||\r\n statement instanceof Statements.DataBegin ||\r\n statement instanceof Statements.DataEnd) {\r\n return undefined;\r\n }\r\n let replacement = statementNode.concatTokens();\r\n replacement = replacement.replace(\",\", \".\");\r\n let start;\r\n if (prevFix === undefined) {\r\n start = statementNode.getStart();\r\n }\r\n else {\r\n start = statementNode.getTokens()[1].getStart();\r\n }\r\n let fix = edit_helper_1.EditHelper.replaceRange(file, start, statementNode.getEnd(), replacement);\r\n if (prevFix !== undefined) {\r\n fix = edit_helper_1.EditHelper.merge(fix, prevFix);\r\n }\r\n return fix;\r\n }\r\n}\r\nexports.ChainMainlyDeclarations = ChainMainlyDeclarations;\r\n//# sourceMappingURL=chain_mainly_declarations.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/chain_mainly_declarations.js?");
|
|
11372
11405
|
|
|
11373
11406
|
/***/ }),
|
|
11374
11407
|
|
|
@@ -11379,7 +11412,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11379
11412
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11380
11413
|
|
|
11381
11414
|
"use strict";
|
|
11382
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckAbstract = exports.CheckAbstractConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckAbstractConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckAbstractConf = CheckAbstractConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n /** Abstract method defined in non-abstract class */\r\n IssueType[IssueType[\"NotAbstractClass\"] = 0] = \"NotAbstractClass\";\r\n IssueType[IssueType[\"AbstractAndFinal\"] = 1] = \"AbstractAndFinal\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckAbstract extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckAbstractConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_abstract\",\r\n title: \"Check abstract methods and classes\",\r\n shortDescription: `Checks abstract methods and classes:\n- class defined as abstract and final,\n- non-abstract class contains abstract methods`,\r\n extendedInformation: `If a class defines only constants, use an interface instead`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType, name) {\r\n switch (issueType) {\r\n case IssueType.AbstractAndFinal:\r\n return \"Classes should not be ABSTRACT and FINAL: \" + name;\r\n case IssueType.NotAbstractClass:\r\n return \"Abstract methods require abstract classes: \" + name;\r\n default:\r\n return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (classDef.isAbstract === true) {\r\n if (classDef.isFinal === true && classDef.isForTesting === false) {\r\n issues.push(issue_1.Issue.atIdentifier(classDef.identifier, this.getDescription(IssueType.AbstractAndFinal, classDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n continue;\r\n }\r\n for (const methodDef of classDef.methods) {\r\n if (methodDef.isAbstract === true) {\r\n issues.push(issue_1.Issue.atIdentifier(methodDef.identifier, this.getDescription(IssueType.NotAbstractClass, methodDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckAbstract = CheckAbstract;\r\n//# sourceMappingURL=check_abstract.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_abstract.js?");
|
|
11415
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckAbstract = exports.CheckAbstractConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckAbstractConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckAbstractConf = CheckAbstractConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n /** Abstract method defined in non-abstract class */\r\n IssueType[IssueType[\"NotAbstractClass\"] = 0] = \"NotAbstractClass\";\r\n IssueType[IssueType[\"AbstractAndFinal\"] = 1] = \"AbstractAndFinal\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckAbstract extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckAbstractConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_abstract\",\r\n title: \"Check abstract methods and classes\",\r\n shortDescription: `Checks abstract methods and classes:\r\n- class defined as abstract and final,\r\n- non-abstract class contains abstract methods`,\r\n extendedInformation: `If a class defines only constants, use an interface instead`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType, name) {\r\n switch (issueType) {\r\n case IssueType.AbstractAndFinal:\r\n return \"Classes should not be ABSTRACT and FINAL: \" + name;\r\n case IssueType.NotAbstractClass:\r\n return \"Abstract methods require abstract classes: \" + name;\r\n default:\r\n return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const classDef of file.getInfo().listClassDefinitions()) {\r\n if (classDef.isAbstract === true) {\r\n if (classDef.isFinal === true && classDef.isForTesting === false) {\r\n issues.push(issue_1.Issue.atIdentifier(classDef.identifier, this.getDescription(IssueType.AbstractAndFinal, classDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n continue;\r\n }\r\n for (const methodDef of classDef.methods) {\r\n if (methodDef.isAbstract === true) {\r\n issues.push(issue_1.Issue.atIdentifier(methodDef.identifier, this.getDescription(IssueType.NotAbstractClass, methodDef.name), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckAbstract = CheckAbstract;\r\n//# sourceMappingURL=check_abstract.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_abstract.js?");
|
|
11383
11416
|
|
|
11384
11417
|
/***/ }),
|
|
11385
11418
|
|
|
@@ -11390,7 +11423,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11390
11423
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11391
11424
|
|
|
11392
11425
|
"use strict";
|
|
11393
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckComments = exports.CheckCommentsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows the use of end-of-line comments. */\r\n this.allowEndOfLine = false;\r\n }\r\n}\r\nexports.CheckCommentsConf = CheckCommentsConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n IssueType[IssueType[\"EndOfLine\"] = 0] = \"EndOfLine\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckComments extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckCommentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_comments\",\r\n title: \"Check Comments\",\r\n shortDescription: `\nVarious checks for comment usage.`,\r\n extendedInformation: `\n* End of line comments. Comments starting with \"#EC\" or \"##\" are ignored\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType) {\r\n switch (issueType) {\r\n case IssueType.EndOfLine: return `Do not use end of line comments - move comment to previous row instead`;\r\n default: return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n if (this.conf.allowEndOfLine === true) {\r\n return [];\r\n }\r\n const commentRows = [];\r\n for (let i = 0; i < rows.length; i++) {\r\n const row = rows[i];\r\n if (row.trim().startsWith(\"*\") || row.trim().startsWith(`\"`)) {\r\n commentRows.push(i);\r\n }\r\n }\r\n const statements = file.getStatements();\r\n for (let i = statements.length - 1; i >= 0; i--) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment && !commentRows.includes(statement.getStart().getRow() - 1)) {\r\n if (statement.getFirstToken().getStr().startsWith(`\"#EC`)\r\n || statement.getFirstToken().getStr().startsWith(`\"##`)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckComments = CheckComments;\r\n//# sourceMappingURL=check_comments.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_comments.js?");
|
|
11426
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckComments = exports.CheckCommentsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckCommentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows the use of end-of-line comments. */\r\n this.allowEndOfLine = false;\r\n }\r\n}\r\nexports.CheckCommentsConf = CheckCommentsConf;\r\nvar IssueType;\r\n(function (IssueType) {\r\n IssueType[IssueType[\"EndOfLine\"] = 0] = \"EndOfLine\";\r\n})(IssueType || (IssueType = {}));\r\nclass CheckComments extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckCommentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_comments\",\r\n title: \"Check Comments\",\r\n shortDescription: `\r\nVarious checks for comment usage.`,\r\n extendedInformation: `\r\n* End of line comments. Comments starting with \"#EC\" or \"##\" are ignored\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#put-comments-before-the-statement-they-relate-to`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(issueType) {\r\n switch (issueType) {\r\n case IssueType.EndOfLine: return `Do not use end of line comments - move comment to previous row instead`;\r\n default: return \"\";\r\n }\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const rows = file.getRawRows();\r\n if (this.conf.allowEndOfLine === true) {\r\n return [];\r\n }\r\n const commentRows = [];\r\n for (let i = 0; i < rows.length; i++) {\r\n const row = rows[i];\r\n if (row.trim().startsWith(\"*\") || row.trim().startsWith(`\"`)) {\r\n commentRows.push(i);\r\n }\r\n }\r\n const statements = file.getStatements();\r\n for (let i = statements.length - 1; i >= 0; i--) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment && !commentRows.includes(statement.getStart().getRow() - 1)) {\r\n if (statement.getFirstToken().getStr().startsWith(`\"#EC`)\r\n || statement.getFirstToken().getStr().startsWith(`\"##`)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, this.getDescription(IssueType.EndOfLine), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.CheckComments = CheckComments;\r\n//# sourceMappingURL=check_comments.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_comments.js?");
|
|
11394
11427
|
|
|
11395
11428
|
/***/ }),
|
|
11396
11429
|
|
|
@@ -11412,7 +11445,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11412
11445
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11413
11446
|
|
|
11414
11447
|
"use strict";
|
|
11415
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckInclude = exports.CheckIncludeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckIncludeConf = CheckIncludeConf;\r\nclass CheckInclude {\r\n constructor() {\r\n this.conf = new CheckIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_include\",\r\n title: \"Check INCLUDEs\",\r\n shortDescription: `Checks INCLUDE statements`,\r\n extendedInformation: `\n* Reports unused includes\n* Errors if the includes are not found\n* Error if including a main program`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n this.graph = new include_graph_1.IncludeGraph(this.reg);\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const file of obj.getABAPFiles()) {\r\n ret = ret.concat(this.graph.getIssuesFile(file));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CheckInclude = CheckInclude;\r\n//# sourceMappingURL=check_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_include.js?");
|
|
11448
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckInclude = exports.CheckIncludeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckIncludeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckIncludeConf = CheckIncludeConf;\r\nclass CheckInclude {\r\n constructor() {\r\n this.conf = new CheckIncludeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_include\",\r\n title: \"Check INCLUDEs\",\r\n shortDescription: `Checks INCLUDE statements`,\r\n extendedInformation: `\r\n* Reports unused includes\r\n* Errors if the includes are not found\r\n* Error if including a main program`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n this.graph = new include_graph_1.IncludeGraph(this.reg);\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const file of obj.getABAPFiles()) {\r\n ret = ret.concat(this.graph.getIssuesFile(file));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.CheckInclude = CheckInclude;\r\n//# sourceMappingURL=check_include.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_include.js?");
|
|
11416
11449
|
|
|
11417
11450
|
/***/ }),
|
|
11418
11451
|
|
|
@@ -11423,7 +11456,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11423
11456
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11424
11457
|
|
|
11425
11458
|
"use strict";
|
|
11426
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckNoHandlerPragma = exports.CheckNoHandlerPragmaConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckNoHandlerPragmaConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckNoHandlerPragmaConf = CheckNoHandlerPragmaConf;\r\nclass CheckNoHandlerPragma extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckNoHandlerPragmaConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_no_handler_pragma\",\r\n title: \"Check if NO_HANDLER can be removed\",\r\n shortDescription: `Checks NO_HANDLER pragmas that can be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TRY.\n ...\n CATCH zcx_abapgit_exception ##NO_HANDLER.\n RETURN. \" it has a handler\nENDTRY.`,\r\n goodExample: `TRY.\n ...\n CATCH zcx_abapgit_exception.\n RETURN.\nENDTRY.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let noHandler = false;\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof Statements.EndTry) {\r\n noHandler = false;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (noHandler === true && !(statement.get() instanceof Statements.Catch)) {\r\n const message = \"NO_HANDLER pragma or pseudo comment can be removed\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n noHandler = false;\r\n }\r\n else {\r\n noHandler = this.containsNoHandler(statement, statements[i + 1]);\r\n }\r\n }\r\n return issues;\r\n }\r\n containsNoHandler(statement, next) {\r\n for (const t of statement.getPragmas()) {\r\n if (t.getStr().toUpperCase() === \"##NO_HANDLER\") {\r\n return true;\r\n }\r\n }\r\n if (next\r\n && next.get() instanceof _statement_1.Comment\r\n && next.concatTokens().toUpperCase().includes(\"#EC NO_HANDLER\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckNoHandlerPragma = CheckNoHandlerPragma;\r\n//# sourceMappingURL=check_no_handler_pragma.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_no_handler_pragma.js?");
|
|
11459
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckNoHandlerPragma = exports.CheckNoHandlerPragmaConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass CheckNoHandlerPragmaConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.CheckNoHandlerPragmaConf = CheckNoHandlerPragmaConf;\r\nclass CheckNoHandlerPragma extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckNoHandlerPragmaConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_no_handler_pragma\",\r\n title: \"Check if NO_HANDLER can be removed\",\r\n shortDescription: `Checks NO_HANDLER pragmas that can be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `TRY.\r\n ...\r\n CATCH zcx_abapgit_exception ##NO_HANDLER.\r\n RETURN. \" it has a handler\r\nENDTRY.`,\r\n goodExample: `TRY.\r\n ...\r\n CATCH zcx_abapgit_exception.\r\n RETURN.\r\nENDTRY.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let noHandler = false;\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof Statements.EndTry) {\r\n noHandler = false;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (noHandler === true && !(statement.get() instanceof Statements.Catch)) {\r\n const message = \"NO_HANDLER pragma or pseudo comment can be removed\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n noHandler = false;\r\n }\r\n else {\r\n noHandler = this.containsNoHandler(statement, statements[i + 1]);\r\n }\r\n }\r\n return issues;\r\n }\r\n containsNoHandler(statement, next) {\r\n for (const t of statement.getPragmas()) {\r\n if (t.getStr().toUpperCase() === \"##NO_HANDLER\") {\r\n return true;\r\n }\r\n }\r\n if (next\r\n && next.get() instanceof _statement_1.Comment\r\n && next.concatTokens().toUpperCase().includes(\"#EC NO_HANDLER\")) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckNoHandlerPragma = CheckNoHandlerPragma;\r\n//# sourceMappingURL=check_no_handler_pragma.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_no_handler_pragma.js?");
|
|
11427
11460
|
|
|
11428
11461
|
/***/ }),
|
|
11429
11462
|
|
|
@@ -11434,7 +11467,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11434
11467
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11435
11468
|
|
|
11436
11469
|
"use strict";
|
|
11437
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckSubrc = exports.CheckSubrcConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass CheckSubrcConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.openDataset = true;\r\n this.authorityCheck = true;\r\n this.selectSingle = true;\r\n this.selectTable = true;\r\n this.updateDatabase = true;\r\n this.insertDatabase = true;\r\n this.modifyDatabase = true;\r\n this.readTable = true;\r\n this.assign = true;\r\n this.find = true;\r\n }\r\n}\r\nexports.CheckSubrcConf = CheckSubrcConf;\r\nclass CheckSubrc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckSubrcConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_subrc\",\r\n title: \"Check sy-subrc\",\r\n shortDescription: `Check sy-subrc`,\r\n extendedInformation: `Pseudo comment \"#EC CI_SUBRC can be added to suppress findings\n\nIf sy-dbcnt is checked after database statements, it is considered okay.\n\n\"SELECT SINGLE @abap_true FROM \" is considered as an existence check\n\nIf IS ASSIGNED is checked after assigning, it is considered okay.\n\nFIND statement with MATCH COUNT is considered okay if subrc is not checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n pseudoComment: \"EC CI_SUBRC\",\r\n pragma: \"##SUBRC_OK\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const statements = file.getStatements();\r\n const message = \"Check sy-subrc\";\r\n const config = this.getConfig();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n // todo: CALL FUNCTION\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n if (config.openDataset === true\r\n && statement.get() instanceof Statements.OpenDataset\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.authorityCheck === true\r\n && statement.get() instanceof Statements.AuthorityCheck\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectSingle === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT SINGLE @ABAP_TRUE FROM \")) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectTable === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \") === false\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.updateDatabase === true\r\n && statement.get() instanceof Statements.UpdateDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.insertDatabase === true\r\n && statement.get() instanceof Statements.InsertDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.modifyDatabase === true\r\n && statement.get() instanceof Statements.ModifyDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.readTable === true\r\n && statement.get() instanceof Statements.ReadTable\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.assign === true\r\n && statement.get() instanceof Statements.Assign\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.find === true\r\n && statement.get() instanceof Statements.Find\r\n && this.isExemptedFind(statement) === false\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n isExemptedFind(s) {\r\n // see https://github.com/abaplint/abaplint/issues/2130\r\n return s.concatTokens().toUpperCase().includes(\" MATCH COUNT \") === true;\r\n }\r\n checksDbcnt(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n return concat.includes(\"SY-DBCNT\");\r\n }\r\n }\r\n return false;\r\n }\r\n isChecked(index, statements) {\r\n var _a, _b;\r\n let assigned = undefined;\r\n let assignedn = undefined;\r\n if (statements[index].get() instanceof Statements.Assign\r\n || statements[index].get() instanceof Statements.ReadTable) {\r\n const fs = (_b = (_a = statements[index].findFirstExpression(Expressions.FSTarget)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.FieldSymbol)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n assigned = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS ASSIGNED\";\r\n assignedn = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS NOT ASSIGNED\";\r\n }\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n if (concat.includes(\"\" + this.getMetadata().pseudoComment)) {\r\n return true;\r\n }\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n if (assigned && concat.includes(assigned)) {\r\n return true;\r\n }\r\n if (assignedn && concat.includes(assignedn)) {\r\n return true;\r\n }\r\n return concat.includes(\" SY-SUBRC\")\r\n || concat.includes(\"CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC\");\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckSubrc = CheckSubrc;\r\n//# sourceMappingURL=check_subrc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_subrc.js?");
|
|
11470
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CheckSubrc = exports.CheckSubrcConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass CheckSubrcConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.openDataset = true;\r\n this.authorityCheck = true;\r\n this.selectSingle = true;\r\n this.selectTable = true;\r\n this.updateDatabase = true;\r\n this.insertDatabase = true;\r\n this.modifyDatabase = true;\r\n this.readTable = true;\r\n this.assign = true;\r\n this.find = true;\r\n }\r\n}\r\nexports.CheckSubrcConf = CheckSubrcConf;\r\nclass CheckSubrc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CheckSubrcConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"check_subrc\",\r\n title: \"Check sy-subrc\",\r\n shortDescription: `Check sy-subrc`,\r\n extendedInformation: `Pseudo comment \"#EC CI_SUBRC can be added to suppress findings\r\n\r\nIf sy-dbcnt is checked after database statements, it is considered okay.\r\n\r\n\"SELECT SINGLE @abap_true FROM \" is considered as an existence check\r\n\r\nIf IS ASSIGNED is checked after assigning, it is considered okay.\r\n\r\nFIND statement with MATCH COUNT is considered okay if subrc is not checked`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n pseudoComment: \"EC CI_SUBRC\",\r\n pragma: \"##SUBRC_OK\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const statements = file.getStatements();\r\n const message = \"Check sy-subrc\";\r\n const config = this.getConfig();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n // todo: CALL FUNCTION\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n if (config.openDataset === true\r\n && statement.get() instanceof Statements.OpenDataset\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.authorityCheck === true\r\n && statement.get() instanceof Statements.AuthorityCheck\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectSingle === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \")\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT SINGLE @ABAP_TRUE FROM \")) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.selectTable === true\r\n && statement.get() instanceof Statements.Select\r\n && statement.concatTokens().toUpperCase().startsWith(\"SELECT SINGLE \") === false\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.updateDatabase === true\r\n && statement.get() instanceof Statements.UpdateDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.insertDatabase === true\r\n && statement.get() instanceof Statements.InsertDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.modifyDatabase === true\r\n && statement.get() instanceof Statements.ModifyDatabase\r\n && this.isChecked(i, statements) === false\r\n && this.checksDbcnt(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.readTable === true\r\n && statement.get() instanceof Statements.ReadTable\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.assign === true\r\n && statement.get() instanceof Statements.Assign\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n else if (config.find === true\r\n && statement.get() instanceof Statements.Find\r\n && this.isExemptedFind(statement) === false\r\n && this.isChecked(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n isExemptedFind(s) {\r\n // see https://github.com/abaplint/abaplint/issues/2130\r\n return s.concatTokens().toUpperCase().includes(\" MATCH COUNT \") === true;\r\n }\r\n checksDbcnt(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n return concat.includes(\"SY-DBCNT\");\r\n }\r\n }\r\n return false;\r\n }\r\n isChecked(index, statements) {\r\n var _a, _b;\r\n let assigned = undefined;\r\n let assignedn = undefined;\r\n if (statements[index].get() instanceof Statements.Assign\r\n || statements[index].get() instanceof Statements.ReadTable) {\r\n const fs = (_b = (_a = statements[index].findFirstExpression(Expressions.FSTarget)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.FieldSymbol)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n assigned = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS ASSIGNED\";\r\n assignedn = (fs === null || fs === void 0 ? void 0 : fs.toUpperCase()) + \" IS NOT ASSIGNED\";\r\n }\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n if (concat.includes(\"\" + this.getMetadata().pseudoComment)) {\r\n return true;\r\n }\r\n }\r\n else if (statement.get() instanceof Statements.EndIf) {\r\n continue;\r\n }\r\n else {\r\n if (assigned && concat.includes(assigned)) {\r\n return true;\r\n }\r\n if (assignedn && concat.includes(assignedn)) {\r\n return true;\r\n }\r\n return concat.includes(\" SY-SUBRC\")\r\n || concat.includes(\"CL_ABAP_UNIT_ASSERT=>ASSERT_SUBRC\");\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.CheckSubrc = CheckSubrc;\r\n//# sourceMappingURL=check_subrc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/check_subrc.js?");
|
|
11438
11471
|
|
|
11439
11472
|
/***/ }),
|
|
11440
11473
|
|
|
@@ -11511,7 +11544,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11511
11544
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11512
11545
|
|
|
11513
11546
|
"use strict";
|
|
11514
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CommentedCode = exports.CommentedCodeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst abap_parser_1 = __webpack_require__(/*! ../abap/abap_parser */ \"./node_modules/@abaplint/core/build/src/abap/abap_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nclass CommentedCodeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow INCLUDEs in function groups */\r\n this.allowIncludeInFugr = true;\r\n }\r\n}\r\nexports.CommentedCodeConf = CommentedCodeConf;\r\nclass CommentedCode extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CommentedCodeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"commented_code\",\r\n title: \"Find commented code\",\r\n shortDescription: `Detects usage of commented out code.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it\nhttps://docs.abapopenchecks.org/checks/14/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Commented code\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n const rows = file.getRawRows();\r\n let code = \"\";\r\n let posEnd = undefined;\r\n let posStart = undefined;\r\n for (let i = 0; i < rows.length; i++) {\r\n if (this.isCommentLine(rows[i])) {\r\n if (code === \"\") {\r\n posStart = new position_1.Position(i + 1, 1);\r\n }\r\n code = code + rows[i].trim().substr(1) + \"\\n\";\r\n posEnd = new position_1.Position(i + 1, rows[i].length + 1);\r\n }\r\n else if (code !== \"\" && posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n code = \"\";\r\n }\r\n }\r\n if (posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n }\r\n return issues;\r\n }\r\n check(code, file, posStart, posEnd, obj) {\r\n // assumption: code must end with \".\" in order to be valid ABAP\r\n if (code === \"\" || code.charAt(code.length - 1) !== \".\") {\r\n return [];\r\n }\r\n const commented = new memory_file_1.MemoryFile(\"_foobar.prog.abap\", code);\r\n const abapFile = new abap_parser_1.ABAPParser().parse([commented]).output[0];\r\n const statementNodes = abapFile.getStatements();\r\n if (statementNodes.length === 0) {\r\n return [];\r\n }\r\n let containsStatement = false;\r\n for (const statementNode of statementNodes) {\r\n const statement = statementNode.get();\r\n if (this.getConfig().allowIncludeInFugr === true\r\n && obj instanceof objects_1.FunctionGroup\r\n && statement instanceof statements_1.Include) {\r\n continue;\r\n }\r\n if (!(statement instanceof _statement_1.Unknown\r\n || statement instanceof _statement_1.Empty\r\n || statement instanceof _statement_1.Comment)) {\r\n containsStatement = true;\r\n break;\r\n }\r\n }\r\n if (!containsStatement) {\r\n return [];\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, posStart, posEnd);\r\n const issue = issue_1.Issue.atRange(file, posStart, posEnd, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n isCommentLine(text) {\r\n return (text.substr(0, 1) === \"*\")\r\n || (text.trim().substr(0, 1) === \"\\\"\" && text.trim().substr(1, 1) !== \"!\");\r\n }\r\n}\r\nexports.CommentedCode = CommentedCode;\r\n//# sourceMappingURL=commented_code.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/commented_code.js?");
|
|
11547
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.CommentedCode = exports.CommentedCodeConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst abap_parser_1 = __webpack_require__(/*! ../abap/abap_parser */ \"./node_modules/@abaplint/core/build/src/abap/abap_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst memory_file_1 = __webpack_require__(/*! ../files/memory_file */ \"./node_modules/@abaplint/core/build/src/files/memory_file.js\");\r\nclass CommentedCodeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allow INCLUDEs in function groups */\r\n this.allowIncludeInFugr = true;\r\n }\r\n}\r\nexports.CommentedCodeConf = CommentedCodeConf;\r\nclass CommentedCode extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new CommentedCodeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"commented_code\",\r\n title: \"Find commented code\",\r\n shortDescription: `Detects usage of commented out code.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#delete-code-instead-of-commenting-it\r\nhttps://docs.abapopenchecks.org/checks/14/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Commented code\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n const rows = file.getRawRows();\r\n let code = \"\";\r\n let posEnd = undefined;\r\n let posStart = undefined;\r\n for (let i = 0; i < rows.length; i++) {\r\n if (this.isCommentLine(rows[i])) {\r\n if (code === \"\") {\r\n posStart = new position_1.Position(i + 1, 1);\r\n }\r\n code = code + rows[i].trim().substr(1) + \"\\n\";\r\n posEnd = new position_1.Position(i + 1, rows[i].length + 1);\r\n }\r\n else if (code !== \"\" && posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n code = \"\";\r\n }\r\n }\r\n if (posStart && posEnd) {\r\n issues = issues.concat(this.check(code.trim(), file, posStart, posEnd, obj));\r\n }\r\n return issues;\r\n }\r\n check(code, file, posStart, posEnd, obj) {\r\n // assumption: code must end with \".\" in order to be valid ABAP\r\n if (code === \"\" || code.charAt(code.length - 1) !== \".\") {\r\n return [];\r\n }\r\n const commented = new memory_file_1.MemoryFile(\"_foobar.prog.abap\", code);\r\n const abapFile = new abap_parser_1.ABAPParser().parse([commented]).output[0];\r\n const statementNodes = abapFile.getStatements();\r\n if (statementNodes.length === 0) {\r\n return [];\r\n }\r\n let containsStatement = false;\r\n for (const statementNode of statementNodes) {\r\n const statement = statementNode.get();\r\n if (this.getConfig().allowIncludeInFugr === true\r\n && obj instanceof objects_1.FunctionGroup\r\n && statement instanceof statements_1.Include) {\r\n continue;\r\n }\r\n if (!(statement instanceof _statement_1.Unknown\r\n || statement instanceof _statement_1.Empty\r\n || statement instanceof _statement_1.Comment)) {\r\n containsStatement = true;\r\n break;\r\n }\r\n }\r\n if (!containsStatement) {\r\n return [];\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, posStart, posEnd);\r\n const issue = issue_1.Issue.atRange(file, posStart, posEnd, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n isCommentLine(text) {\r\n return (text.substr(0, 1) === \"*\")\r\n || (text.trim().substr(0, 1) === \"\\\"\" && text.trim().substr(1, 1) !== \"!\");\r\n }\r\n}\r\nexports.CommentedCode = CommentedCode;\r\n//# sourceMappingURL=commented_code.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/commented_code.js?");
|
|
11515
11548
|
|
|
11516
11549
|
/***/ }),
|
|
11517
11550
|
|
|
@@ -11533,7 +11566,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11533
11566
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11534
11567
|
|
|
11535
11568
|
"use strict";
|
|
11536
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstructorVisibilityPublic = exports.ConstructorVisibilityPublicConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nclass ConstructorVisibilityPublicConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ConstructorVisibilityPublicConf = ConstructorVisibilityPublicConf;\r\nclass ConstructorVisibilityPublic {\r\n constructor() {\r\n this.conf = new ConstructorVisibilityPublicConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constructor_visibility_public\",\r\n title: \"Check constructor visibility is public\",\r\n shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,\r\n extendedInformation: `\nThis only applies to global classes.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Constructor visibility should be public\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.Class)) {\r\n return [];\r\n }\r\n const def = obj.getClassDefinition();\r\n if (def === undefined) {\r\n return [];\r\n }\r\n for (const method of def.methods) {\r\n if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n && method.visibility !== visibility_1.Visibility.Public) {\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ConstructorVisibilityPublic = ConstructorVisibilityPublic;\r\n//# sourceMappingURL=constructor_visibility_public.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js?");
|
|
11569
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ConstructorVisibilityPublic = exports.ConstructorVisibilityPublicConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nclass ConstructorVisibilityPublicConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ConstructorVisibilityPublicConf = ConstructorVisibilityPublicConf;\r\nclass ConstructorVisibilityPublic {\r\n constructor() {\r\n this.conf = new ConstructorVisibilityPublicConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"constructor_visibility_public\",\r\n title: \"Check constructor visibility is public\",\r\n shortDescription: `Constructor must be placed in the public section, even if the class is not CREATE PUBLIC.`,\r\n extendedInformation: `\r\nThis only applies to global classes.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#if-your-global-class-is-create-private-leave-the-constructor-public\r\nhttps://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abeninstance_constructor_guidl.htm`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Constructor visibility should be public\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.Class)) {\r\n return [];\r\n }\r\n const def = obj.getClassDefinition();\r\n if (def === undefined) {\r\n return [];\r\n }\r\n for (const method of def.methods) {\r\n if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n && method.visibility !== visibility_1.Visibility.Public) {\r\n const issue = issue_1.Issue.atIdentifier(method.identifier, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ConstructorVisibilityPublic = ConstructorVisibilityPublic;\r\n//# sourceMappingURL=constructor_visibility_public.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/constructor_visibility_public.js?");
|
|
11537
11570
|
|
|
11538
11571
|
/***/ }),
|
|
11539
11572
|
|
|
@@ -11544,7 +11577,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11544
11577
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11545
11578
|
|
|
11546
11579
|
"use strict";
|
|
11547
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ContainsTab = exports.ContainsTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ContainsTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** quick fix replace with number of spaces */\r\n this.spaces = 1;\r\n }\r\n}\r\nexports.ContainsTabConf = ContainsTabConf;\r\nclass ContainsTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ContainsTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"contains_tab\",\r\n title: \"Code contains tab\",\r\n shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,\r\n extendedInformation: `\nhttps://docs.abapopenchecks.org/checks/09/\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Code should not contain tabs\";\r\n }\r\n getConfig() {\r\n if (this.conf.spaces === undefined) {\r\n this.conf.spaces = 1;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const lines = file.getRaw().split(\"\\n\");\r\n lines.forEach((_, i) => {\r\n const tabCol = lines[i].indexOf(\"\\t\");\r\n if (tabCol >= 0) {\r\n let tabAmount = 1;\r\n while (lines[i].indexOf(\"\\t\", tabCol + tabAmount - 1) >= 0) {\r\n tabAmount++;\r\n }\r\n issues.push(this.createIssue(i, tabCol, tabAmount, file));\r\n }\r\n });\r\n return issues;\r\n }\r\n createIssue(line, tabCol, tabAmount, file) {\r\n const tabStartPos = new position_1.Position(line + 1, tabCol + 1);\r\n const tabEndPos = new position_1.Position(line + 1, tabCol + tabAmount);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, tabStartPos, tabEndPos, \" \".repeat(this.getConfig().spaces));\r\n return issue_1.Issue.atRange(file, tabStartPos, tabEndPos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n}\r\nexports.ContainsTab = ContainsTab;\r\n//# sourceMappingURL=contains_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/contains_tab.js?");
|
|
11580
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ContainsTab = exports.ContainsTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ContainsTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** quick fix replace with number of spaces */\r\n this.spaces = 1;\r\n }\r\n}\r\nexports.ContainsTabConf = ContainsTabConf;\r\nclass ContainsTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ContainsTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"contains_tab\",\r\n title: \"Code contains tab\",\r\n shortDescription: `Checks for usage of tabs (enable to enforce spaces)`,\r\n extendedInformation: `\r\nhttps://docs.abapopenchecks.org/checks/09/\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Code should not contain tabs\";\r\n }\r\n getConfig() {\r\n if (this.conf.spaces === undefined) {\r\n this.conf.spaces = 1;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const lines = file.getRaw().split(\"\\n\");\r\n lines.forEach((_, i) => {\r\n const tabCol = lines[i].indexOf(\"\\t\");\r\n if (tabCol >= 0) {\r\n let tabAmount = 1;\r\n while (lines[i].indexOf(\"\\t\", tabCol + tabAmount - 1) >= 0) {\r\n tabAmount++;\r\n }\r\n issues.push(this.createIssue(i, tabCol, tabAmount, file));\r\n }\r\n });\r\n return issues;\r\n }\r\n createIssue(line, tabCol, tabAmount, file) {\r\n const tabStartPos = new position_1.Position(line + 1, tabCol + 1);\r\n const tabEndPos = new position_1.Position(line + 1, tabCol + tabAmount);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, tabStartPos, tabEndPos, \" \".repeat(this.getConfig().spaces));\r\n return issue_1.Issue.atRange(file, tabStartPos, tabEndPos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n}\r\nexports.ContainsTab = ContainsTab;\r\n//# sourceMappingURL=contains_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/contains_tab.js?");
|
|
11548
11581
|
|
|
11549
11582
|
/***/ }),
|
|
11550
11583
|
|
|
@@ -11577,7 +11610,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11577
11610
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11578
11611
|
|
|
11579
11612
|
"use strict";
|
|
11580
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DangerousStatement = exports.DangerousStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects execSQL (dynamic SQL) */\r\n this.execSQL = true;\r\n /** Detects kernel calls */\r\n this.kernelCall = true;\r\n /** Detects SYSTEM-CALL */\r\n this.systemCall = true;\r\n /** Detects INSERT REPORT */\r\n this.insertReport = true;\r\n this.generateDynpro = true;\r\n this.generateReport = true;\r\n this.generateSubroutine = true;\r\n this.deleteReport = true;\r\n this.deleteTextpool = true;\r\n this.deleteDynpro = true;\r\n this.importDynpro = true;\r\n /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */\r\n this.dynamicSQL = true;\r\n }\r\n}\r\nexports.DangerousStatementConf = DangerousStatementConf;\r\nclass DangerousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DangerousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"dangerous_statement\",\r\n title: \"Dangerous statement\",\r\n shortDescription: `Detects potentially dangerous statements`,\r\n extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,\ndynamic SQL can potentially create SQL injection problems`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Potential dangerous statement \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n if (this.conf.execSQL && statement instanceof Statements.ExecSQL) {\r\n message = \"EXEC SQL\";\r\n }\r\n else if (this.conf.kernelCall && statement instanceof Statements.CallKernel) {\r\n message = \"KERNEL CALL\";\r\n }\r\n else if (this.conf.systemCall && statement instanceof Statements.SystemCall) {\r\n message = \"SYSTEM-CALL\";\r\n }\r\n else if (this.conf.insertReport && statement instanceof Statements.InsertReport) {\r\n message = \"INSERT REPORT\";\r\n }\r\n else if (this.conf.generateDynpro && statement instanceof Statements.GenerateDynpro) {\r\n message = \"GENERATE DYNPRO\";\r\n }\r\n else if (this.conf.generateReport && statement instanceof Statements.GenerateReport) {\r\n message = \"GENERATE REPORT\";\r\n }\r\n else if (this.conf.generateSubroutine && statement instanceof Statements.GenerateSubroutine) {\r\n message = \"GENERATE SUBROUTINE\";\r\n }\r\n else if (this.conf.deleteReport && statement instanceof Statements.DeleteReport) {\r\n message = \"DELETE REPORT\";\r\n }\r\n else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {\r\n message = \"DELETE TEXTPOOL\";\r\n }\r\n else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {\r\n message = \"DELETE DYNPRO\";\r\n }\r\n else if (this.conf.importDynpro && statement instanceof Statements.ImportDynpro) {\r\n message = \"IMPORT DYNPRO\";\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n if (this.conf.dynamicSQL) {\r\n message = this.findDynamicSQL(statementNode);\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findDynamicSQL(statementNode) {\r\n const statement = statementNode.get();\r\n if (statement instanceof Statements.UpdateDatabase\r\n || statement instanceof Statements.Select\r\n || statement instanceof Statements.SelectLoop\r\n || statement instanceof Statements.InsertDatabase\r\n || statement instanceof Statements.ModifyDatabase\r\n || statement instanceof Statements.DeleteDatabase) {\r\n if (statementNode.findFirstExpression(Expressions.Dynamic)) {\r\n return \"Dynamic SQL\";\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.DangerousStatement = DangerousStatement;\r\n//# sourceMappingURL=dangerous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js?");
|
|
11613
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.DangerousStatement = exports.DangerousStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass DangerousStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects execSQL (dynamic SQL) */\r\n this.execSQL = true;\r\n /** Detects kernel calls */\r\n this.kernelCall = true;\r\n /** Detects SYSTEM-CALL */\r\n this.systemCall = true;\r\n /** Detects INSERT REPORT */\r\n this.insertReport = true;\r\n this.generateDynpro = true;\r\n this.generateReport = true;\r\n this.generateSubroutine = true;\r\n this.deleteReport = true;\r\n this.deleteTextpool = true;\r\n this.deleteDynpro = true;\r\n this.importDynpro = true;\r\n /** Finds instances of dynamic SQL: SELECT, UPDATE, DELETE, INSERT, MODIFY */\r\n this.dynamicSQL = true;\r\n }\r\n}\r\nexports.DangerousStatementConf = DangerousStatementConf;\r\nclass DangerousStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new DangerousStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"dangerous_statement\",\r\n title: \"Dangerous statement\",\r\n shortDescription: `Detects potentially dangerous statements`,\r\n extendedInformation: `Dynamic SQL: Typically ABAP logic does not need dynamic SQL,\r\ndynamic SQL can potentially create SQL injection problems`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Security],\r\n };\r\n }\r\n getDescription(statement) {\r\n return \"Potential dangerous statement \" + statement;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statementNode of file.getStatements()) {\r\n const statement = statementNode.get();\r\n let message = undefined;\r\n if (this.conf.execSQL && statement instanceof Statements.ExecSQL) {\r\n message = \"EXEC SQL\";\r\n }\r\n else if (this.conf.kernelCall && statement instanceof Statements.CallKernel) {\r\n message = \"KERNEL CALL\";\r\n }\r\n else if (this.conf.systemCall && statement instanceof Statements.SystemCall) {\r\n message = \"SYSTEM-CALL\";\r\n }\r\n else if (this.conf.insertReport && statement instanceof Statements.InsertReport) {\r\n message = \"INSERT REPORT\";\r\n }\r\n else if (this.conf.generateDynpro && statement instanceof Statements.GenerateDynpro) {\r\n message = \"GENERATE DYNPRO\";\r\n }\r\n else if (this.conf.generateReport && statement instanceof Statements.GenerateReport) {\r\n message = \"GENERATE REPORT\";\r\n }\r\n else if (this.conf.generateSubroutine && statement instanceof Statements.GenerateSubroutine) {\r\n message = \"GENERATE SUBROUTINE\";\r\n }\r\n else if (this.conf.deleteReport && statement instanceof Statements.DeleteReport) {\r\n message = \"DELETE REPORT\";\r\n }\r\n else if (this.conf.deleteTextpool && statement instanceof Statements.DeleteTextpool) {\r\n message = \"DELETE TEXTPOOL\";\r\n }\r\n else if (this.conf.deleteDynpro && statement instanceof Statements.DeleteDynpro) {\r\n message = \"DELETE DYNPRO\";\r\n }\r\n else if (this.conf.importDynpro && statement instanceof Statements.ImportDynpro) {\r\n message = \"IMPORT DYNPRO\";\r\n }\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n if (this.conf.dynamicSQL) {\r\n message = this.findDynamicSQL(statementNode);\r\n if (message) {\r\n issues.push(issue_1.Issue.atStatement(file, statementNode, this.getDescription(message), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findDynamicSQL(statementNode) {\r\n const statement = statementNode.get();\r\n if (statement instanceof Statements.UpdateDatabase\r\n || statement instanceof Statements.Select\r\n || statement instanceof Statements.SelectLoop\r\n || statement instanceof Statements.InsertDatabase\r\n || statement instanceof Statements.ModifyDatabase\r\n || statement instanceof Statements.DeleteDatabase) {\r\n if (statementNode.findFirstExpression(Expressions.Dynamic)) {\r\n return \"Dynamic SQL\";\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.DangerousStatement = DangerousStatement;\r\n//# sourceMappingURL=dangerous_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/dangerous_statement.js?");
|
|
11581
11614
|
|
|
11582
11615
|
/***/ }),
|
|
11583
11616
|
|
|
@@ -11632,7 +11665,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11632
11665
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11633
11666
|
|
|
11634
11667
|
"use strict";
|
|
11635
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\na higher level language version. If successful, various rules are applied to downport the statement.\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\n\nCurrent rules:\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\n* FIELD-SYMBOL() definitions are outlined\n* CONV is outlined\n* COND is outlined\n* REDUCE is outlined\n* SWITCH is outlined\n* APPEND expression is outlined\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\n* CAST changed to ?=\n* LOOP AT method_call( ) is outlined\n* VALUE # with structure fields\n* VALUE # with internal table lines\n* Table Expressions are outlined\n* SELECT INTO @DATA definitions are outlined\n* Some occurrences of string template formatting option ALPHA changed to function module call\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\n* RAISE EXCEPTION ... MESSAGE\n* Moving with +=, -=, /=, *=, &&= is expanded\n* line_exists and line_index is downported to READ TABLE\n\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n this.graph = new include_graph_1.IncludeGraph(reg);\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.graph.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\n${indentation}IF sy-subrc <> 0.\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\n${indentation}ENDIF.\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a;\r\n if (node.get() instanceof Statements.Raise) {\r\n const startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken === undefined) {\r\n return undefined;\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n const id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n let number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n const className = ((_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\n${indentation}${uniqueName1}-msgid = ${id}.\n${indentation}${uniqueName1}-msgno = ${number}.\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n moveWithSimpleValue(high, lowFile) {\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, Reduce statement\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\n${indentation} EXPORTING\n${indentation} input = ${source}\n${indentation} IMPORTING\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation) {\r\n var _a, _b, _c, _d, _e, _f;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")) {\r\n const name = (_c = forLoop.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n body += indentation + \"DATA \" + name + \" TYPE i.\\n\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `WHILE NOT ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n const field = (_e = (_d = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _d === void 0 ? void 0 : _d.findFirstExpression(Expressions.Field)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + ` ${field} = ${field} + 1.\\n`;\r\n end = \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n const loopTargetFieldSymbol = (_f = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_a = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_b = switchBody.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} TYPE ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_a = reduceBody.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()}.\\n`;\r\n }\r\n const forLoop = reduceBody.findDirectExpression(Expressions.For);\r\n if (forLoop === undefined) {\r\n continue;\r\n }\r\n const outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n if (n.concatTokens().toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.concatTokens() === \"=\") {\r\n body += \" = \";\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + n.concatTokens();\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += n.concatTokens() + \".\\n\";\r\n }\r\n }\r\n body += indentation + outlineFor.end + `.\\n`;\r\n body += indentation + `${uniqueName} = ${name}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n var _a;\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const forLoop = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectExpression(Expressions.For);\r\n let outlineFor = { body: \"\", end: \"\" };\r\n if (forLoop !== undefined) {\r\n outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n indentation += \" \";\r\n }\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n structureName = b.concatTokens();\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n if (forLoop !== undefined) {\r\n indentation = indentation.substring(2);\r\n body += indentation + outlineFor.end + `.\\n`;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (node.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = node.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE REF TO ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
|
|
11668
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Downport = exports.DownportConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst registry_1 = __webpack_require__(/*! ../registry */ \"./node_modules/@abaplint/core/build/src/registry.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst _typed_identifier_1 = __webpack_require__(/*! ../abap/types/_typed_identifier */ \"./node_modules/@abaplint/core/build/src/abap/types/_typed_identifier.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst config_1 = __webpack_require__(/*! ../config */ \"./node_modules/@abaplint/core/build/src/config.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst include_graph_1 = __webpack_require__(/*! ../utils/include_graph */ \"./node_modules/@abaplint/core/build/src/utils/include_graph.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\n// todo: refactor each sub-rule to new classes?\r\n// todo: add configuration\r\nclass DownportConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.DownportConf = DownportConf;\r\nclass Downport {\r\n constructor() {\r\n this.conf = new DownportConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"downport\",\r\n title: \"Downport statement\",\r\n shortDescription: `Experimental downport functionality`,\r\n extendedInformation: `Much like the 'commented_code' rule this rule loops through unknown statements and tries parsing with\r\na higher level language version. If successful, various rules are applied to downport the statement.\r\nTarget downport version is always v702, thus rule is only enabled if target version is v702.\r\n\r\nCurrent rules:\r\n* NEW transformed to CREATE OBJECT, opposite of https://rules.abaplint.org/use_new/\r\n* DATA() definitions are outlined, opposite of https://rules.abaplint.org/prefer_inline/\r\n* FIELD-SYMBOL() definitions are outlined\r\n* CONV is outlined\r\n* COND is outlined\r\n* REDUCE is outlined\r\n* SWITCH is outlined\r\n* APPEND expression is outlined\r\n* EMPTY KEY is changed to DEFAULT KEY, opposite of DEFAULT KEY in https://rules.abaplint.org/avoid_use/\r\n* CAST changed to ?=\r\n* LOOP AT method_call( ) is outlined\r\n* VALUE # with structure fields\r\n* VALUE # with internal table lines\r\n* Table Expressions are outlined\r\n* SELECT INTO @DATA definitions are outlined\r\n* Some occurrences of string template formatting option ALPHA changed to function module call\r\n* SELECT/INSERT/MODIFY/DELETE/UPDATE \",\" in field list removed, \"@\" in source/targets removed\r\n* PARTIALLY IMPLEMENTED removed, it can be quick fixed via rule implement_methods\r\n* RAISE EXCEPTION ... MESSAGE\r\n* Moving with +=, -=, /=, *=, &&= is expanded\r\n* line_exists and line_index is downported to READ TABLE\r\n\r\nOnly one transformation is applied to a statement at a time, so multiple steps might be required to do the full downport.`,\r\n tags: [_irule_1.RuleTag.Experimental, _irule_1.RuleTag.Downport, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.lowReg = reg;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version === version_1.Version.v702 || version === version_1.Version.OpenABAP) {\r\n this.initHighReg();\r\n this.graph = new include_graph_1.IncludeGraph(reg);\r\n }\r\n return this;\r\n }\r\n run(lowObj) {\r\n var _a;\r\n const ret = [];\r\n this.counter = 1;\r\n const version = this.lowReg.getConfig().getVersion();\r\n if (version !== version_1.Version.v702 && version !== version_1.Version.OpenABAP) {\r\n return ret;\r\n }\r\n else if (!(lowObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n const highObj = this.highReg.getObject(lowObj.getType(), lowObj.getName());\r\n if (highObj === undefined || !(highObj instanceof _abap_object_1.ABAPObject)) {\r\n return ret;\r\n }\r\n let highSyntaxObj = highObj;\r\n // for includes do the syntax check via a main program\r\n if (lowObj instanceof objects_1.Program && lowObj.isInclude()) {\r\n const mains = this.graph.listMainForInclude((_a = lowObj.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getFilename());\r\n if (mains.length <= 0) {\r\n return [];\r\n }\r\n const f = this.highReg.getFileByName(mains[0]);\r\n if (f === undefined) {\r\n return [];\r\n }\r\n highSyntaxObj = this.highReg.findObjectForFile(f);\r\n }\r\n const highSyntax = new syntax_1.SyntaxLogic(this.highReg, highSyntaxObj).run();\r\n for (const lowFile of lowObj.getABAPFiles()) {\r\n const highFile = highObj.getABAPFileByName(lowFile.getFilename());\r\n if (highFile === undefined) {\r\n continue;\r\n }\r\n const lowStatements = lowFile.getStatements();\r\n const highStatements = highFile.getStatements();\r\n if (lowStatements.length !== highStatements.length) {\r\n // after applying a fix, there might be more statements in lowFile\r\n // should highReg be initialized again?\r\n /*\r\n const message = \"Internal Error: Statement lengths does not match\";\r\n ret.push(Issue.atStatement(lowFile, lowStatements[0], message, this.getMetadata().key));\r\n */\r\n continue;\r\n }\r\n for (let i = 0; i < lowStatements.length; i++) {\r\n const low = lowStatements[i];\r\n const high = highStatements[i];\r\n if ((low.get() instanceof _statement_1.Unknown && !(high.get() instanceof _statement_1.Unknown))\r\n || high.findFirstExpression(Expressions.InlineData)) {\r\n const issue = this.checkStatement(low, high, lowFile, highSyntax);\r\n if (issue) {\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n ////////////////////\r\n /** clones the orginal repository into highReg, and parses it with higher language version */\r\n initHighReg() {\r\n // use default configuration, ie. default target version\r\n const highConfig = config_1.Config.getDefault().get();\r\n const lowConfig = this.lowReg.getConfig().get();\r\n highConfig.syntax.errorNamespace = lowConfig.syntax.errorNamespace;\r\n highConfig.syntax.globalConstants = lowConfig.syntax.globalConstants;\r\n highConfig.syntax.globalMacros = lowConfig.syntax.globalMacros;\r\n this.highReg = new registry_1.Registry();\r\n for (const o of this.lowReg.getObjects()) {\r\n for (const f of o.getFiles()) {\r\n if (this.lowReg.isDependency(o) === true) {\r\n this.highReg.addDependency(f);\r\n }\r\n else {\r\n this.highReg.addFile(f);\r\n }\r\n }\r\n }\r\n this.highReg.parse();\r\n }\r\n /** applies one rule at a time, multiple iterations are required to transform complex statements */\r\n checkStatement(low, high, lowFile, highSyntax) {\r\n if (low.getFirstToken().getStart() instanceof position_1.VirtualPosition) {\r\n return undefined;\r\n }\r\n let found = this.partiallyImplemented(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.raiseException(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.emptyKey(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.stringTemplateAlpha(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithOperator(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.moveWithSimpleValue(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSQLExtras(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopInput(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineLoopTarget(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineValue(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineReduce(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineSwitch(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCast(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineConv(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCond(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineCatchSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineDataSimple(high, lowFile);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineData(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.outlineFS(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.newToCreateObject(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceXsdBool(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceLineFunctions(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceTableExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.replaceAppendExpression(high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n //////////////////////////////////////////\r\n downportSQLExtras(low, high, lowFile, _highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n if (!(high.get() instanceof Statements.Select)\r\n && !(high.get() instanceof Statements.SelectLoop)\r\n && !(high.get() instanceof Statements.UpdateDatabase)\r\n && !(high.get() instanceof Statements.ModifyDatabase)\r\n && !(high.get() instanceof Statements.DeleteDatabase)\r\n && !(high.get() instanceof Statements.InsertDatabase)) {\r\n return undefined;\r\n }\r\n let fix = undefined;\r\n const addFix = (token) => {\r\n const add = edit_helper_1.EditHelper.deleteToken(lowFile, token);\r\n if (fix === undefined) {\r\n fix = add;\r\n }\r\n else {\r\n fix = edit_helper_1.EditHelper.merge(fix, add);\r\n }\r\n };\r\n const candidates = [high.findAllExpressionsRecursive(Expressions.SQLTarget),\r\n high.findAllExpressionsRecursive(Expressions.SQLSource),\r\n high.findAllExpressionsRecursive(Expressions.SQLSourceSimple)].flat();\r\n for (const c of candidates) {\r\n if (c.getFirstToken() instanceof tokens_1.WAt) {\r\n addFix(c.getFirstToken());\r\n }\r\n }\r\n for (const fieldList of high.findAllExpressionsMulti([Expressions.SQLFieldList, Expressions.SQLFieldListLoop], true)) {\r\n for (const token of fieldList.getDirectTokens()) {\r\n if (token.getStr() === \",\") {\r\n addFix(token);\r\n }\r\n }\r\n }\r\n if (fix === undefined) {\r\n return undefined;\r\n }\r\n else {\r\n return issue_1.Issue.atToken(lowFile, low.getFirstToken(), \"SQL, remove \\\" and ,\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n downportSelectInline(low, high, lowFile, highSyntax) {\r\n if (!(low.get() instanceof _statement_1.Unknown)) {\r\n return undefined;\r\n }\r\n else if (!(high.get() instanceof Statements.Select) && !(high.get() instanceof Statements.SelectLoop)) {\r\n return undefined;\r\n }\r\n // as first step outline the @DATA, note that void types are okay, as long the field names are specified\r\n let found = this.downportSelectSingleInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n found = this.downportSelectTableInline(low, high, lowFile, highSyntax);\r\n if (found) {\r\n return found;\r\n }\r\n return undefined;\r\n }\r\n downportSelectSingleInline(_low, high, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoStructure)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length !== 1) {\r\n return undefined;\r\n }\r\n const tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n let fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n fieldList = high.findFirstExpression(Expressions.SQLFieldListLoop);\r\n }\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinition = \"\";\r\n const fields = fieldList.findDirectExpressions(Expressions.SQLFieldName);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n if (fields.length === 1) {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${fields[0].concatTokens()}.`;\r\n }\r\n else if (fieldList.concatTokens() === \"*\") {\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}.`;\r\n }\r\n else if (fieldList.concatTokens().toUpperCase() === \"COUNT( * )\") {\r\n fieldDefinition = `DATA ${name} TYPE i.`;\r\n }\r\n else if (fieldList.getChildren().length === 1 && fieldList.getChildren()[0].get() instanceof Expressions.SQLAggregation) {\r\n const c = fieldList.getChildren()[0];\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n const concat = (_d = c.findFirstExpression(Expressions.SQLArithmetics)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n fieldDefinition = `DATA ${name} TYPE ${tableName}-${concat}.`;\r\n }\r\n }\r\n else {\r\n for (const f of fields) {\r\n const fieldName = f.concatTokens();\r\n fieldDefinition += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n fieldDefinition = `DATA: BEGIN OF ${name},\r\n${fieldDefinition}${indentation} END OF ${name}.`;\r\n }\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `${fieldDefinition}\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n downportSelectTableInline(_low, high, lowFile, highSyntax) {\r\n var _a, _b, _c;\r\n const targets = ((_a = high.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.SQLTarget)) || [];\r\n if (targets.length !== 1) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const inlineData = targets[0].findFirstExpression(Expressions.InlineData);\r\n if (inlineData === undefined) {\r\n return undefined;\r\n }\r\n const sqlFrom = high.findAllExpressions(Expressions.SQLFromSource);\r\n if (sqlFrom.length === 0) {\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Error outlining, sqlFrom not found\", this.getMetadata().key, this.conf.severity);\r\n }\r\n let tableName = (_b = sqlFrom[0].findDirectExpression(Expressions.DatabaseTable)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (tableName === undefined) {\r\n return undefined;\r\n }\r\n const fieldList = high.findFirstExpression(Expressions.SQLFieldList);\r\n if (fieldList === undefined) {\r\n return undefined;\r\n }\r\n let fieldDefinitions = \"\";\r\n for (const f of fieldList.findDirectExpressions(Expressions.SQLFieldName)) {\r\n let fieldName = f.concatTokens();\r\n if (fieldName.includes(\"~\")) {\r\n const split = fieldName.split(\"~\");\r\n tableName = split[0];\r\n fieldName = split[1];\r\n }\r\n fieldDefinitions += indentation + \" \" + fieldName + \" TYPE \" + tableName + \"-\" + fieldName + \",\\n\";\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const name = ((_c = inlineData.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"error\";\r\n let fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `TYPES: BEGIN OF ${uniqueName},\r\n${fieldDefinitions}${indentation} END OF ${uniqueName}.\r\n${indentation}DATA ${name} TYPE STANDARD TABLE OF ${uniqueName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n if (fieldDefinitions === \"\") {\r\n fix1 = edit_helper_1.EditHelper.insertAt(lowFile, high.getStart(), `DATA ${name} TYPE STANDARD TABLE OF ${tableName} WITH DEFAULT KEY.\r\n${indentation}`);\r\n }\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, inlineData.getFirstToken().getStart(), inlineData.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, inlineData.getFirstToken(), \"Outline SELECT @DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n replaceAppendExpression(high, lowFile, highSyntax) {\r\n if (!(high.get() instanceof Statements.Append)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n if (children[1].get() instanceof Expressions.Source) {\r\n const source = children[1];\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(high.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = high.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${target === null || target === void 0 ? void 0 : target.concatTokens()}.\r\n${indentation}${uniqueName} = ${source.concatTokens()}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, source.getFirstToken().getStart(), source.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Outline APPEND source expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n replaceTableExpression(node, lowFile, highSyntax) {\r\n for (const fieldChain of node.findAllExpressionsRecursive(Expressions.FieldChain)) {\r\n const tableExpression = fieldChain.findDirectExpression(Expressions.TableExpression);\r\n if (tableExpression === undefined) {\r\n continue;\r\n }\r\n const concat = node.concatTokens().toUpperCase();\r\n if (concat.includes(\" LINE_EXISTS( \") || concat.includes(\" LINE_INDEX( \")) {\r\n // note: line_exists() must be replaced before handling table expressions\r\n continue;\r\n }\r\n let pre = \"\";\r\n let startToken = undefined;\r\n for (const child of fieldChain.getChildren()) {\r\n if (startToken === undefined) {\r\n startToken = child.getFirstToken();\r\n }\r\n else if (child === tableExpression) {\r\n break;\r\n }\r\n pre += child.concatTokens();\r\n }\r\n if (startToken === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of tableExpression.getChildren() || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${uniqueName} LIKE LINE OF ${pre}.\r\n${indentation}READ TABLE ${pre} ${condition}INTO ${uniqueName}.\r\n${indentation}IF sy-subrc <> 0.\r\n${indentation} RAISE EXCEPTION TYPE cx_sy_itab_line_not_found.\r\n${indentation}ENDIF.\r\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, startToken.getStart(), tableExpression.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline table expression\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCatchSimple(node, lowFile) {\r\n // outlines \"CATCH cx_bcs INTO DATA(lx_bcs_excep).\", note that this does not need to look at types\r\n var _a, _b;\r\n if (!(node.get() instanceof Statements.Catch)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n const classNames = node.findDirectExpressions(Expressions.ClassName);\r\n if (classNames.length !== 1) {\r\n return undefined;\r\n }\r\n const className = classNames[0].concatTokens();\r\n const targetName = (_b = target.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const code = ` DATA ${targetName} TYPE REF TO ${className}.\r\n${indentation}CATCH ${className} INTO ${targetName}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineDataSimple(node, lowFile) {\r\n // outlines \"DATA(ls_msg) = temp1.\", note that this does not need to look at types\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const target = node.findFirstExpression(Expressions.Target);\r\n if (!(((_a = target === null || target === void 0 ? void 0 : target.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.InlineData)) {\r\n return undefined;\r\n }\r\n let type = \"\";\r\n const source = node.findFirstExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n else if (source.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n else if (!(((_b = source.getFirstChild()) === null || _b === void 0 ? void 0 : _b.get()) instanceof Expressions.FieldChain)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldOffset)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.FieldLength)) {\r\n return undefined;\r\n }\r\n else if (source.findFirstExpression(Expressions.TableExpression)) {\r\n const chain = source.findDirectExpression(Expressions.FieldChain);\r\n if (chain !== undefined\r\n && chain.getChildren().length === 2\r\n && chain.getChildren()[0].get() instanceof Expressions.SourceField\r\n && chain.getChildren()[1].get() instanceof Expressions.TableExpression) {\r\n type = \"LINE OF \" + chain.getChildren()[0].concatTokens();\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n else {\r\n type = source.concatTokens();\r\n }\r\n const targetName = (_c = target.findFirstExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const firstToken = node.getFirstToken();\r\n const lastToken = node.getLastToken();\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, firstToken.getStart(), `DATA ${targetName} LIKE ${type}.\\n${indentation}`);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), lastToken.getEnd(), `${targetName} = ${source.concatTokens()}.`);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n partiallyImplemented(node, lowFile) {\r\n if (node.get() instanceof Statements.InterfaceDef) {\r\n const partially = node.findDirectTokenByText(\"PARTIALLY\");\r\n if (partially === undefined) {\r\n return undefined;\r\n }\r\n const implemented = node.findDirectTokenByText(\"IMPLEMENTED\");\r\n if (implemented === undefined) {\r\n return undefined;\r\n }\r\n const fix = edit_helper_1.EditHelper.deleteRange(lowFile, partially.getStart(), implemented.getEnd());\r\n return issue_1.Issue.atToken(lowFile, partially, \"Downport PARTIALLY IMPLEMENTED\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n raiseException(node, lowFile, highSyntax) {\r\n /*\r\n Note: IF_T100_DYN_MSG does not exist in 702, so this rule is mostly relevant for the transpiler\r\n \r\n DATA foo LIKE if_t100_message=>t100key.\r\n foo-msgid = 'ZHVAM'.\r\n foo-msgno = '001'.\r\n foo-attr1 = 'IF_T100_DYN_MSG~MSGV1'.\r\n foo-attr2 = 'IF_T100_DYN_MSG~MSGV2'.\r\n foo-attr3 = 'IF_T100_DYN_MSG~MSGV3'.\r\n foo-attr4 = 'IF_T100_DYN_MSG~MSGV4'.\r\n DATA bar TYPE REF TO zcl_hvam_exception.\r\n CREATE OBJECT bar EXPORTING textid = foo.\r\n bar->if_t100_dyn_msg~msgty = 'E'.\r\n bar->if_t100_dyn_msg~msgv1 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv2 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv3 = 'abc'.\r\n bar->if_t100_dyn_msg~msgv4 = 'abc'.\r\n RAISE EXCEPTION bar.\r\n */\r\n var _a;\r\n if (node.get() instanceof Statements.Raise) {\r\n const startToken = node.findDirectTokenByText(\"ID\");\r\n if (startToken === undefined) {\r\n return undefined;\r\n }\r\n const sources = node.findDirectExpressions(Expressions.Source);\r\n const id = sources[0].concatTokens();\r\n const numberExpression = node.findExpressionAfterToken(\"NUMBER\");\r\n if (numberExpression === undefined) {\r\n throw \"downport raiseException, could not find number\";\r\n }\r\n let number = numberExpression.concatTokens();\r\n if (numberExpression.get() instanceof Expressions.MessageNumber) {\r\n number = \"'\" + number + \"'\";\r\n }\r\n const className = ((_a = node.findDirectExpression(Expressions.ClassName)) === null || _a === void 0 ? void 0 : _a.concatTokens()) || \"ERROR\";\r\n const uniqueName1 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const uniqueName2 = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName1} LIKE if_t100_message=>t100key.\r\n${indentation}${uniqueName1}-msgid = ${id}.\r\n${indentation}${uniqueName1}-msgno = ${number}.\r\n${indentation}DATA ${uniqueName2} TYPE REF TO ${className}.\r\n${indentation}CREATE OBJECT ${uniqueName2} EXPORTING textid = ${uniqueName1}.\r\n${indentation}RAISE EXCEPTION ${uniqueName2}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getStart(), node.getEnd(), abap);\r\n return issue_1.Issue.atToken(lowFile, startToken, \"Downport RAISE MESSAGE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n emptyKey(node, lowFile) {\r\n for (let i of node.findAllExpressions(Expressions.TypeTable)) {\r\n const key = i.findDirectExpression(Expressions.TypeTableKey);\r\n if (key === undefined) {\r\n continue;\r\n }\r\n i = key;\r\n const concat = i.concatTokens();\r\n if (concat.toUpperCase().includes(\"WITH EMPTY KEY\") === false) {\r\n continue;\r\n }\r\n const token = i.findDirectTokenByText(\"EMPTY\");\r\n if (token === undefined) {\r\n continue;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceToken(lowFile, token, \"DEFAULT\");\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport EMPTY KEY\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n moveWithSimpleValue(high, lowFile) {\r\n if (!(high.get() instanceof Statements.Move)\r\n || high.getChildren().length !== 4) {\r\n return undefined;\r\n }\r\n const target = high.findDirectExpression(Expressions.Target);\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const source = high.findDirectExpression(Expressions.Source);\r\n if (source === undefined) {\r\n return undefined;\r\n }\r\n const field = target.findDirectExpression(Expressions.TargetField);\r\n if (field === undefined) {\r\n return;\r\n }\r\n const valueBody = source.findDirectExpression(Expressions.ValueBody);\r\n if (valueBody === undefined || valueBody.getChildren().length !== 1) {\r\n return;\r\n }\r\n const fieldAssignment = valueBody.findDirectExpression(Expressions.FieldAssignment);\r\n if (fieldAssignment === undefined) {\r\n return;\r\n }\r\n const indentation = \" \".repeat(high.getFirstToken().getStart().getCol() - 1);\r\n const code = `CLEAR ${target.concatTokens()}.\\n` + indentation + target.concatTokens() + \"-\" + fieldAssignment.concatTokens();\r\n const start = high.getFirstToken().getStart();\r\n const end = high.getLastToken().getStart();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, code);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Downport, Reduce statement\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n moveWithOperator(high, lowFile) {\r\n var _a, _b, _c;\r\n if (!(high.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const children = high.getChildren();\r\n const secondChild = children[1];\r\n if (secondChild === undefined) {\r\n return undefined;\r\n }\r\n const op = secondChild.getFirstToken();\r\n let operator = \"\";\r\n switch (op.getStr()) {\r\n case \"+\":\r\n operator = \" + \";\r\n break;\r\n case \"-\":\r\n operator = \" - \";\r\n break;\r\n case \"/=\":\r\n operator = \" / \";\r\n break;\r\n case \"*=\":\r\n operator = \" * \";\r\n break;\r\n case \"&&=\":\r\n operator = \" && \";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const target = (_a = high.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return;\r\n }\r\n const sourceStart = (_c = (_b = high.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstChild()) === null || _c === void 0 ? void 0 : _c.getFirstToken().getStart();\r\n if (sourceStart === undefined) {\r\n return;\r\n }\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, op.getStart(), sourceStart, \"= \" + target + operator);\r\n return issue_1.Issue.atToken(lowFile, high.getFirstToken(), \"Expand operator\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n // must be very simple string templates, like \"|{ ls_line-no ALPHA = IN }|\"\r\n stringTemplateAlpha(node, lowFile) {\r\n var _a, _b, _c;\r\n if (!(node.get() instanceof Statements.Move)) {\r\n return undefined;\r\n }\r\n const topSource = node.findDirectExpression(Expressions.Source);\r\n if (topSource === undefined || topSource.getChildren().length !== 1) {\r\n return undefined;\r\n }\r\n const child = topSource.getFirstChild();\r\n if (!(child.get() instanceof Expressions.StringTemplate)) {\r\n return undefined;\r\n }\r\n const templateTokens = child.getChildren();\r\n if (templateTokens.length !== 3\r\n || templateTokens[0].getFirstToken().getStr() !== \"|{\"\r\n || templateTokens[2].getFirstToken().getStr() !== \"}|\") {\r\n return undefined;\r\n }\r\n const templateSource = child.findDirectExpression(Expressions.StringTemplateSource);\r\n const formatting = (_a = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.StringTemplateFormatting)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n let functionName = \"\";\r\n switch (formatting) {\r\n case \"ALPHA = IN\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_INPUT\";\r\n break;\r\n case \"ALPHA = OUT\":\r\n functionName = \"CONVERSION_EXIT_ALPHA_OUTPUT\";\r\n break;\r\n default:\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const source = (_b = templateSource === null || templateSource === void 0 ? void 0 : templateSource.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n const topTarget = (_c = node.findDirectExpression(Expressions.Target)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n const code = `CALL FUNCTION '${functionName}'\r\n${indentation} EXPORTING\r\n${indentation} input = ${source}\r\n${indentation} IMPORTING\r\n${indentation} output = ${topTarget}.`;\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), code);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Downport ALPHA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopInput(node, lowFile, highSyntax) {\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n else if (node.findDirectExpression(Expressions.SimpleSource2)) {\r\n return undefined;\r\n }\r\n // the first Source must be outlined\r\n const s = node.findDirectExpression(Expressions.Source);\r\n if (s === undefined) {\r\n return undefined;\r\n }\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const code = `DATA(${uniqueName}) = ${s.concatTokens()}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, s.getFirstToken().getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP input\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n outlineLoopTarget(node, lowFile, _highSyntax) {\r\n var _a, _b, _c, _d, _e;\r\n // also allows outlining of voided types\r\n if (!(node.get() instanceof Statements.Loop)) {\r\n return undefined;\r\n }\r\n const sourceName = (_a = node.findDirectExpression(Expressions.SimpleSource2)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (sourceName === undefined) {\r\n return undefined;\r\n }\r\n const concat = node.concatTokens();\r\n if (concat.includes(\" REFERENCE INTO \")) {\r\n return undefined;\r\n }\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const dataTarget = (_b = node.findDirectExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.InlineData);\r\n if (dataTarget) {\r\n const targetName = ((_c = dataTarget.findDirectExpression(Expressions.TargetField)) === null || _c === void 0 ? void 0 : _c.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `DATA ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, dataTarget.getFirstToken().getStart(), dataTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP data target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n const fsTarget = (_d = node.findDirectExpression(Expressions.FSTarget)) === null || _d === void 0 ? void 0 : _d.findDirectExpression(Expressions.InlineFS);\r\n if (fsTarget) {\r\n const targetName = ((_e = fsTarget.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _e === void 0 ? void 0 : _e.concatTokens()) || \"DOWNPORT_ERROR\";\r\n const code = `FIELD-SYMBOLS ${targetName} LIKE LINE OF ${sourceName}.\\n${indentation}`;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, fsTarget.getFirstToken().getStart(), fsTarget.getLastToken().getEnd(), targetName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Outline LOOP fs target\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineFor(forLoop, indentation) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n let body = \"\";\r\n let end = \"\";\r\n const loopSource = (_a = forLoop.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const loopTargetField = (_b = forLoop.findFirstExpression(Expressions.TargetField)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (forLoop.findDirectTokenByText(\"UNTIL\")) {\r\n const name = (_c = forLoop.findFirstExpression(Expressions.Field)) === null || _c === void 0 ? void 0 : _c.concatTokens();\r\n body += indentation + \"DATA \" + name + \" TYPE i.\\n\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `WHILE NOT ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n const field = (_e = (_d = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _d === void 0 ? void 0 : _d.findFirstExpression(Expressions.Field)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n body += indentation + ` ${field} = ${field} + 1.\\n`;\r\n end = \"ENDWHILE\";\r\n }\r\n else if (forLoop.findDirectTokenByText(\"WHILE\")) {\r\n const name = (_f = forLoop.findFirstExpression(Expressions.Field)) === null || _f === void 0 ? void 0 : _f.concatTokens();\r\n body += indentation + \"DATA \" + name + \" TYPE i.\\n\";\r\n const cond = forLoop.findFirstExpression(Expressions.Cond);\r\n body += indentation + `WHILE ${cond === null || cond === void 0 ? void 0 : cond.concatTokens()}.\\n`;\r\n const field = (_h = (_g = forLoop.findDirectExpression(Expressions.InlineFieldDefinition)) === null || _g === void 0 ? void 0 : _g.findFirstExpression(Expressions.Field)) === null || _h === void 0 ? void 0 : _h.concatTokens();\r\n body += indentation + ` ${field} = ${field} + 1.\\n`;\r\n end = \"ENDWHILE\";\r\n }\r\n else if (loopTargetField) {\r\n body += indentation + `LOOP AT ${loopSource} INTO DATA(${loopTargetField}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n else if (loopTargetField === undefined) {\r\n const loopTargetFieldSymbol = (_j = forLoop.findFirstExpression(Expressions.TargetFieldSymbol)) === null || _j === void 0 ? void 0 : _j.concatTokens();\r\n body += indentation + `LOOP AT ${loopSource} ASSIGNING FIELD-SYMBOL(${loopTargetFieldSymbol}).\\n`;\r\n end = \"ENDLOOP\";\r\n }\r\n return { body, end };\r\n }\r\n outlineSwitch(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"SWITCH\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const switchBody = i.findDirectExpression(Expressions.SwitchBody);\r\n if (switchBody === undefined) {\r\n continue;\r\n }\r\n for (const l of ((_a = switchBody === null || switchBody === void 0 ? void 0 : switchBody.findDirectExpression(Expressions.Let)) === null || _a === void 0 ? void 0 : _a.findDirectExpressions(Expressions.InlineFieldDefinition)) || []) {\r\n name = l.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_b = switchBody.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens()}.\\n`;\r\n }\r\n body += `DATA ${uniqueName} TYPE ${type}.\\n`;\r\n let firstSource = false;\r\n let inWhen = false;\r\n for (const c of switchBody.getChildren()) {\r\n if (c.get() instanceof Expressions.Source && firstSource === false) {\r\n body += indentation + `CASE ${c.concatTokens()}.`;\r\n firstSource = true;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"THEN\") {\r\n inWhen = true;\r\n body += \".\\n\";\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"WHEN\") {\r\n inWhen = false;\r\n body += `\\n${indentation} WHEN `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"OR\") {\r\n body += ` OR `;\r\n }\r\n else if (c instanceof nodes_1.TokenNode && c.concatTokens().toUpperCase() === \"ELSE\") {\r\n inWhen = true;\r\n body += `\\n${indentation} WHEN OTHERS.\\n`;\r\n }\r\n else if (inWhen === false) {\r\n body += c.concatTokens();\r\n }\r\n else {\r\n body += indentation + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\";\r\n }\r\n }\r\n body += \"\\n\" + indentation + \"ENDCASE.\\n\" + indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), body);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport SWITCH\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineReduce(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n const firstToken = i.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"REDUCE\") {\r\n continue;\r\n }\r\n const type = this.findType(i, lowFile, highSyntax);\r\n if (type === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n let name = \"\";\r\n const reduceBody = i.findDirectExpression(Expressions.ReduceBody);\r\n if (reduceBody === undefined) {\r\n continue;\r\n }\r\n for (const init of reduceBody.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n name = init.getFirstToken().getStr();\r\n body += indentation + `DATA(${name}) = ${(_a = reduceBody.findFirstExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens()}.\\n`;\r\n }\r\n const forLoop = reduceBody.findDirectExpression(Expressions.For);\r\n if (forLoop === undefined) {\r\n continue;\r\n }\r\n const outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n const next = reduceBody.findDirectExpression(Expressions.ReduceNext);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n for (const n of next.getChildren()) {\r\n if (n.concatTokens().toUpperCase() === \"NEXT\") {\r\n continue;\r\n }\r\n else if (n.concatTokens() === \"=\") {\r\n body += \" = \";\r\n }\r\n else if (n.get() instanceof Expressions.Field) {\r\n body += indentation + \" \" + n.concatTokens();\r\n }\r\n else if (n.get() instanceof Expressions.Source) {\r\n body += n.concatTokens() + \".\\n\";\r\n }\r\n }\r\n body += indentation + outlineFor.end + `.\\n`;\r\n body += indentation + `${uniqueName} = ${name}.\\n`;\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport REDUCE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineValue(node, lowFile, highSyntax) {\r\n var _a;\r\n const allSources = node.findAllExpressionsRecursive(Expressions.Source);\r\n for (const s of allSources) {\r\n const firstToken = s.getFirstToken();\r\n if (firstToken.getStr().toUpperCase() !== \"VALUE\") {\r\n continue;\r\n }\r\n let type = this.findType(s, lowFile, highSyntax);\r\n if (type === undefined) {\r\n if (node.get() instanceof Statements.Move && node.findDirectExpression(Expressions.Source) === s) {\r\n type = \"LIKE \" + ((_a = node.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens());\r\n }\r\n if (type === undefined) {\r\n continue;\r\n }\r\n }\r\n else {\r\n type = \"TYPE \" + type;\r\n }\r\n const valueBody = s.findDirectExpression(Expressions.ValueBody);\r\n const uniqueName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n let indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n let body = \"\";\r\n const forLoop = valueBody === null || valueBody === void 0 ? void 0 : valueBody.findDirectExpression(Expressions.For);\r\n let outlineFor = { body: \"\", end: \"\" };\r\n if (forLoop !== undefined) {\r\n outlineFor = this.outlineFor(forLoop, indentation);\r\n body += outlineFor.body;\r\n indentation += \" \";\r\n }\r\n let structureName = uniqueName;\r\n let added = false;\r\n let data = \"\";\r\n for (const b of (valueBody === null || valueBody === void 0 ? void 0 : valueBody.getChildren()) || []) {\r\n if (b.concatTokens() === \"(\" && added === false) {\r\n structureName = this.uniqueName(firstToken.getStart(), lowFile.getFilename(), highSyntax);\r\n data = indentation + `DATA ${structureName} LIKE LINE OF ${uniqueName}.\\n`;\r\n }\r\n if (b.get() instanceof Expressions.FieldAssignment) {\r\n if (added === false) {\r\n body += data;\r\n added = true;\r\n }\r\n body += indentation + structureName + \"-\" + b.concatTokens() + \".\\n\";\r\n }\r\n else if (b.get() instanceof Expressions.Source) {\r\n structureName = b.concatTokens();\r\n }\r\n else if (b instanceof nodes_1.ExpressionNode && b.get() instanceof Expressions.Let) {\r\n body += this.outlineLet(b, indentation, highSyntax, lowFile);\r\n }\r\n else if (b.concatTokens() === \")\") {\r\n body += indentation + `APPEND ${structureName} TO ${uniqueName}.\\n`;\r\n }\r\n }\r\n if (forLoop !== undefined) {\r\n indentation = indentation.substring(2);\r\n body += indentation + outlineFor.end + `.\\n`;\r\n }\r\n const abap = `DATA ${uniqueName} ${type}.\\n` +\r\n body +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, firstToken.getStart(), s.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, firstToken, \"Downport VALUE\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineLet(node, indentation, highSyntax, lowFile) {\r\n var _a;\r\n let ret = \"\";\r\n for (const f of node.findDirectExpressions(Expressions.InlineFieldDefinition)) {\r\n const c = f.getFirstChild();\r\n if (c === undefined) {\r\n continue;\r\n }\r\n const name = c.concatTokens().toLowerCase();\r\n const spag = highSyntax.spaghetti.lookupPosition(c.getFirstToken().getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_a = found.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase() : found.getType().toABAP();\r\n ret += indentation + \"DATA \" + name + ` TYPE ${type}.\\n`;\r\n const source = f.findFirstExpression(Expressions.Source);\r\n if (source) {\r\n ret += indentation + name + ` = ${source.concatTokens()}.\\n`;\r\n }\r\n }\r\n return ret;\r\n }\r\n findType(i, lowFile, highSyntax) {\r\n var _a;\r\n const expr = i.findDirectExpression(Expressions.TypeNameOrInfer);\r\n if (expr === undefined) {\r\n return undefined;\r\n }\r\n const firstToken = expr.getFirstToken();\r\n const concat = expr.concatTokens().toLowerCase();\r\n if (concat !== \"#\") {\r\n return concat;\r\n }\r\n const spag = highSyntax.spaghetti.lookupPosition(firstToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n return undefined;\r\n }\r\n let inferred = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.InferredType\r\n && r.resolved\r\n && r.position.getStart().equals(firstToken.getStart())\r\n && r.resolved instanceof _typed_identifier_1.TypedIdentifier) {\r\n inferred = r.resolved;\r\n break;\r\n }\r\n }\r\n if (inferred === undefined) {\r\n return undefined;\r\n }\r\n return (_a = inferred.getType().getQualifiedName()) === null || _a === void 0 ? void 0 : _a.toLowerCase();\r\n }\r\n outlineFS(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineFS)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetFieldSymbol)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n let type = \"\";\r\n if (node.concatTokens().toUpperCase().startsWith(\"APPEND INITIAL LINE TO \")) {\r\n type = \"LIKE LINE OF \" + ((_b = node.findFirstExpression(Expressions.Target)) === null || _b === void 0 ? void 0 : _b.concatTokens());\r\n }\r\n else {\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType) {\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Error outlining voided type\", this.getMetadata().key, this.conf.severity);\r\n }\r\n type = \"TYPE \";\r\n type += found.getType().getQualifiedName() ? found.getType().getQualifiedName().toLowerCase() : found.getType().toABAP();\r\n }\r\n const code = `FIELD-SYMBOLS ${name} ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline FIELD-SYMBOL\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineData(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.InlineData)) {\r\n const nameToken = (_a = i.findDirectExpression(Expressions.TargetField)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if (nameToken === undefined) {\r\n continue;\r\n }\r\n const name = nameToken.getStr();\r\n const spag = highSyntax.spaghetti.lookupPosition(nameToken.getStart(), lowFile.getFilename());\r\n if (spag === undefined) {\r\n continue;\r\n }\r\n const found = spag.findVariable(name);\r\n if (found === undefined) {\r\n continue;\r\n }\r\n else if (found.getType() instanceof basic_1.VoidType && found.getType().getQualifiedName() === undefined) {\r\n continue;\r\n }\r\n const type = found.getType().getQualifiedName() ? (_b = found.getType().getQualifiedName()) === null || _b === void 0 ? void 0 : _b.toLowerCase() : found.getType().toABAP();\r\n const code = `DATA ${name} TYPE ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), name);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Outline DATA\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n outlineCond(node, lowFile, highSyntax) {\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"COND\") {\r\n continue;\r\n }\r\n const body = i.findDirectExpression(Expressions.CondBody);\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const bodyCode = this.buildCondBody(body, uniqueName, indent, lowFile, highSyntax);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` + bodyCode;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport COND\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n buildCondBody(body, uniqueName, indent, lowFile, highSyntax) {\r\n let code = \"\";\r\n let first = true;\r\n for (const c of body.getChildren()) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n switch (c.getFirstToken().getStr().toUpperCase()) {\r\n case \"WHEN\":\r\n if (first === true) {\r\n code += indent + \"IF \";\r\n first = false;\r\n }\r\n else {\r\n code += indent + \"ELSEIF \";\r\n }\r\n break;\r\n case \"THEN\":\r\n code += \".\\n\";\r\n break;\r\n case \"ELSE\":\r\n code += indent + \"ELSE.\\n\";\r\n break;\r\n default:\r\n throw \"buildCondBody, unexpected token\";\r\n }\r\n }\r\n else if (c.get() instanceof Expressions.Cond) {\r\n code += c.concatTokens();\r\n }\r\n else if (c.get() instanceof Expressions.Let) {\r\n code += this.outlineLet(c, indent, highSyntax, lowFile);\r\n }\r\n else if (c.get() instanceof Expressions.Source) {\r\n code += indent + \" \" + uniqueName + \" = \" + c.concatTokens() + \".\\n\";\r\n }\r\n else {\r\n throw \"buildCondBody, unexpected expression, \" + c.get().constructor.name;\r\n }\r\n }\r\n code += indent + \"ENDIF.\\n\";\r\n code += indent;\r\n return code;\r\n }\r\n outlineConv(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Source)) {\r\n if (i.getFirstToken().getStr().toUpperCase() !== \"CONV\") {\r\n continue;\r\n }\r\n const body = (_a = i.findDirectExpression(Expressions.ConvBody)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (body === undefined) {\r\n continue;\r\n }\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const indent = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const abap = `DATA ${uniqueName} TYPE ${type}.\\n` +\r\n indent + `${uniqueName} = ${body}.\\n` +\r\n indent;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CONV\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n // \"CAST\" to \"?=\"\r\n outlineCast(node, lowFile, highSyntax) {\r\n var _a;\r\n for (const i of node.findAllExpressionsRecursive(Expressions.Cast)) {\r\n const uniqueName = this.uniqueName(i.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const type = this.findType(i, lowFile, highSyntax);\r\n const body = (_a = i.findDirectExpression(Expressions.Source)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n const abap = `DATA ${uniqueName} TYPE REF TO ${type}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1) +\r\n `${uniqueName} ?= ${body}.\\n` +\r\n \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), abap);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, i.getFirstToken().getStart(), i.getLastToken().getEnd(), uniqueName);\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, i.getFirstToken(), \"Downport CAST\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n return undefined;\r\n }\r\n uniqueName(position, filename, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(position, filename);\r\n if (spag === undefined) {\r\n const name = \"temprr\" + this.counter;\r\n this.counter++;\r\n return name;\r\n }\r\n while (true) {\r\n const name = \"temp\" + this.counter;\r\n const found = spag.findVariable(name);\r\n this.counter++;\r\n if (found === undefined) {\r\n return name;\r\n }\r\n }\r\n }\r\n replaceXsdBool(node, lowFile, highSyntax) {\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType === _reference_1.ReferenceType.BuiltinMethodReference\r\n && r.position.getName().toUpperCase() === \"XSDBOOL\") {\r\n const token = r.position.getToken();\r\n const fix = edit_helper_1.EditHelper.replaceRange(lowFile, token.getStart(), token.getEnd(), \"boolc\");\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findMethodCallExpression(node, token) {\r\n var _a;\r\n for (const m of node.findAllExpressions(Expressions.MethodCall)) {\r\n if ((_a = m.findDirectExpression(Expressions.MethodName)) === null || _a === void 0 ? void 0 : _a.getFirstToken().getStart().equals(token.getStart())) {\r\n return m;\r\n }\r\n }\r\n return undefined;\r\n }\r\n replaceLineFunctions(node, lowFile, highSyntax) {\r\n var _a, _b;\r\n const spag = highSyntax.spaghetti.lookupPosition(node.getFirstToken().getStart(), lowFile.getFilename());\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if (r.referenceType !== _reference_1.ReferenceType.BuiltinMethodReference) {\r\n continue;\r\n }\r\n const func = r.position.getName().toUpperCase();\r\n if (func === \"LINE_EXISTS\" || func === \"LINE_INDEX\") {\r\n const token = r.position.getToken();\r\n const expression = this.findMethodCallExpression(node, token);\r\n if (expression === undefined) {\r\n continue;\r\n }\r\n let condition = \"\";\r\n for (const c of ((_a = expression === null || expression === void 0 ? void 0 : expression.findFirstExpression(Expressions.TableExpression)) === null || _a === void 0 ? void 0 : _a.getChildren()) || []) {\r\n if (c.getFirstToken().getStr() === \"[\" || c.getFirstToken().getStr() === \"]\") {\r\n continue;\r\n }\r\n else if (c.get() instanceof Expressions.ComponentChainSimple && condition === \"\") {\r\n condition = \"WITH KEY \";\r\n }\r\n else if (c.get() instanceof Expressions.Source && condition === \"\") {\r\n condition = \"INDEX \";\r\n }\r\n condition += c.concatTokens() + \" \";\r\n }\r\n const tableName = (_b = expression.findFirstExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens().split(\"[\")[0];\r\n const uniqueName = this.uniqueName(node.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const sy = func === \"LINE_EXISTS\" ? \"sy-subrc\" : \"sy-tabix\";\r\n const code = `DATA ${uniqueName} LIKE sy-subrc.\\n` +\r\n indentation + `READ TABLE ${tableName} ${condition}TRANSPORTING NO FIELDS.\\n` +\r\n indentation + uniqueName + ` = ${sy}.\\n` +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), code);\r\n const start = expression.getFirstToken().getStart();\r\n const end = expression.getLastToken().getEnd();\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, start, end, uniqueName + (func === \"LINE_EXISTS\" ? \" = 0\" : \"\"));\r\n const fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n return issue_1.Issue.atToken(lowFile, token, \"Use BOOLC\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n }\r\n return undefined;\r\n }\r\n newToCreateObject(node, lowFile, highSyntax) {\r\n const source = node.findDirectExpression(Expressions.Source);\r\n let fix = undefined;\r\n if (node.get() instanceof Statements.Move\r\n && source\r\n && source.getFirstToken().getStr().toUpperCase() === \"NEW\") {\r\n const target = node.findDirectExpression(Expressions.Target);\r\n const found = source === null || source === void 0 ? void 0 : source.findFirstExpression(Expressions.NewObject);\r\n // must be at top level of the source for quickfix to work(todo: handle more scenarios)\r\n // todo, assumption: the target is not an inline definition\r\n if (target && found && source.concatTokens() === found.concatTokens()) {\r\n const abap = this.newParameters(found, target.concatTokens(), highSyntax, lowFile);\r\n if (abap !== undefined) {\r\n fix = edit_helper_1.EditHelper.replaceRange(lowFile, node.getFirstToken().getStart(), node.getLastToken().getEnd(), abap);\r\n }\r\n }\r\n }\r\n if (fix === undefined && node.findAllExpressions(Expressions.NewObject)) {\r\n const found = node.findFirstExpression(Expressions.NewObject);\r\n if (found === undefined) {\r\n return undefined;\r\n }\r\n const name = this.uniqueName(found.getFirstToken().getStart(), lowFile.getFilename(), highSyntax);\r\n const abap = this.newParameters(found, name, highSyntax, lowFile);\r\n if (abap === undefined) {\r\n return undefined;\r\n }\r\n const type = this.findType(found, lowFile, highSyntax);\r\n const indentation = \" \".repeat(node.getFirstToken().getStart().getCol() - 1);\r\n const data = `DATA ${name} TYPE REF TO ${type}.\\n` +\r\n indentation + abap + \"\\n\" +\r\n indentation;\r\n const fix1 = edit_helper_1.EditHelper.insertAt(lowFile, node.getFirstToken().getStart(), data);\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(lowFile, found.getFirstToken().getStart(), found.getLastToken().getEnd(), name);\r\n fix = edit_helper_1.EditHelper.merge(fix2, fix1);\r\n }\r\n if (fix) {\r\n return issue_1.Issue.atToken(lowFile, node.getFirstToken(), \"Use CREATE OBJECT instead of NEW\", this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n else {\r\n return undefined;\r\n }\r\n }\r\n newParameters(found, name, highSyntax, lowFile) {\r\n var _a, _b, _c;\r\n const typeToken = (_a = found.findDirectExpression(Expressions.TypeNameOrInfer)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n let extra = (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr()) === \"#\" ? \"\" : \" TYPE \" + (typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStr());\r\n const parameters = found.findFirstExpression(Expressions.ParameterListS);\r\n if (parameters) {\r\n extra = parameters ? extra + \" EXPORTING \" + parameters.concatTokens() : extra;\r\n }\r\n else if (typeToken) {\r\n const source = (_b = found.findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.concatTokens();\r\n if (source) {\r\n // find the default parameter name for the constructor\r\n const spag = highSyntax.spaghetti.lookupPosition(typeToken === null || typeToken === void 0 ? void 0 : typeToken.getStart(), lowFile.getFilename());\r\n let cdef = undefined;\r\n for (const r of (spag === null || spag === void 0 ? void 0 : spag.getData().references) || []) {\r\n if ((r.referenceType === _reference_1.ReferenceType.InferredType\r\n || r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference)\r\n && r.resolved && r.position.getStart().equals(typeToken.getStart())) {\r\n cdef = r.resolved;\r\n }\r\n }\r\n if (cdef && cdef.getMethodDefinitions === undefined) {\r\n return undefined; // something wrong\r\n }\r\n const importing = (_c = cdef === null || cdef === void 0 ? void 0 : cdef.getMethodDefinitions().getByName(\"CONSTRUCTOR\")) === null || _c === void 0 ? void 0 : _c.getParameters().getDefaultImporting();\r\n if (importing) {\r\n extra += \" EXPORTING \" + importing + \" = \" + source;\r\n }\r\n else if (spag === undefined) {\r\n extra += \" SpagUndefined\";\r\n }\r\n else if (cdef === undefined) {\r\n extra += \" ClassDefinitionNotFound\";\r\n }\r\n else {\r\n extra += \" SomeError\";\r\n }\r\n }\r\n }\r\n const abap = `CREATE OBJECT ${name}${extra}.`;\r\n return abap;\r\n }\r\n}\r\nexports.Downport = Downport;\r\n//# sourceMappingURL=downport.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/downport.js?");
|
|
11636
11669
|
|
|
11637
11670
|
/***/ }),
|
|
11638
11671
|
|
|
@@ -11676,7 +11709,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11676
11709
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11677
11710
|
|
|
11678
11711
|
"use strict";
|
|
11679
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm\nhttps://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stack = [];\r\n for (const statement of file.getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof Statements.Loop\r\n || get instanceof Statements.While\r\n || get instanceof Statements.SelectLoop\r\n || get instanceof Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof Statements.EndLoop\r\n || get instanceof Statements.EndWhile\r\n || get instanceof Statements.EndSelect\r\n || get instanceof Statements.EndDo) {\r\n stack.pop();\r\n }\r\n else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {\r\n const message = \"CHECK is not allowed outside of loops\";\r\n let tokensString = statement.concatTokens();\r\n tokensString = tokensString.slice(statement.getFirstToken().getEnd().getCol());\r\n const replacement = \"IF NOT \" + tokensString + \"\\n RETURN.\\nENDIF.\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.allowExit === false && get instanceof Statements.Exit && stack.length === 0) {\r\n const message = \"EXIT is not allowed outside of loops\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, statement.getFirstToken(), \"RETURN\");\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ExitOrCheck = ExitOrCheck;\r\n//# sourceMappingURL=exit_or_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exit_or_check.js?");
|
|
11712
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ExitOrCheck = exports.ExitOrCheckConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExitOrCheckConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.allowExit = false;\r\n this.allowCheck = false;\r\n }\r\n}\r\nexports.ExitOrCheckConf = ExitOrCheckConf;\r\nclass ExitOrCheck extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExitOrCheckConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exit_or_check\",\r\n title: \"Find EXIT or CHECK outside loops\",\r\n shortDescription: `Detects usages of EXIT or CHECK statements outside of loops.\r\nUse RETURN to leave procesing blocks instead.`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abenleave_processing_blocks.htm\r\nhttps://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapcheck_processing_blocks.htm\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#check-vs-return`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const stack = [];\r\n for (const statement of file.getStatements()) {\r\n const get = statement.get();\r\n if (get instanceof Statements.Loop\r\n || get instanceof Statements.While\r\n || get instanceof Statements.SelectLoop\r\n || get instanceof Statements.Do) {\r\n stack.push(statement);\r\n }\r\n else if (get instanceof Statements.EndLoop\r\n || get instanceof Statements.EndWhile\r\n || get instanceof Statements.EndSelect\r\n || get instanceof Statements.EndDo) {\r\n stack.pop();\r\n }\r\n else if (this.conf.allowCheck === false && get instanceof Statements.Check && stack.length === 0) {\r\n const message = \"CHECK is not allowed outside of loops\";\r\n let tokensString = statement.concatTokens();\r\n tokensString = tokensString.slice(statement.getFirstToken().getEnd().getCol());\r\n const replacement = \"IF NOT \" + tokensString + \"\\n RETURN.\\nENDIF.\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statement.getFirstToken().getStart(), statement.getLastToken().getEnd(), replacement);\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n else if (this.conf.allowExit === false && get instanceof Statements.Exit && stack.length === 0) {\r\n const message = \"EXIT is not allowed outside of loops\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, statement.getFirstToken(), \"RETURN\");\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ExitOrCheck = ExitOrCheck;\r\n//# sourceMappingURL=exit_or_check.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exit_or_check.js?");
|
|
11680
11713
|
|
|
11681
11714
|
/***/ }),
|
|
11682
11715
|
|
|
@@ -11687,7 +11720,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11687
11720
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11688
11721
|
|
|
11689
11722
|
"use strict";
|
|
11690
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Exporting = exports.ExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ExportingConf = ExportingConf;\r\nclass Exporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exporting\",\r\n title: \"EXPORTING can be omitted\",\r\n shortDescription: `Detects EXPORTING statements which can be omitted.`,\r\n badExample: `call_method( EXPORTING foo = bar ).`,\r\n goodExample: `call_method( foo = bar ).`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting\nhttps://docs.abapopenchecks.org/checks/30/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"The EXPORTING keyword can be omitted\";\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n const expressions = statement.findAllExpressionsMulti([expressions_1.MethodCallBody, expressions_1.MethodCall]);\r\n for (const b of expressions) {\r\n if (b.get() instanceof expressions_1.MethodCallBody) {\r\n if (b.getFirstToken().getStr() !== \"(\") {\r\n continue;\r\n }\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n else if (b.get() instanceof expressions_1.MethodCall) {\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n check(node, file) {\r\n const e = node.findFirstExpression(expressions_1.MethodParameters);\r\n if (e === undefined) {\r\n return [];\r\n }\r\n if (e.getFirstToken().getStr().toUpperCase() !== \"EXPORTING\") {\r\n return [];\r\n }\r\n const tokens = e.getDirectTokens();\r\n const strings = tokens.map(t => t.getStr().toUpperCase());\r\n if (strings[0] === \"EXPORTING\"\r\n && strings.includes(\"IMPORTING\") === false\r\n && strings.includes(\"RECEIVING\") === false\r\n && strings.includes(\"EXCEPTIONS\") === false\r\n && strings.includes(\"CHANGING\") === false) {\r\n const next = e.getAllTokens()[1];\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, tokens[0].getStart(), next.getStart());\r\n const issue = issue_1.Issue.atToken(file, tokens[0], this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.Exporting = Exporting;\r\n//# sourceMappingURL=exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exporting.js?");
|
|
11723
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Exporting = exports.ExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ExportingConf = ExportingConf;\r\nclass Exporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"exporting\",\r\n title: \"EXPORTING can be omitted\",\r\n shortDescription: `Detects EXPORTING statements which can be omitted.`,\r\n badExample: `call_method( EXPORTING foo = bar ).`,\r\n goodExample: `call_method( foo = bar ).`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-optional-keyword-exporting\r\nhttps://docs.abapopenchecks.org/checks/30/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"The EXPORTING keyword can be omitted\";\r\n }\r\n runParsed(file, obj) {\r\n let issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n const expressions = statement.findAllExpressionsMulti([expressions_1.MethodCallBody, expressions_1.MethodCall]);\r\n for (const b of expressions) {\r\n if (b.get() instanceof expressions_1.MethodCallBody) {\r\n if (b.getFirstToken().getStr() !== \"(\") {\r\n continue;\r\n }\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n else if (b.get() instanceof expressions_1.MethodCall) {\r\n issues = issues.concat(this.check(b, file));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n check(node, file) {\r\n const e = node.findFirstExpression(expressions_1.MethodParameters);\r\n if (e === undefined) {\r\n return [];\r\n }\r\n if (e.getFirstToken().getStr().toUpperCase() !== \"EXPORTING\") {\r\n return [];\r\n }\r\n const tokens = e.getDirectTokens();\r\n const strings = tokens.map(t => t.getStr().toUpperCase());\r\n if (strings[0] === \"EXPORTING\"\r\n && strings.includes(\"IMPORTING\") === false\r\n && strings.includes(\"RECEIVING\") === false\r\n && strings.includes(\"EXCEPTIONS\") === false\r\n && strings.includes(\"CHANGING\") === false) {\r\n const next = e.getAllTokens()[1];\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, tokens[0].getStart(), next.getStart());\r\n const issue = issue_1.Issue.atToken(file, tokens[0], this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.Exporting = Exporting;\r\n//# sourceMappingURL=exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/exporting.js?");
|
|
11691
11724
|
|
|
11692
11725
|
/***/ }),
|
|
11693
11726
|
|
|
@@ -11698,7 +11731,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11698
11731
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11699
11732
|
|
|
11700
11733
|
"use strict";
|
|
11701
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenIdentifier = exports.ForbiddenIdentifierConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ForbiddenIdentifierConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbideen identifiers, array of string regex\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenIdentifierConf = ForbiddenIdentifierConf;\r\nclass ForbiddenIdentifier extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ForbiddenIdentifierConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_identifier\",\r\n title: \"Forbidden Identifier\",\r\n shortDescription: `Forbid use of specified identifiers, list of regex.`,\r\n extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,\nhttps://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n runParsed(file) {\r\n if (this.conf.check.length === 0) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const s of file.getStatements()) {\r\n ret = ret.concat(this.traverse(s, file));\r\n }\r\n return ret;\r\n }\r\n traverse(node, file) {\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNodeRegex) {\r\n ret = ret.concat(this.check(c.get(), file));\r\n }\r\n else if (c instanceof nodes_1.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret = ret.concat(this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n check(token, file) {\r\n const str = token.getStr();\r\n const ret = [];\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n if (reg.exec(str)) {\r\n const message = \"Identifer \\\"\" + str + \"\\\" not allowed\";\r\n ret.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.ForbiddenIdentifier = ForbiddenIdentifier;\r\n//# sourceMappingURL=forbidden_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js?");
|
|
11734
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenIdentifier = exports.ForbiddenIdentifierConf = void 0;\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass ForbiddenIdentifierConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbideen identifiers, array of string regex\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenIdentifierConf = ForbiddenIdentifierConf;\r\nclass ForbiddenIdentifier extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ForbiddenIdentifierConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_identifier\",\r\n title: \"Forbidden Identifier\",\r\n shortDescription: `Forbid use of specified identifiers, list of regex.`,\r\n extendedInformation: `Used in the transpiler to find javascript keywords in ABAP identifiers,\r\nhttps://github.com/abaplint/transpiler/blob/bda94b8b56e2b7f2f87be2168f12361aa530220e/packages/transpiler/src/validation.ts#L44`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n runParsed(file) {\r\n if (this.conf.check.length === 0) {\r\n return [];\r\n }\r\n let ret = [];\r\n for (const s of file.getStatements()) {\r\n ret = ret.concat(this.traverse(s, file));\r\n }\r\n return ret;\r\n }\r\n traverse(node, file) {\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.TokenNodeRegex) {\r\n ret = ret.concat(this.check(c.get(), file));\r\n }\r\n else if (c instanceof nodes_1.TokenNode) {\r\n continue;\r\n }\r\n else {\r\n ret = ret.concat(this.traverse(c, file));\r\n }\r\n }\r\n return ret;\r\n }\r\n check(token, file) {\r\n const str = token.getStr();\r\n const ret = [];\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n if (reg.exec(str)) {\r\n const message = \"Identifer \\\"\" + str + \"\\\" not allowed\";\r\n ret.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.ForbiddenIdentifier = ForbiddenIdentifier;\r\n//# sourceMappingURL=forbidden_identifier.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_identifier.js?");
|
|
11702
11735
|
|
|
11703
11736
|
/***/ }),
|
|
11704
11737
|
|
|
@@ -11720,7 +11753,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11720
11753
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11721
11754
|
|
|
11722
11755
|
"use strict";
|
|
11723
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenVoidType = exports.ForbiddenVoidTypeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst void_type_1 = __webpack_require__(/*! ../abap/types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ForbiddenVoidTypeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbidden void types, array of string regex, case in-sensitive\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenVoidTypeConf = ForbiddenVoidTypeConf;\r\nclass ForbiddenVoidType {\r\n constructor() {\r\n this.conf = new ForbiddenVoidTypeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_void_type\",\r\n title: \"Forbidden Void Types\",\r\n shortDescription: `Avoid usage of specified void types.`,\r\n extendedInformation: `Inspiration:\nBOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,\nDATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || this.conf.check.length === 0) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ///////////////\r\n traverse(node) {\r\n var _a, _b, _c;\r\n let ret = [];\r\n const message = \"Forbidden void type: \";\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedVoidReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) !== undefined\r\n && this.isForbiddenName((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName)) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + ((_c = r.extra) === null || _c === void 0 ? void 0 : _c.ooName), this.getMetadata().key, this.conf.severity));\r\n }\r\n if ((r.referenceType === _reference_1.ReferenceType.VoidType\r\n || r.referenceType === _reference_1.ReferenceType.TableVoidReference)\r\n && this.isForbiddenName(r.position.getName())) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.position.getName(), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n isForbiddenType(type) {\r\n if (type instanceof basic_1.StructureType) {\r\n return type.getComponents().some(c => this.isForbiddenType(c.type));\r\n }\r\n else if (!(type instanceof void_type_1.VoidType)) {\r\n return false;\r\n }\r\n const name = type.getVoided();\r\n return this.isForbiddenName(name);\r\n }\r\n isForbiddenName(name) {\r\n if (name === undefined) {\r\n return false;\r\n }\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n const match = reg.test(name);\r\n if (match === true) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ForbiddenVoidType = ForbiddenVoidType;\r\n//# sourceMappingURL=forbidden_void_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js?");
|
|
11756
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ForbiddenVoidType = exports.ForbiddenVoidTypeConf = void 0;\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst void_type_1 = __webpack_require__(/*! ../abap/types/basic/void_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/void_type.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass ForbiddenVoidTypeConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of forbidden void types, array of string regex, case in-sensitive\r\n * @uniqueItems true\r\n */\r\n this.check = [];\r\n }\r\n}\r\nexports.ForbiddenVoidTypeConf = ForbiddenVoidTypeConf;\r\nclass ForbiddenVoidType {\r\n constructor() {\r\n this.conf = new ForbiddenVoidTypeConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"forbidden_void_type\",\r\n title: \"Forbidden Void Types\",\r\n shortDescription: `Avoid usage of specified void types.`,\r\n extendedInformation: `Inspiration:\r\nBOOLEAN, BOOLE_D, CHAR01, CHAR1, CHAR10, CHAR12, CHAR128, CHAR2, CHAR20, CHAR4, CHAR70,\r\nDATS, TIMS, DATUM, FLAG, INT4, NUMC3, NUMC4, SAP_BOOL, TEXT25, TEXT80, X255, XFELD`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.check === undefined) {\r\n this.conf.check = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || this.conf.check.length === 0) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ///////////////\r\n traverse(node) {\r\n var _a, _b, _c;\r\n let ret = [];\r\n const message = \"Forbidden void type: \";\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedVoidReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooName) !== undefined\r\n && this.isForbiddenName((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName)) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + ((_c = r.extra) === null || _c === void 0 ? void 0 : _c.ooName), this.getMetadata().key, this.conf.severity));\r\n }\r\n if ((r.referenceType === _reference_1.ReferenceType.VoidType\r\n || r.referenceType === _reference_1.ReferenceType.TableVoidReference)\r\n && this.isForbiddenName(r.position.getName())) {\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.position.getName(), this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n isForbiddenType(type) {\r\n if (type instanceof basic_1.StructureType) {\r\n return type.getComponents().some(c => this.isForbiddenType(c.type));\r\n }\r\n else if (!(type instanceof void_type_1.VoidType)) {\r\n return false;\r\n }\r\n const name = type.getVoided();\r\n return this.isForbiddenName(name);\r\n }\r\n isForbiddenName(name) {\r\n if (name === undefined) {\r\n return false;\r\n }\r\n for (const c of this.conf.check) {\r\n const reg = new RegExp(c, \"i\");\r\n const match = reg.test(name);\r\n if (match === true) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ForbiddenVoidType = ForbiddenVoidType;\r\n//# sourceMappingURL=forbidden_void_type.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/forbidden_void_type.js?");
|
|
11724
11757
|
|
|
11725
11758
|
/***/ }),
|
|
11726
11759
|
|
|
@@ -11764,7 +11797,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11764
11797
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11765
11798
|
|
|
11766
11799
|
"use strict";
|
|
11767
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionalWriting = exports.FunctionalWritingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass FunctionalWritingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore functional writing in exception classes, local + global */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.FunctionalWritingConf = FunctionalWritingConf;\r\nclass FunctionalWriting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionalWritingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"functional_writing\",\r\n title: \"Use functional writing\",\r\n shortDescription: `Detects usage of call method when functional style calls can be used.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls\nhttps://docs.abapopenchecks.org/checks/07/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `CALL METHOD zcl_class=>method( ).\nCALL METHOD cl_abap_typedescr=>describe_by_name\n EXPORTING\n p_name = 'NAME'\n RECEIVING\n p_descr_ref = lr_typedescr\n EXCEPTIONS\n type_not_found = 1\n OTHERS = 2.`,\r\n goodExample: `zcl_class=>method( ).\ncl_abap_typedescr=>describe_by_name(\n EXPORTING\n p_name = 'NAME'\n RECEIVING\n p_descr_ref = lr_typedescr\n EXCEPTIONS\n type_not_found = 1\n OTHERS = 2 ).`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Use functional writing style for method calls\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a, _b;\r\n const issues = [];\r\n let exception = false;\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n let definition = undefined;\r\n if (obj instanceof objects_1.Class) {\r\n definition = obj.getClassDefinition();\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const statNode of file.getStatements()) {\r\n if (statNode.get() instanceof Statements.ClassImplementation\r\n && definition\r\n && ddic.isException(definition, obj)\r\n && this.conf.ignoreExceptions) {\r\n exception = true;\r\n }\r\n else if (statNode.get() instanceof Statements.EndClass) {\r\n exception = false;\r\n }\r\n else if (exception === false && statNode.get() instanceof Statements.Call) {\r\n if (((_a = statNode.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const dynamic = (_b = statNode.findDirectExpression(Expressions.MethodSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic);\r\n if (dynamic !== undefined) {\r\n continue;\r\n }\r\n issues.push(this.createIssueForStatementNode(file, statNode));\r\n }\r\n }\r\n return issues;\r\n }\r\n createIssueForStatementNode(file, statNode) {\r\n const fixString = this.buildFixString(statNode);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statNode.getStart(), statNode.getEnd(), fixString);\r\n return issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n buildFixString(statNode) {\r\n // Note: line breaks from source are lost\r\n const methodSource = statNode.findDirectExpression(Expressions.MethodSource);\r\n let methodSourceStr = methodSource === null || methodSource === void 0 ? void 0 : methodSource.concatTokens();\r\n const methodBody = statNode.findDirectExpression(Expressions.MethodCallBody);\r\n let methodBodyStr = \"\";\r\n if (methodBody) {\r\n const methodCallParam = methodBody.findDirectExpression(Expressions.MethodCallParam);\r\n if (methodCallParam && methodCallParam.getFirstToken().getStr() === \"(\") {\r\n // has parameters and parantheses\r\n methodBodyStr = `${methodBody.concatTokens()}.`;\r\n }\r\n else {\r\n // has parameters, but parentheses are missing\r\n methodSourceStr = `${methodSourceStr}( `;\r\n methodBodyStr = `${methodBody.concatTokens()} ).`;\r\n }\r\n }\r\n else {\r\n // no body means no parentheses and no parameters\r\n methodBodyStr = \"( ).\";\r\n }\r\n return methodSourceStr + methodBodyStr;\r\n }\r\n}\r\nexports.FunctionalWriting = FunctionalWriting;\r\n//# sourceMappingURL=functional_writing.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/functional_writing.js?");
|
|
11800
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.FunctionalWriting = exports.FunctionalWritingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass FunctionalWritingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore functional writing in exception classes, local + global */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.FunctionalWritingConf = FunctionalWritingConf;\r\nclass FunctionalWriting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new FunctionalWritingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"functional_writing\",\r\n title: \"Use functional writing\",\r\n shortDescription: `Detects usage of call method when functional style calls can be used.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-calls\r\nhttps://docs.abapopenchecks.org/checks/07/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `CALL METHOD zcl_class=>method( ).\r\nCALL METHOD cl_abap_typedescr=>describe_by_name\r\n EXPORTING\r\n p_name = 'NAME'\r\n RECEIVING\r\n p_descr_ref = lr_typedescr\r\n EXCEPTIONS\r\n type_not_found = 1\r\n OTHERS = 2.`,\r\n goodExample: `zcl_class=>method( ).\r\ncl_abap_typedescr=>describe_by_name(\r\n EXPORTING\r\n p_name = 'NAME'\r\n RECEIVING\r\n p_descr_ref = lr_typedescr\r\n EXCEPTIONS\r\n type_not_found = 1\r\n OTHERS = 2 ).`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Use functional writing style for method calls\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a, _b;\r\n const issues = [];\r\n let exception = false;\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n let definition = undefined;\r\n if (obj instanceof objects_1.Class) {\r\n definition = obj.getClassDefinition();\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const statNode of file.getStatements()) {\r\n if (statNode.get() instanceof Statements.ClassImplementation\r\n && definition\r\n && ddic.isException(definition, obj)\r\n && this.conf.ignoreExceptions) {\r\n exception = true;\r\n }\r\n else if (statNode.get() instanceof Statements.EndClass) {\r\n exception = false;\r\n }\r\n else if (exception === false && statNode.get() instanceof Statements.Call) {\r\n if (((_a = statNode.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const dynamic = (_b = statNode.findDirectExpression(Expressions.MethodSource)) === null || _b === void 0 ? void 0 : _b.findDirectExpression(Expressions.Dynamic);\r\n if (dynamic !== undefined) {\r\n continue;\r\n }\r\n issues.push(this.createIssueForStatementNode(file, statNode));\r\n }\r\n }\r\n return issues;\r\n }\r\n createIssueForStatementNode(file, statNode) {\r\n const fixString = this.buildFixString(statNode);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, statNode.getStart(), statNode.getEnd(), fixString);\r\n return issue_1.Issue.atStatement(file, statNode, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n }\r\n buildFixString(statNode) {\r\n // Note: line breaks from source are lost\r\n const methodSource = statNode.findDirectExpression(Expressions.MethodSource);\r\n let methodSourceStr = methodSource === null || methodSource === void 0 ? void 0 : methodSource.concatTokens();\r\n const methodBody = statNode.findDirectExpression(Expressions.MethodCallBody);\r\n let methodBodyStr = \"\";\r\n if (methodBody) {\r\n const methodCallParam = methodBody.findDirectExpression(Expressions.MethodCallParam);\r\n if (methodCallParam && methodCallParam.getFirstToken().getStr() === \"(\") {\r\n // has parameters and parantheses\r\n methodBodyStr = `${methodBody.concatTokens()}.`;\r\n }\r\n else {\r\n // has parameters, but parentheses are missing\r\n methodSourceStr = `${methodSourceStr}( `;\r\n methodBodyStr = `${methodBody.concatTokens()} ).`;\r\n }\r\n }\r\n else {\r\n // no body means no parentheses and no parameters\r\n methodBodyStr = \"( ).\";\r\n }\r\n return methodSourceStr + methodBodyStr;\r\n }\r\n}\r\nexports.FunctionalWriting = FunctionalWriting;\r\n//# sourceMappingURL=functional_writing.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/functional_writing.js?");
|
|
11768
11801
|
|
|
11769
11802
|
/***/ }),
|
|
11770
11803
|
|
|
@@ -11775,7 +11808,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11775
11808
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11776
11809
|
|
|
11777
11810
|
"use strict";
|
|
11778
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GlobalClass = exports.GlobalClassConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass GlobalClassConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.GlobalClassConf = GlobalClassConf;\r\nclass GlobalClass extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new GlobalClassConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"global_class\",\r\n title: \"Global class checks\",\r\n shortDescription: `Checks related to global classes.\n\n* global classes must be in own files\n\n* file names must match class name\n\n* file names must match interface name\n\n* global classes must be global definitions\n\n* global interfaces must be global definitions`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const output = [];\r\n for (const definition of file.getInfo().listClassDefinitions()) {\r\n if (definition.isLocal && obj instanceof Objects.Class && file.getFilename().match(/\\.clas\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Global classes must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && obj instanceof Objects.Class && definition.name.toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class definition name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && !(obj instanceof Objects.Class)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class must be local\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listClassImplementations()) {\r\n if (file.getFilename().match(/\\.clas\\.abap$/)\r\n && obj instanceof Objects.Class\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Class implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listInterfaceDefinitions()) {\r\n if (file.getFilename().match(/\\.intf\\.abap$/)\r\n && obj instanceof Objects.Interface\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Interface implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const intf of file.getInfo().listInterfaceDefinitions()) {\r\n if (intf.isLocal && obj instanceof Objects.Interface && file.getFilename().match(/\\.intf\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(intf.identifier, \"Global interface must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.GlobalClass = GlobalClass;\r\n//# sourceMappingURL=global_class.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/global_class.js?");
|
|
11811
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.GlobalClass = exports.GlobalClassConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass GlobalClassConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.GlobalClassConf = GlobalClassConf;\r\nclass GlobalClass extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new GlobalClassConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"global_class\",\r\n title: \"Global class checks\",\r\n shortDescription: `Checks related to global classes.\r\n\r\n* global classes must be in own files\r\n\r\n* file names must match class name\r\n\r\n* file names must match interface name\r\n\r\n* global classes must be global definitions\r\n\r\n* global interfaces must be global definitions`,\r\n tags: [_irule_1.RuleTag.Syntax],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const output = [];\r\n for (const definition of file.getInfo().listClassDefinitions()) {\r\n if (definition.isLocal && obj instanceof Objects.Class && file.getFilename().match(/\\.clas\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Global classes must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && obj instanceof Objects.Class && definition.name.toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class definition name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n if (definition.isGlobal && !(obj instanceof Objects.Class)) {\r\n const issue = issue_1.Issue.atIdentifier(definition.identifier, \"Class must be local\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listClassImplementations()) {\r\n if (file.getFilename().match(/\\.clas\\.abap$/)\r\n && obj instanceof Objects.Class\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Class implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const impl of file.getInfo().listInterfaceDefinitions()) {\r\n if (file.getFilename().match(/\\.intf\\.abap$/)\r\n && obj instanceof Objects.Interface\r\n && impl.identifier.getName().toUpperCase() !== obj.getName().toUpperCase()) {\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, \"Interface implementation name must match filename\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n for (const intf of file.getInfo().listInterfaceDefinitions()) {\r\n if (intf.isLocal && obj instanceof Objects.Interface && file.getFilename().match(/\\.intf\\.abap$/)) {\r\n const issue = issue_1.Issue.atIdentifier(intf.identifier, \"Global interface must be global\", this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.GlobalClass = GlobalClass;\r\n//# sourceMappingURL=global_class.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/global_class.js?");
|
|
11779
11812
|
|
|
11780
11813
|
/***/ }),
|
|
11781
11814
|
|
|
@@ -11786,7 +11819,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11786
11819
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11787
11820
|
|
|
11788
11821
|
"use strict";
|
|
11789
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalConditions = exports.IdenticalConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass Conditions {\r\n constructor() {\r\n this.arr = [];\r\n this.arr = [];\r\n }\r\n push(e) {\r\n this.arr.push(e.concatTokens());\r\n }\r\n hasDuplicates() {\r\n return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));\r\n }\r\n}\r\nclass IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalConditionsConf = IdenticalConditionsConf;\r\nclass IdenticalConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_conditions\",\r\n title: \"Identical conditions\",\r\n shortDescription: `Find identical conditions in IF + CASE + WHILE etc\n\nPrerequsites: code is pretty printed with identical cAsE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructures(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n for (const i of structure.findAllStructures(Structures.Case)) {\r\n issues = issues.concat(this.analyzeWhen(file, i));\r\n }\r\n for (const i of structure.findAllExpressions(Expressions.Cond)) {\r\n issues = issues.concat(this.analyzeCond(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeCond(file, node) {\r\n const conditions = new Conditions();\r\n let operator = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n conditions.push(c);\r\n }\r\n else if (operator === \"\") {\r\n operator = c.get().getStr().toUpperCase();\r\n }\r\n else if (operator !== c.get().getStr().toUpperCase()) {\r\n return [];\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeIf(file, node) {\r\n var _a;\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.If);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no IF found\");\r\n }\r\n const c = i === null || i === void 0 ? void 0 : i.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n for (const e of node.findDirectStructures(Structures.ElseIf)) {\r\n const c = (_a = e.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeWhen(file, node) {\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.Case);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no CASE found\");\r\n }\r\n for (const e of node.findDirectStructures(Structures.When)) {\r\n const w = e.findDirectStatement(Statements.When);\r\n if (w === undefined) {\r\n continue;\r\n }\r\n for (const s of w.findAllExpressions(Expressions.Source)) {\r\n conditions.push(s);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalConditions = IdenticalConditions;\r\n//# sourceMappingURL=identical_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_conditions.js?");
|
|
11822
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalConditions = exports.IdenticalConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass Conditions {\r\n constructor() {\r\n this.arr = [];\r\n this.arr = [];\r\n }\r\n push(e) {\r\n this.arr.push(e.concatTokens());\r\n }\r\n hasDuplicates() {\r\n return this.arr.some(x => this.arr.indexOf(x) !== this.arr.lastIndexOf(x));\r\n }\r\n}\r\nclass IdenticalConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalConditionsConf = IdenticalConditionsConf;\r\nclass IdenticalConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_conditions\",\r\n title: \"Identical conditions\",\r\n shortDescription: `Find identical conditions in IF + CASE + WHILE etc\r\n\r\nPrerequsites: code is pretty printed with identical cAsE`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructures(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n for (const i of structure.findAllStructures(Structures.Case)) {\r\n issues = issues.concat(this.analyzeWhen(file, i));\r\n }\r\n for (const i of structure.findAllExpressions(Expressions.Cond)) {\r\n issues = issues.concat(this.analyzeCond(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeCond(file, node) {\r\n const conditions = new Conditions();\r\n let operator = \"\";\r\n for (const c of node.getChildren()) {\r\n if (c instanceof nodes_1.ExpressionNode) {\r\n conditions.push(c);\r\n }\r\n else if (operator === \"\") {\r\n operator = c.get().getStr().toUpperCase();\r\n }\r\n else if (operator !== c.get().getStr().toUpperCase()) {\r\n return [];\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeIf(file, node) {\r\n var _a;\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.If);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no IF found\");\r\n }\r\n const c = i === null || i === void 0 ? void 0 : i.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n for (const e of node.findDirectStructures(Structures.ElseIf)) {\r\n const c = (_a = e.findDirectStatement(Statements.ElseIf)) === null || _a === void 0 ? void 0 : _a.findDirectExpression(Expressions.Cond);\r\n if (c) {\r\n conditions.push(c);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n analyzeWhen(file, node) {\r\n const conditions = new Conditions();\r\n const i = node.findDirectStatement(Statements.Case);\r\n if (i === undefined) {\r\n throw new Error(\"identical_conditions, no CASE found\");\r\n }\r\n for (const e of node.findDirectStructures(Structures.When)) {\r\n const w = e.findDirectStatement(Statements.When);\r\n if (w === undefined) {\r\n continue;\r\n }\r\n for (const s of w.findAllExpressions(Expressions.Source)) {\r\n conditions.push(s);\r\n }\r\n }\r\n if (conditions.hasDuplicates()) {\r\n const message = \"Identical conditions\";\r\n const issue = issue_1.Issue.atStatement(file, i, message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalConditions = IdenticalConditions;\r\n//# sourceMappingURL=identical_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_conditions.js?");
|
|
11790
11823
|
|
|
11791
11824
|
/***/ }),
|
|
11792
11825
|
|
|
@@ -11797,7 +11830,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11797
11830
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11798
11831
|
|
|
11799
11832
|
"use strict";
|
|
11800
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalContents = exports.IdenticalContentsConf = void 0;\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalContentsConf = IdenticalContentsConf;\r\nclass IdenticalContents extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalContentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_contents\",\r\n title: \"Identical contents\",\r\n shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,\r\n extendedInformation: `\nPrerequsites: code is pretty printed with identical cAsE\n\nChained statments are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF foo = bar.\n WRITE 'bar'.\n WRITE 'world'.\nELSE.\n WRITE 'foo'.\n WRITE 'world'.\nENDIF.`,\r\n goodExample: `IF foo = bar.\n WRITE 'bar'.\nELSE.\n WRITE 'foo'.\nENDIF.\nWRITE 'world'.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructuresRecursive(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeIf(file, node) {\r\n var _a;\r\n if (node.getChildren().length !== 4) {\r\n return [];\r\n }\r\n const ifBody = node.findDirectStructure(Structures.Body);\r\n if (node.findDirectStructure(Structures.ElseIf)) {\r\n return [];\r\n }\r\n const elseBody = (_a = node.findDirectStructure(Structures.Else)) === null || _a === void 0 ? void 0 : _a.findDirectStructure(Structures.Body);\r\n if (elseBody === undefined || ifBody === undefined) {\r\n return [];\r\n }\r\n {\r\n const ifFirst = ifBody.getFirstChild();\r\n const elseFirst = elseBody.getFirstChild();\r\n if (ifFirst === undefined || elseFirst === undefined || this.isChained(ifFirst)) {\r\n return [];\r\n }\r\n else if (ifFirst.concatTokens() === elseFirst.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n {\r\n const ifLast = ifBody.getLastChild();\r\n const elseLast = elseBody.getLastChild();\r\n if (ifLast === undefined || elseLast === undefined || this.isChained(ifLast)) {\r\n return [];\r\n }\r\n else if (ifLast.concatTokens() === elseLast.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n return [];\r\n }\r\n isChained(node) {\r\n if (node === undefined) {\r\n return false;\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n return node.getColon() !== undefined;\r\n }\r\n else {\r\n return this.isChained(node.getFirstStatement());\r\n }\r\n }\r\n}\r\nexports.IdenticalContents = IdenticalContents;\r\n//# sourceMappingURL=identical_contents.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_contents.js?");
|
|
11833
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalContents = exports.IdenticalContentsConf = void 0;\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nclass IdenticalContentsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalContentsConf = IdenticalContentsConf;\r\nclass IdenticalContents extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IdenticalContentsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_contents\",\r\n title: \"Identical contents\",\r\n shortDescription: `Find identical contents in blocks inside IFs, both in the beginning and in the end.`,\r\n extendedInformation: `\r\nPrerequsites: code is pretty printed with identical cAsE\r\n\r\nChained statments are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF foo = bar.\r\n WRITE 'bar'.\r\n WRITE 'world'.\r\nELSE.\r\n WRITE 'foo'.\r\n WRITE 'world'.\r\nENDIF.`,\r\n goodExample: `IF foo = bar.\r\n WRITE 'bar'.\r\nELSE.\r\n WRITE 'foo'.\r\nENDIF.\r\nWRITE 'world'.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n let issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const i of structure.findAllStructuresRecursive(Structures.If)) {\r\n issues = issues.concat(this.analyzeIf(file, i));\r\n }\r\n return issues;\r\n }\r\n ////////////////\r\n analyzeIf(file, node) {\r\n var _a;\r\n if (node.getChildren().length !== 4) {\r\n return [];\r\n }\r\n const ifBody = node.findDirectStructure(Structures.Body);\r\n if (node.findDirectStructure(Structures.ElseIf)) {\r\n return [];\r\n }\r\n const elseBody = (_a = node.findDirectStructure(Structures.Else)) === null || _a === void 0 ? void 0 : _a.findDirectStructure(Structures.Body);\r\n if (elseBody === undefined || ifBody === undefined) {\r\n return [];\r\n }\r\n {\r\n const ifFirst = ifBody.getFirstChild();\r\n const elseFirst = elseBody.getFirstChild();\r\n if (ifFirst === undefined || elseFirst === undefined || this.isChained(ifFirst)) {\r\n return [];\r\n }\r\n else if (ifFirst.concatTokens() === elseFirst.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n {\r\n const ifLast = ifBody.getLastChild();\r\n const elseLast = elseBody.getLastChild();\r\n if (ifLast === undefined || elseLast === undefined || this.isChained(ifLast)) {\r\n return [];\r\n }\r\n else if (ifLast.concatTokens() === elseLast.concatTokens()) {\r\n const message = \"Identical contents\";\r\n const issue = issue_1.Issue.atToken(file, node.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n }\r\n return [];\r\n }\r\n isChained(node) {\r\n if (node === undefined) {\r\n return false;\r\n }\r\n else if (node instanceof nodes_1.StatementNode) {\r\n return node.getColon() !== undefined;\r\n }\r\n else {\r\n return this.isChained(node.getFirstStatement());\r\n }\r\n }\r\n}\r\nexports.IdenticalContents = IdenticalContents;\r\n//# sourceMappingURL=identical_contents.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_contents.js?");
|
|
11801
11834
|
|
|
11802
11835
|
/***/ }),
|
|
11803
11836
|
|
|
@@ -11808,7 +11841,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11808
11841
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11809
11842
|
|
|
11810
11843
|
"use strict";
|
|
11811
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalDescriptions = exports.IdenticalDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass IdenticalDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalDescriptionsConf = IdenticalDescriptionsConf;\r\nclass IdenticalDescriptions {\r\n constructor() {\r\n this.conf = new IdenticalDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_descriptions\",\r\n title: \"Identical descriptions\",\r\n shortDescription: `Searches for objects with the same type and same description`,\r\n extendedInformation: `Case insensitive\n\nOnly checks the master language descriptions\n\nWorks for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n var _a;\r\n this.descriptions = {};\r\n this.types = [\"INTF\", \"CLAS\", \"DOMA\", \"DTEL\"];\r\n for (const o of reg.getObjects()) {\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n continue;\r\n }\r\n if (this.descriptions[type] === undefined) {\r\n this.descriptions[type] = {};\r\n }\r\n if (this.descriptions[type][description] === undefined) {\r\n this.descriptions[type][description] = [];\r\n }\r\n this.descriptions[type][description].push(o.getName());\r\n }\r\n }\r\n return this;\r\n }\r\n run(o) {\r\n var _a;\r\n const issues = [];\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n return issues;\r\n }\r\n const found = this.descriptions[type][description].filter(a => a !== o.getName());\r\n if (found.length > 0) {\r\n const message = \"Identical description: \" + found[0];\r\n issues.push(issue_1.Issue.atRow(o.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n if (o instanceof objects_1.FunctionGroup) {\r\n issues.push(...this.checkFunctionModules(o));\r\n }\r\n return issues;\r\n }\r\n checkFunctionModules(fugr) {\r\n var _a;\r\n const descriptions = {};\r\n for (const fm of fugr.getModules()) {\r\n const d = (_a = fm.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (d === undefined || d === \"\") {\r\n continue;\r\n }\r\n if (descriptions[d] !== undefined) {\r\n const message = \"FUGR \" + fugr.getName() + \" contains function modules with identical descriptions\";\r\n return [issue_1.Issue.atRow(fugr.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n descriptions[d] = true;\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalDescriptions = IdenticalDescriptions;\r\n//# sourceMappingURL=identical_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js?");
|
|
11844
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IdenticalDescriptions = exports.IdenticalDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nclass IdenticalDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IdenticalDescriptionsConf = IdenticalDescriptionsConf;\r\nclass IdenticalDescriptions {\r\n constructor() {\r\n this.conf = new IdenticalDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"identical_descriptions\",\r\n title: \"Identical descriptions\",\r\n shortDescription: `Searches for objects with the same type and same description`,\r\n extendedInformation: `Case insensitive\r\n\r\nOnly checks the master language descriptions\r\n\r\nWorks for: INTF, CLAS, DOMA, DTEL, FUNC in same FUGR`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n var _a;\r\n this.descriptions = {};\r\n this.types = [\"INTF\", \"CLAS\", \"DOMA\", \"DTEL\"];\r\n for (const o of reg.getObjects()) {\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n continue;\r\n }\r\n if (this.descriptions[type] === undefined) {\r\n this.descriptions[type] = {};\r\n }\r\n if (this.descriptions[type][description] === undefined) {\r\n this.descriptions[type][description] = [];\r\n }\r\n this.descriptions[type][description].push(o.getName());\r\n }\r\n }\r\n return this;\r\n }\r\n run(o) {\r\n var _a;\r\n const issues = [];\r\n const type = o.getType();\r\n if (this.types.includes(type)) {\r\n const description = (_a = o.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (description === undefined || description === \"\") {\r\n return issues;\r\n }\r\n const found = this.descriptions[type][description].filter(a => a !== o.getName());\r\n if (found.length > 0) {\r\n const message = \"Identical description: \" + found[0];\r\n issues.push(issue_1.Issue.atRow(o.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity));\r\n }\r\n }\r\n if (o instanceof objects_1.FunctionGroup) {\r\n issues.push(...this.checkFunctionModules(o));\r\n }\r\n return issues;\r\n }\r\n checkFunctionModules(fugr) {\r\n var _a;\r\n const descriptions = {};\r\n for (const fm of fugr.getModules()) {\r\n const d = (_a = fm.getDescription()) === null || _a === void 0 ? void 0 : _a.toUpperCase();\r\n if (d === undefined || d === \"\") {\r\n continue;\r\n }\r\n if (descriptions[d] !== undefined) {\r\n const message = \"FUGR \" + fugr.getName() + \" contains function modules with identical descriptions\";\r\n return [issue_1.Issue.atRow(fugr.getXMLFile(), 1, message, this.getMetadata().key, this.getConfig().severity)];\r\n }\r\n descriptions[d] = true;\r\n }\r\n return [];\r\n }\r\n}\r\nexports.IdenticalDescriptions = IdenticalDescriptions;\r\n//# sourceMappingURL=identical_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/identical_descriptions.js?");
|
|
11812
11845
|
|
|
11813
11846
|
/***/ }),
|
|
11814
11847
|
|
|
@@ -11830,7 +11863,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11830
11863
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11831
11864
|
|
|
11832
11865
|
"use strict";
|
|
11833
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfInIf = exports.IfInIfConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass IfInIfConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IfInIfConf = IfInIfConf;\r\nclass IfInIf extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IfInIfConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"if_in_if\",\r\n title: \"IF in IF\",\r\n shortDescription: `Detects nested ifs which can be refactored to a single condition using AND.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/01/\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,\r\n badExample: `IF condition1.\n IF condition2.\n ...\n ENDIF.\nENDIF.`,\r\n goodExample: `IF ( condition1 ) AND ( condition2 ).\n ...\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"IF in IF. Use IF cond1 AND cond2 instead\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n let possible = stru.findAllStructures(Structures.If);\r\n possible = possible.concat(stru.findAllStructures(Structures.Else));\r\n for (const i of possible) {\r\n if (i.findDirectStructures(Structures.ElseIf).length > 0\r\n || i.findDirectStructures(Structures.Else).length > 0) {\r\n continue;\r\n }\r\n const blist = i.findDirectStructures(Structures.Body);\r\n if (blist.length === 0) {\r\n continue;\r\n }\r\n const nlist = blist[0].findDirectStructures(Structures.Normal);\r\n if (nlist.length !== 1) {\r\n continue;\r\n }\r\n const niflist = nlist[0].findDirectStructures(Structures.If);\r\n if (niflist.length !== 1) {\r\n continue;\r\n }\r\n const nestedIf = niflist[0];\r\n if (i.get() instanceof Structures.If\r\n && (nestedIf.findDirectStructures(Structures.ElseIf).length > 0\r\n || nestedIf.findDirectStructures(Structures.Else).length > 0)) {\r\n continue;\r\n }\r\n const token = i.getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.IfInIf = IfInIf;\r\n//# sourceMappingURL=if_in_if.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/if_in_if.js?");
|
|
11866
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IfInIf = exports.IfInIfConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass IfInIfConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.IfInIfConf = IfInIfConf;\r\nclass IfInIf extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new IfInIfConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"if_in_if\",\r\n title: \"IF in IF\",\r\n shortDescription: `Detects nested ifs which can be refactored to a single condition using AND.`,\r\n extendedInformation: `https://docs.abapopenchecks.org/checks/01/\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low`,\r\n badExample: `IF condition1.\r\n IF condition2.\r\n ...\r\n ENDIF.\r\nENDIF.`,\r\n goodExample: `IF ( condition1 ) AND ( condition2 ).\r\n ...\r\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"IF in IF. Use IF cond1 AND cond2 instead\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n let possible = stru.findAllStructures(Structures.If);\r\n possible = possible.concat(stru.findAllStructures(Structures.Else));\r\n for (const i of possible) {\r\n if (i.findDirectStructures(Structures.ElseIf).length > 0\r\n || i.findDirectStructures(Structures.Else).length > 0) {\r\n continue;\r\n }\r\n const blist = i.findDirectStructures(Structures.Body);\r\n if (blist.length === 0) {\r\n continue;\r\n }\r\n const nlist = blist[0].findDirectStructures(Structures.Normal);\r\n if (nlist.length !== 1) {\r\n continue;\r\n }\r\n const niflist = nlist[0].findDirectStructures(Structures.If);\r\n if (niflist.length !== 1) {\r\n continue;\r\n }\r\n const nestedIf = niflist[0];\r\n if (i.get() instanceof Structures.If\r\n && (nestedIf.findDirectStructures(Structures.ElseIf).length > 0\r\n || nestedIf.findDirectStructures(Structures.Else).length > 0)) {\r\n continue;\r\n }\r\n const token = i.getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.IfInIf = IfInIf;\r\n//# sourceMappingURL=if_in_if.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/if_in_if.js?");
|
|
11834
11867
|
|
|
11835
11868
|
/***/ }),
|
|
11836
11869
|
|
|
@@ -11841,7 +11874,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11841
11874
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11842
11875
|
|
|
11843
11876
|
"use strict";
|
|
11844
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ImplementMethods = exports.ImplementMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// todo: abstract methods from superclass parents(might be multiple), if class is not abstract\r\nclass ImplementMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ImplementMethodsConf = ImplementMethodsConf;\r\nclass ImplementMethods extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ImplementMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"implement_methods\",\r\n title: \"Implement methods\",\r\n shortDescription: `Checks for abstract methods and methods from interfaces which need implementing.`,\r\n extendedInformation: `INCLUDE programs are only checked in connection with their main programs.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let ret = [];\r\n if (file.getStructure() === undefined) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n this.obj = obj;\r\n for (const classDefinition of file.getInfo().listClassDefinitions()) {\r\n const classImplementation = this.lookupImplementationInObject(classDefinition.name, obj);\r\n ret = ret.concat(this.checkClass(classDefinition, classImplementation));\r\n ret = ret.concat(this.checkInterfaces(classDefinition, classImplementation));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////////\r\n lookupImplementationInObject(name, obj) {\r\n for (const sub of obj.getABAPFiles()) {\r\n const impl = sub.getInfo().getClassImplementationByName(name);\r\n if (impl !== undefined) {\r\n return impl;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupDefinitionInObject(name) {\r\n for (const sub of this.obj.getABAPFiles()) {\r\n const def = sub.getInfo().getClassDefinitionByName(name);\r\n if (def !== undefined) {\r\n return def;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkClass(def, impl) {\r\n const ret = [];\r\n for (const md of def.methods) {\r\n const found = impl === null || impl === void 0 ? void 0 : impl.methods.find(m => m.getName().toUpperCase() === md.name.toUpperCase());\r\n if (md.isAbstract === true) {\r\n if (found !== undefined) {\r\n const issue = issue_1.Issue.atIdentifier(found, \"Do not implement abstract method \\\"\" + md.name + \"\\\"\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n continue;\r\n }\r\n if (impl === undefined) {\r\n const message = \"Class implementation for \\\"\" + def.name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n else if (found === undefined) {\r\n const message = \"Implement method \\\"\" + md.name + \"\\\"\";\r\n const fix = this.buildFix(impl, md.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n }\r\n return ret;\r\n }\r\n buildFix(impl, methodName) {\r\n var _a, _b;\r\n const file = this.obj.getABAPFileByName(impl.identifier.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {\r\n const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();\r\n if (name === impl.identifier.getName().toUpperCase()) {\r\n return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `\n METHOD ${methodName.toLowerCase()}.\n RETURN. \" todo, implement method\n ENDMETHOD.`);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findInterface(identifier, name) {\r\n const idef = this.findInterfaceByName(name);\r\n if (idef === undefined) {\r\n const message = \"Implemented interface \\\"\" + name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity);\r\n return issue;\r\n }\r\n return idef;\r\n }\r\n findInterfaceByName(name) {\r\n var _a;\r\n let idef = undefined;\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n if (intf === undefined) {\r\n // lookup in localfiles\r\n for (const file of this.obj.getABAPFiles()) {\r\n const found = file.getInfo().getInterfaceDefinitionByName(name);\r\n if (found) {\r\n idef = found;\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n idef = (_a = intf.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().listInterfaceDefinitions()[0];\r\n }\r\n return idef;\r\n }\r\n /** including implemented super interfaces */\r\n findInterfaceMethods(idef) {\r\n const methods = idef.methods.map((m) => {\r\n return { objectName: idef.name, method: m };\r\n });\r\n for (const i of idef.interfaces) {\r\n const sup = this.findInterface(idef.identifier, i.name);\r\n if (sup !== undefined && !(sup instanceof issue_1.Issue)) {\r\n sup.methods.forEach(m => {\r\n methods.push({ objectName: sup.name, method: m });\r\n });\r\n }\r\n }\r\n return methods;\r\n }\r\n findClass(name) {\r\n let def = this.lookupDefinitionInObject(name);\r\n let impl = this.lookupImplementationInObject(name, this.obj);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n const global = this.reg.getObject(\"CLAS\", name);\r\n if (global) {\r\n def = global.getClassDefinition();\r\n impl = this.lookupImplementationInObject(name, global);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkInterfaces(def, impl) {\r\n const ret = [];\r\n for (const interfaceInfo of def.interfaces) {\r\n const idef = this.findInterface(def.identifier, interfaceInfo.name);\r\n if (idef === undefined || interfaceInfo.partial === true || interfaceInfo.allAbstract === true) {\r\n continue; // ignore parser errors in interface\r\n }\r\n else if (idef instanceof issue_1.Issue) {\r\n return [idef];\r\n }\r\n for (const m of this.findInterfaceMethods(idef)) {\r\n if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {\r\n continue;\r\n }\r\n if (this.isImplemented(m, def, impl) === false) {\r\n const message = \"Implement method \\\"\" + m.method.name + \"\\\" from interface \\\"\" + m.objectName + \"\\\"\";\r\n if (impl) {\r\n const fix = this.buildFix(impl, m.objectName + \"~\" + m.method.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n else {\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n isImplemented(m, def, impl) {\r\n if (impl === undefined) {\r\n return false;\r\n }\r\n const name = m.objectName + \"~\" + m.method.name;\r\n let found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found === undefined) {\r\n // try looking for ALIASes\r\n for (const alias of def.aliases) {\r\n if (alias.component.toUpperCase() === name.toUpperCase()) {\r\n found = impl.methods.find(m => m.getName().toUpperCase() === alias.name.toUpperCase());\r\n break;\r\n }\r\n }\r\n }\r\n if (found === undefined && def.superClassName !== undefined) {\r\n const clas = this.findClass(def.superClassName);\r\n if (clas) {\r\n return this.isImplemented(m, clas === null || clas === void 0 ? void 0 : clas.def, clas === null || clas === void 0 ? void 0 : clas.impl);\r\n }\r\n }\r\n if (found === undefined) {\r\n for (const i of def.interfaces) {\r\n const idef = this.findInterfaceByName(i.name);\r\n if (idef === undefined) {\r\n continue;\r\n }\r\n const ali = this.viaAliasInInterface(m, idef, impl);\r\n if (ali) {\r\n return ali;\r\n }\r\n }\r\n }\r\n return found !== undefined;\r\n }\r\n viaAliasInInterface(m, intf, impl) {\r\n for (const a of intf.aliases) {\r\n if (a.component.toUpperCase() === m.objectName.toUpperCase() + \"~\" + m.method.name.toUpperCase()) {\r\n const name = intf.name + \"~\" + a.name;\r\n const found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ImplementMethods = ImplementMethods;\r\n//# sourceMappingURL=implement_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/implement_methods.js?");
|
|
11877
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ImplementMethods = exports.ImplementMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// todo: abstract methods from superclass parents(might be multiple), if class is not abstract\r\nclass ImplementMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ImplementMethodsConf = ImplementMethodsConf;\r\nclass ImplementMethods extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ImplementMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"implement_methods\",\r\n title: \"Implement methods\",\r\n shortDescription: `Checks for abstract methods and methods from interfaces which need implementing.`,\r\n extendedInformation: `INCLUDE programs are only checked in connection with their main programs.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Quickfix],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n let ret = [];\r\n if (file.getStructure() === undefined) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n this.obj = obj;\r\n for (const classDefinition of file.getInfo().listClassDefinitions()) {\r\n const classImplementation = this.lookupImplementationInObject(classDefinition.name, obj);\r\n ret = ret.concat(this.checkClass(classDefinition, classImplementation));\r\n ret = ret.concat(this.checkInterfaces(classDefinition, classImplementation));\r\n }\r\n return ret;\r\n }\r\n /////////////////////////////////\r\n lookupImplementationInObject(name, obj) {\r\n for (const sub of obj.getABAPFiles()) {\r\n const impl = sub.getInfo().getClassImplementationByName(name);\r\n if (impl !== undefined) {\r\n return impl;\r\n }\r\n }\r\n return undefined;\r\n }\r\n lookupDefinitionInObject(name) {\r\n for (const sub of this.obj.getABAPFiles()) {\r\n const def = sub.getInfo().getClassDefinitionByName(name);\r\n if (def !== undefined) {\r\n return def;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkClass(def, impl) {\r\n const ret = [];\r\n for (const md of def.methods) {\r\n const found = impl === null || impl === void 0 ? void 0 : impl.methods.find(m => m.getName().toUpperCase() === md.name.toUpperCase());\r\n if (md.isAbstract === true) {\r\n if (found !== undefined) {\r\n const issue = issue_1.Issue.atIdentifier(found, \"Do not implement abstract method \\\"\" + md.name + \"\\\"\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n continue;\r\n }\r\n if (impl === undefined) {\r\n const message = \"Class implementation for \\\"\" + def.name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n else if (found === undefined) {\r\n const message = \"Implement method \\\"\" + md.name + \"\\\"\";\r\n const fix = this.buildFix(impl, md.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n }\r\n return ret;\r\n }\r\n buildFix(impl, methodName) {\r\n var _a, _b;\r\n const file = this.obj.getABAPFileByName(impl.identifier.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const i of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.ClassImplementation)) || []) {\r\n const name = (_b = i.findFirstExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr().toUpperCase();\r\n if (name === impl.identifier.getName().toUpperCase()) {\r\n return edit_helper_1.EditHelper.insertAt(file, i.getLastToken().getEnd(), `\r\n METHOD ${methodName.toLowerCase()}.\r\n RETURN. \" todo, implement method\r\n ENDMETHOD.`);\r\n }\r\n }\r\n return undefined;\r\n }\r\n findInterface(identifier, name) {\r\n const idef = this.findInterfaceByName(name);\r\n if (idef === undefined) {\r\n const message = \"Implemented interface \\\"\" + name + \"\\\" not found\";\r\n const issue = issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity);\r\n return issue;\r\n }\r\n return idef;\r\n }\r\n findInterfaceByName(name) {\r\n var _a;\r\n let idef = undefined;\r\n const intf = this.reg.getObject(\"INTF\", name);\r\n if (intf === undefined) {\r\n // lookup in localfiles\r\n for (const file of this.obj.getABAPFiles()) {\r\n const found = file.getInfo().getInterfaceDefinitionByName(name);\r\n if (found) {\r\n idef = found;\r\n break;\r\n }\r\n }\r\n }\r\n else {\r\n idef = (_a = intf.getMainABAPFile()) === null || _a === void 0 ? void 0 : _a.getInfo().listInterfaceDefinitions()[0];\r\n }\r\n return idef;\r\n }\r\n /** including implemented super interfaces */\r\n findInterfaceMethods(idef) {\r\n const methods = idef.methods.map((m) => {\r\n return { objectName: idef.name, method: m };\r\n });\r\n for (const i of idef.interfaces) {\r\n const sup = this.findInterface(idef.identifier, i.name);\r\n if (sup !== undefined && !(sup instanceof issue_1.Issue)) {\r\n sup.methods.forEach(m => {\r\n methods.push({ objectName: sup.name, method: m });\r\n });\r\n }\r\n }\r\n return methods;\r\n }\r\n findClass(name) {\r\n let def = this.lookupDefinitionInObject(name);\r\n let impl = this.lookupImplementationInObject(name, this.obj);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n const global = this.reg.getObject(\"CLAS\", name);\r\n if (global) {\r\n def = global.getClassDefinition();\r\n impl = this.lookupImplementationInObject(name, global);\r\n if (def && impl) {\r\n return { def, impl };\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkInterfaces(def, impl) {\r\n const ret = [];\r\n for (const interfaceInfo of def.interfaces) {\r\n const idef = this.findInterface(def.identifier, interfaceInfo.name);\r\n if (idef === undefined || interfaceInfo.partial === true || interfaceInfo.allAbstract === true) {\r\n continue; // ignore parser errors in interface\r\n }\r\n else if (idef instanceof issue_1.Issue) {\r\n return [idef];\r\n }\r\n for (const m of this.findInterfaceMethods(idef)) {\r\n if (interfaceInfo.abstractMethods.includes(m.method.name.toUpperCase())) {\r\n continue;\r\n }\r\n if (this.isImplemented(m, def, impl) === false) {\r\n const message = \"Implement method \\\"\" + m.method.name + \"\\\" from interface \\\"\" + m.objectName + \"\\\"\";\r\n if (impl) {\r\n const fix = this.buildFix(impl, m.objectName + \"~\" + m.method.name);\r\n const issue = issue_1.Issue.atIdentifier(impl.identifier, message, this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n }\r\n else {\r\n const issue = issue_1.Issue.atIdentifier(def.identifier, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n isImplemented(m, def, impl) {\r\n if (impl === undefined) {\r\n return false;\r\n }\r\n const name = m.objectName + \"~\" + m.method.name;\r\n let found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found === undefined) {\r\n // try looking for ALIASes\r\n for (const alias of def.aliases) {\r\n if (alias.component.toUpperCase() === name.toUpperCase()) {\r\n found = impl.methods.find(m => m.getName().toUpperCase() === alias.name.toUpperCase());\r\n break;\r\n }\r\n }\r\n }\r\n if (found === undefined && def.superClassName !== undefined) {\r\n const clas = this.findClass(def.superClassName);\r\n if (clas) {\r\n return this.isImplemented(m, clas === null || clas === void 0 ? void 0 : clas.def, clas === null || clas === void 0 ? void 0 : clas.impl);\r\n }\r\n }\r\n if (found === undefined) {\r\n for (const i of def.interfaces) {\r\n const idef = this.findInterfaceByName(i.name);\r\n if (idef === undefined) {\r\n continue;\r\n }\r\n const ali = this.viaAliasInInterface(m, idef, impl);\r\n if (ali) {\r\n return ali;\r\n }\r\n }\r\n }\r\n return found !== undefined;\r\n }\r\n viaAliasInInterface(m, intf, impl) {\r\n for (const a of intf.aliases) {\r\n if (a.component.toUpperCase() === m.objectName.toUpperCase() + \"~\" + m.method.name.toUpperCase()) {\r\n const name = intf.name + \"~\" + a.name;\r\n const found = impl.methods.find(m => m.getName().toUpperCase() === name.toUpperCase());\r\n if (found) {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.ImplementMethods = ImplementMethods;\r\n//# sourceMappingURL=implement_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/implement_methods.js?");
|
|
11845
11878
|
|
|
11846
11879
|
/***/ }),
|
|
11847
11880
|
|
|
@@ -11852,7 +11885,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11852
11885
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11853
11886
|
|
|
11854
11887
|
"use strict";
|
|
11855
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InStatementIndentation = exports.InStatementIndentationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass InStatementIndentationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Additional indent for first statement of blocks */\r\n this.blockStatements = 2;\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.InStatementIndentationConf = InStatementIndentationConf;\r\nclass InStatementIndentation extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new InStatementIndentationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"in_statement_indentation\",\r\n title: \"In-statement indentation\",\r\n shortDescription: \"Checks alignment within statements which span multiple lines.\",\r\n extendedInformation: `Lines following the first line should be indented once (2 spaces).\n \nFor block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)\nto distinguish them better from code within the block.`,\r\n badExample: `IF 1 = 1\n AND 2 = 2.\n WRITE 'hello' &&\n 'world'.\nENDIF.`,\r\n goodExample: `IF 1 = 1\n AND 2 = 2.\n WRITE 'hello' &&\n 'world'.\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Fix in-statement indentation\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const ret = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n for (const s of file.getStatements()) {\r\n if (s.get() instanceof _statement_1.Comment || s.get() instanceof _statement_1.Unknown) {\r\n continue;\r\n }\r\n const tokens = s.getTokens();\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const beginLine = tokens[0].getRow();\r\n let expected = tokens[0].getCol() + 2;\r\n const type = s.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.When\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation) {\r\n expected = expected + this.conf.blockStatements;\r\n }\r\n for (const t of tokens) {\r\n if (t.getRow() === beginLine) {\r\n continue;\r\n }\r\n if (t.getCol() < expected) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(t.getRow(), 1), t.getStart(), \" \".repeat(expected - 1));\r\n const issue = issue_1.Issue.atToken(file, t, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InStatementIndentation = InStatementIndentation;\r\n//# sourceMappingURL=in_statement_indentation.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js?");
|
|
11888
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.InStatementIndentation = exports.InStatementIndentationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass InStatementIndentationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Additional indent for first statement of blocks */\r\n this.blockStatements = 2;\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.InStatementIndentationConf = InStatementIndentationConf;\r\nclass InStatementIndentation extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new InStatementIndentationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"in_statement_indentation\",\r\n title: \"In-statement indentation\",\r\n shortDescription: \"Checks alignment within statements which span multiple lines.\",\r\n extendedInformation: `Lines following the first line should be indented once (2 spaces).\r\n \r\nFor block declaration statements, lines after the first should be indented an additional time (default: +2 spaces)\r\nto distinguish them better from code within the block.`,\r\n badExample: `IF 1 = 1\r\n AND 2 = 2.\r\n WRITE 'hello' &&\r\n 'world'.\r\nENDIF.`,\r\n goodExample: `IF 1 = 1\r\n AND 2 = 2.\r\n WRITE 'hello' &&\r\n 'world'.\r\nENDIF.`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Fix in-statement indentation\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const ret = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n for (const s of file.getStatements()) {\r\n if (s.get() instanceof _statement_1.Comment || s.get() instanceof _statement_1.Unknown) {\r\n continue;\r\n }\r\n const tokens = s.getTokens();\r\n if (tokens.length === 0) {\r\n continue;\r\n }\r\n const beginLine = tokens[0].getRow();\r\n let expected = tokens[0].getCol() + 2;\r\n const type = s.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Module\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.FunctionModule\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.At\r\n || type instanceof Statements.Catch\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.When\r\n || type instanceof Statements.Cleanup\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.Form\r\n || type instanceof Statements.Else\r\n || type instanceof Statements.ElseIf\r\n || type instanceof Statements.MethodImplementation) {\r\n expected = expected + this.conf.blockStatements;\r\n }\r\n for (const t of tokens) {\r\n if (t.getRow() === beginLine) {\r\n continue;\r\n }\r\n if (t.getCol() < expected) {\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, new position_1.Position(t.getRow(), 1), t.getStart(), \" \".repeat(expected - 1));\r\n const issue = issue_1.Issue.atToken(file, t, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n ret.push(issue);\r\n break;\r\n }\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.InStatementIndentation = InStatementIndentation;\r\n//# sourceMappingURL=in_statement_indentation.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/in_statement_indentation.js?");
|
|
11856
11889
|
|
|
11857
11890
|
/***/ }),
|
|
11858
11891
|
|
|
@@ -11896,7 +11929,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11896
11929
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11897
11930
|
|
|
11898
11931
|
"use strict";
|
|
11899
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IntfReferencingClas = exports.IntfReferencingClasConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass IntfReferencingClasConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of classes allowed to be referenced, regex, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.allow = [];\r\n }\r\n}\r\nexports.IntfReferencingClasConf = IntfReferencingClasConf;\r\nclass IntfReferencingClas {\r\n constructor() {\r\n this.conf = new IntfReferencingClasConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"intf_referencing_clas\",\r\n title: \"INTF referencing CLAS\",\r\n shortDescription: `Interface contains references to class`,\r\n extendedInformation: `Only global interfaces are checked.\n Only first level references are checked.\n Exception class references are ignored.\n Void references are ignored.`,\r\n };\r\n }\r\n getConfig() {\r\n if (this.conf.allow === undefined) {\r\n this.conf.allow = [];\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Interface)) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ////////////////\r\n traverse(node) {\r\n var _a, _b;\r\n let ret = [];\r\n const message = \"Referencing CLAS: \";\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooType) === \"CLAS\"\r\n && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName) !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", r.extra.ooName) || undefined;\r\n if (found && ddic.isException(found.getClassDefinition(), found)) {\r\n continue;\r\n }\r\n else if (this.getConfig().allow.some(reg => new RegExp(reg, \"i\").test(r.extra.ooName))) {\r\n continue;\r\n }\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.extra.ooName, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.IntfReferencingClas = IntfReferencingClas;\r\n//# sourceMappingURL=intf_referencing_clas.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js?");
|
|
11932
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IntfReferencingClas = exports.IntfReferencingClasConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass IntfReferencingClasConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** List of classes allowed to be referenced, regex, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.allow = [];\r\n }\r\n}\r\nexports.IntfReferencingClasConf = IntfReferencingClasConf;\r\nclass IntfReferencingClas {\r\n constructor() {\r\n this.conf = new IntfReferencingClasConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"intf_referencing_clas\",\r\n title: \"INTF referencing CLAS\",\r\n shortDescription: `Interface contains references to class`,\r\n extendedInformation: `Only global interfaces are checked.\r\n Only first level references are checked.\r\n Exception class references are ignored.\r\n Void references are ignored.`,\r\n };\r\n }\r\n getConfig() {\r\n if (this.conf.allow === undefined) {\r\n this.conf.allow = [];\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Interface)) {\r\n return [];\r\n }\r\n return this.traverse(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n }\r\n ////////////////\r\n traverse(node) {\r\n var _a, _b;\r\n let ret = [];\r\n const message = \"Referencing CLAS: \";\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.ObjectOrientedReference\r\n && ((_a = r.extra) === null || _a === void 0 ? void 0 : _a.ooType) === \"CLAS\"\r\n && ((_b = r.extra) === null || _b === void 0 ? void 0 : _b.ooName) !== undefined) {\r\n const found = this.reg.getObject(\"CLAS\", r.extra.ooName) || undefined;\r\n if (found && ddic.isException(found.getClassDefinition(), found)) {\r\n continue;\r\n }\r\n else if (this.getConfig().allow.some(reg => new RegExp(reg, \"i\").test(r.extra.ooName))) {\r\n continue;\r\n }\r\n ret.push(issue_1.Issue.atIdentifier(r.position, message + r.extra.ooName, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.traverse(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.IntfReferencingClas = IntfReferencingClas;\r\n//# sourceMappingURL=intf_referencing_clas.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/intf_referencing_clas.js?");
|
|
11900
11933
|
|
|
11901
11934
|
/***/ }),
|
|
11902
11935
|
|
|
@@ -11940,7 +11973,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11940
11973
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11941
11974
|
|
|
11942
11975
|
"use strict";
|
|
11943
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineBreakStyle = exports.LineBreakStyleConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.LineBreakStyleConf = LineBreakStyleConf;\r\nclass LineBreakStyle {\r\n constructor() {\r\n this.conf = new LineBreakStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_break_style\",\r\n title: \"Makes sure line breaks are consistent in the ABAP code\",\r\n shortDescription: `Enforces LF as newlines in ABAP files\n\nabapGit does not work with CRLF`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n if (file.getFilename().endsWith(\".abap\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n if (rows[i].endsWith(\"\\r\") === true) {\r\n const message = \"Line contains carriage return\";\r\n const issue = issue_1.Issue.atRow(file, i + 1, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.LineBreakStyle = LineBreakStyle;\r\n//# sourceMappingURL=line_break_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_break_style.js?");
|
|
11976
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineBreakStyle = exports.LineBreakStyleConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineBreakStyleConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.LineBreakStyleConf = LineBreakStyleConf;\r\nclass LineBreakStyle {\r\n constructor() {\r\n this.conf = new LineBreakStyleConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_break_style\",\r\n title: \"Makes sure line breaks are consistent in the ABAP code\",\r\n shortDescription: `Enforces LF as newlines in ABAP files\r\n\r\nabapGit does not work with CRLF`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n const output = [];\r\n for (const file of obj.getFiles()) {\r\n if (file.getFilename().endsWith(\".abap\")) {\r\n const rows = file.getRawRows();\r\n for (let i = 0; i < rows.length; i++) {\r\n if (rows[i].endsWith(\"\\r\") === true) {\r\n const message = \"Line contains carriage return\";\r\n const issue = issue_1.Issue.atRow(file, i + 1, message, this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.LineBreakStyle = LineBreakStyle;\r\n//# sourceMappingURL=line_break_style.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_break_style.js?");
|
|
11944
11977
|
|
|
11945
11978
|
/***/ }),
|
|
11946
11979
|
|
|
@@ -11951,7 +11984,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11951
11984
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11952
11985
|
|
|
11953
11986
|
"use strict";
|
|
11954
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineLength = exports.LineLengthConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum line length in characters, trailing whitespace ignored */\r\n this.length = 120;\r\n }\r\n}\r\nexports.LineLengthConf = LineLengthConf;\r\nclass LineLength extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineLengthConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_length\",\r\n title: \"Line length\",\r\n shortDescription: `Detects lines exceeding the provided maximum length.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length\nhttps://docs.abapopenchecks.org/checks/04/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n // maximum line length in abap files\r\n const maxLineLength = 255;\r\n file.getRawRows().forEach((row, rowIndex) => {\r\n row = row.replace(\"\\r\", \"\");\r\n let message = \"\";\r\n if (row.length > maxLineLength) {\r\n message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;\r\n }\r\n else if (row.length > this.conf.length) {\r\n message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;\r\n }\r\n else {\r\n return;\r\n }\r\n issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));\r\n });\r\n return issues;\r\n }\r\n}\r\nexports.LineLength = LineLength;\r\n//# sourceMappingURL=line_length.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_length.js?");
|
|
11987
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineLength = exports.LineLengthConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LineLengthConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum line length in characters, trailing whitespace ignored */\r\n this.length = 120;\r\n }\r\n}\r\nexports.LineLengthConf = LineLengthConf;\r\nclass LineLength extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineLengthConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_length\",\r\n title: \"Line length\",\r\n shortDescription: `Detects lines exceeding the provided maximum length.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#stick-to-a-reasonable-line-length\r\nhttps://docs.abapopenchecks.org/checks/04/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n // maximum line length in abap files\r\n const maxLineLength = 255;\r\n file.getRawRows().forEach((row, rowIndex) => {\r\n row = row.replace(\"\\r\", \"\");\r\n let message = \"\";\r\n if (row.length > maxLineLength) {\r\n message = `Maximum allowed line length of ${maxLineLength} exceeded, currently ${row.length}`;\r\n }\r\n else if (row.length > this.conf.length) {\r\n message = `Reduce line length to max ${this.conf.length}, currently ${row.length}`;\r\n }\r\n else {\r\n return;\r\n }\r\n issues.push(issue_1.Issue.atRow(file, rowIndex + 1, message, this.getMetadata().key, this.conf.severity));\r\n });\r\n return issues;\r\n }\r\n}\r\nexports.LineLength = LineLength;\r\n//# sourceMappingURL=line_length.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_length.js?");
|
|
11955
11988
|
|
|
11956
11989
|
/***/ }),
|
|
11957
11990
|
|
|
@@ -11962,7 +11995,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11962
11995
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11963
11996
|
|
|
11964
11997
|
"use strict";
|
|
11965
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineOnlyPunc = exports.LineOnlyPuncConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass LineOnlyPuncConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore lines with only puncutation in global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.LineOnlyPuncConf = LineOnlyPuncConf;\r\nclass LineOnlyPunc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineOnlyPuncConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_only_punc\",\r\n title: \"Line containing only punctuation\",\r\n shortDescription: `Detects lines containing only punctuation.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end\nhttps://docs.abapopenchecks.org/checks/16/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: \"zcl_class=>method(\\n).\",\r\n goodExample: \"zcl_class=>method( ).\",\r\n };\r\n }\r\n getMessage() {\r\n return \"A line should not contain only \\\".\\\" or \\\").\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n const rows = file.getRawRows();\r\n const reg = new RegExp(\"^\\\\)?\\\\. *(\\\\\\\".*)?$\");\r\n for (let i = 0; i < rows.length; i++) {\r\n if (reg.exec(rows[i].trim())) {\r\n const column = rows[i].indexOf(\")\") >= 0 ? rows[i].indexOf(\")\") + 1 : rows[i].indexOf(\".\") + 1;\r\n const position = new position_1.Position(i + 1, column);\r\n // merge punc into previous row\r\n let rowContent = rows[i].trim();\r\n // if reported row contains a paranthesis, prefix with space if needed\r\n if (rowContent.length > 1 && !rows[i - 1].endsWith(\" \") && !rows[i - 1].endsWith(\" \\r\")) {\r\n rowContent = \" \" + rowContent;\r\n }\r\n let offset = 0;\r\n if (rows[i - 1].endsWith(\"\\r\")) {\r\n offset = -1;\r\n }\r\n const startPos = new position_1.Position(i, rows[i - 1].length + 1 + offset);\r\n const endPos = new position_1.Position(i + 1, rows[i].length + 1);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, startPos, endPos, rowContent);\r\n const issue = issue_1.Issue.atPosition(file, position, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.LineOnlyPunc = LineOnlyPunc;\r\n//# sourceMappingURL=line_only_punc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_only_punc.js?");
|
|
11998
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LineOnlyPunc = exports.LineOnlyPuncConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass LineOnlyPuncConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore lines with only puncutation in global exception classes */\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.LineOnlyPuncConf = LineOnlyPuncConf;\r\nclass LineOnlyPunc extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LineOnlyPuncConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"line_only_punc\",\r\n title: \"Line containing only punctuation\",\r\n shortDescription: `Detects lines containing only punctuation.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#close-brackets-at-line-end\r\nhttps://docs.abapopenchecks.org/checks/16/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: \"zcl_class=>method(\\n).\",\r\n goodExample: \"zcl_class=>method( ).\",\r\n };\r\n }\r\n getMessage() {\r\n return \"A line should not contain only \\\".\\\" or \\\").\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof objects_1.Class) {\r\n const definition = obj.getClassDefinition();\r\n if (definition === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n const rows = file.getRawRows();\r\n const reg = new RegExp(\"^\\\\)?\\\\. *(\\\\\\\".*)?$\");\r\n for (let i = 0; i < rows.length; i++) {\r\n if (reg.exec(rows[i].trim())) {\r\n const column = rows[i].indexOf(\")\") >= 0 ? rows[i].indexOf(\")\") + 1 : rows[i].indexOf(\".\") + 1;\r\n const position = new position_1.Position(i + 1, column);\r\n // merge punc into previous row\r\n let rowContent = rows[i].trim();\r\n // if reported row contains a paranthesis, prefix with space if needed\r\n if (rowContent.length > 1 && !rows[i - 1].endsWith(\" \") && !rows[i - 1].endsWith(\" \\r\")) {\r\n rowContent = \" \" + rowContent;\r\n }\r\n let offset = 0;\r\n if (rows[i - 1].endsWith(\"\\r\")) {\r\n offset = -1;\r\n }\r\n const startPos = new position_1.Position(i, rows[i - 1].length + 1 + offset);\r\n const endPos = new position_1.Position(i + 1, rows[i].length + 1);\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, startPos, endPos, rowContent);\r\n const issue = issue_1.Issue.atPosition(file, position, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.LineOnlyPunc = LineOnlyPunc;\r\n//# sourceMappingURL=line_only_punc.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/line_only_punc.js?");
|
|
11966
11999
|
|
|
11967
12000
|
/***/ }),
|
|
11968
12001
|
|
|
@@ -11995,7 +12028,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
11995
12028
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
11996
12029
|
|
|
11997
12030
|
"use strict";
|
|
11998
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LocalVariableNames = exports.LocalVariableNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_naming_rule_config.js\");\r\nconst name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ \"./node_modules/@abaplint/core/build/src/utils/name_validator.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LocalVariableNamesConf extends _naming_rule_config_1.NamingRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** The pattern for local variable names */\r\n this.expectedData = \"^L._.+$\";\r\n /** The pattern for local constant names */\r\n this.expectedConstant = \"^LC_.+$\";\r\n /** The pattern for field symbol names */\r\n this.expectedFS = \"^<L._.+>$\";\r\n }\r\n}\r\nexports.LocalVariableNamesConf = LocalVariableNamesConf;\r\nclass LocalVariableNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LocalVariableNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"local_variable_names\",\r\n title: \"Local variable naming conventions\",\r\n shortDescription: `\nAllows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.\nRegexes are case-insensitive.`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(expected, actual) {\r\n return this.conf.patternKind === \"required\" ?\r\n \"Local variable name does not match pattern \" + expected + \": \" + actual :\r\n \"Local variable name must not match pattern \" + expected + \": \" + actual;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n if (this.conf.patternKind === undefined) {\r\n this.conf.patternKind = \"required\";\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n // inside METHOD, FORM, FUNCTION MODULE\r\n for (const node of stru.findAllStructures(Structures.Form)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.Method)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.FunctionModule)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n return ret;\r\n }\r\n checkLocals(structure, file) {\r\n let ret = [];\r\n // data, field symbols\r\n for (const dat of structure.findAllStatements(Statements.Data)) {\r\n const parent = structure.findParent(dat);\r\n if (parent && parent.get() instanceof Structures.Data) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = dat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // inline data\r\n for (const dat of structure.findAllExpressions(Expressions.InlineData)) {\r\n const found = dat.findFirstExpression(Expressions.TargetField);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // data structures, data begin of, first level\r\n const dataStructures = structure.findAllStructures(Structures.Data);\r\n for (const struc of dataStructures) {\r\n // ignore nested DATA BEGIN\r\n const stat = struc.findFirstStatement(Statements.DataBegin);\r\n const found = stat === null || stat === void 0 ? void 0 : stat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n for (const fieldsymbol of structure.findAllStatements(Statements.FieldSymbol)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.FieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n // inline field symbols\r\n for (const fieldsymbol of structure.findAllExpressions(Expressions.InlineFS)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.TargetFieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n const constants = structure.findAllStatements(Statements.Constant);\r\n for (const constant of constants) {\r\n const parent = structure.findParent(constant);\r\n if (parent && parent.get() instanceof Structures.Constants) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = constant.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedConstant));\r\n }\r\n }\r\n return ret;\r\n }\r\n checkName(token, file, expected) {\r\n const ret = [];\r\n const regex = new RegExp(expected, \"i\");\r\n const name = token.getStr();\r\n if (name_validator_1.NameValidator.violatesRule(name, regex, this.conf)) {\r\n const message = this.getDescription(expected, name);\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.LocalVariableNames = LocalVariableNames;\r\n//# sourceMappingURL=local_variable_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/local_variable_names.js?");
|
|
12031
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.LocalVariableNames = exports.LocalVariableNamesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _naming_rule_config_1 = __webpack_require__(/*! ./_naming_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_naming_rule_config.js\");\r\nconst name_validator_1 = __webpack_require__(/*! ../utils/name_validator */ \"./node_modules/@abaplint/core/build/src/utils/name_validator.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass LocalVariableNamesConf extends _naming_rule_config_1.NamingRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** The pattern for local variable names */\r\n this.expectedData = \"^L._.+$\";\r\n /** The pattern for local constant names */\r\n this.expectedConstant = \"^LC_.+$\";\r\n /** The pattern for field symbol names */\r\n this.expectedFS = \"^<L._.+>$\";\r\n }\r\n}\r\nexports.LocalVariableNamesConf = LocalVariableNamesConf;\r\nclass LocalVariableNames extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new LocalVariableNamesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"local_variable_names\",\r\n title: \"Local variable naming conventions\",\r\n shortDescription: `\r\nAllows you to enforce a pattern, such as a prefix, for local variables, constants and field symbols.\r\nRegexes are case-insensitive.`,\r\n tags: [_irule_1.RuleTag.Naming, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(expected, actual) {\r\n return this.conf.patternKind === \"required\" ?\r\n \"Local variable name does not match pattern \" + expected + \": \" + actual :\r\n \"Local variable name must not match pattern \" + expected + \": \" + actual;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n if (this.conf.patternKind === undefined) {\r\n this.conf.patternKind = \"required\";\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n // inside METHOD, FORM, FUNCTION MODULE\r\n for (const node of stru.findAllStructures(Structures.Form)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.Method)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n for (const node of stru.findAllStructures(Structures.FunctionModule)) {\r\n ret.push(...this.checkLocals(node, file));\r\n }\r\n return ret;\r\n }\r\n checkLocals(structure, file) {\r\n let ret = [];\r\n // data, field symbols\r\n for (const dat of structure.findAllStatements(Statements.Data)) {\r\n const parent = structure.findParent(dat);\r\n if (parent && parent.get() instanceof Structures.Data) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = dat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // inline data\r\n for (const dat of structure.findAllExpressions(Expressions.InlineData)) {\r\n const found = dat.findFirstExpression(Expressions.TargetField);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n // data structures, data begin of, first level\r\n const dataStructures = structure.findAllStructures(Structures.Data);\r\n for (const struc of dataStructures) {\r\n // ignore nested DATA BEGIN\r\n const stat = struc.findFirstStatement(Statements.DataBegin);\r\n const found = stat === null || stat === void 0 ? void 0 : stat.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedData));\r\n }\r\n }\r\n for (const fieldsymbol of structure.findAllStatements(Statements.FieldSymbol)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.FieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n // inline field symbols\r\n for (const fieldsymbol of structure.findAllExpressions(Expressions.InlineFS)) {\r\n const found = fieldsymbol.findFirstExpression(Expressions.TargetFieldSymbol);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedFS));\r\n }\r\n }\r\n const constants = structure.findAllStatements(Statements.Constant);\r\n for (const constant of constants) {\r\n const parent = structure.findParent(constant);\r\n if (parent && parent.get() instanceof Structures.Constants) {\r\n continue; // inside DATA BEGIN OF\r\n }\r\n const found = constant.findFirstExpression(Expressions.DefinitionName);\r\n if (found) {\r\n const token = found.getFirstToken();\r\n ret = ret.concat(this.checkName(token, file, this.conf.expectedConstant));\r\n }\r\n }\r\n return ret;\r\n }\r\n checkName(token, file, expected) {\r\n const ret = [];\r\n const regex = new RegExp(expected, \"i\");\r\n const name = token.getStr();\r\n if (name_validator_1.NameValidator.violatesRule(name, regex, this.conf)) {\r\n const message = this.getDescription(expected, name);\r\n const issue = issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.LocalVariableNames = LocalVariableNames;\r\n//# sourceMappingURL=local_variable_names.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/local_variable_names.js?");
|
|
11999
12032
|
|
|
12000
12033
|
/***/ }),
|
|
12001
12034
|
|
|
@@ -12017,7 +12050,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12017
12050
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12018
12051
|
|
|
12019
12052
|
"use strict";
|
|
12020
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ManyParentheses = exports.ManyParenthesesConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ManyParenthesesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ManyParenthesesConf = ManyParenthesesConf;\r\nclass ManyParentheses extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ManyParenthesesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"many_parentheses\",\r\n title: \"Too many parentheses\",\r\n shortDescription: `Searches for expressions where extra parentheses can safely be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `\nIF ( destination IS INITIAL ).\nENDIF.\nIF foo = boo AND ( bar = lar AND moo = loo ).\nENDIF.\n`,\r\n goodExample: `\nIF destination IS INITIAL.\nENDIF.\nIF foo = boo AND bar = lar AND moo = loo.\nENDIF.\n`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const cond of structure.findAllExpressions(Expressions.Cond)) {\r\n issues.push(...this.analyze(file, cond));\r\n }\r\n for (const sub of structure.findAllExpressions(Expressions.CondSub)) {\r\n const cond = sub.findDirectExpressions(Expressions.Cond);\r\n if (cond.length !== 1) {\r\n continue;\r\n }\r\n if (cond[0].getChildren().length === 1) {\r\n const message = \"Too many parentheses, simple\";\r\n const fixText = sub.getChildren()[1].concatTokens();\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, sub.getFirstToken().getStart(), sub.getLastToken().getEnd(), fixText);\r\n const issue = issue_1.Issue.atToken(file, sub.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const m of structure.findAllStatements(Statements.Move)) {\r\n issues.push(...this.analyzeMove(file, m));\r\n }\r\n return issues;\r\n }\r\n ////////////////////\r\n analyzeMove(file, m) {\r\n const issues = [];\r\n const children = m.getChildren();\r\n const last = children[children.length - 2];\r\n const lastChildren = last.getChildren();\r\n if (lastChildren.length === 3\r\n && lastChildren[0].getFirstToken().getStr() === \"(\"\r\n && lastChildren[2].getFirstToken().getStr() === \")\") {\r\n const issue = issue_1.Issue.atToken(file, last.getFirstToken(), \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n analyze(file, cond) {\r\n const issues = [];\r\n let comparator = \"\";\r\n for (const c of cond.getChildren()) {\r\n let current = \"\";\r\n if (c instanceof nodes_1.TokenNode) {\r\n current = c.get().getStr().toUpperCase();\r\n }\r\n else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.CondSub) {\r\n if (c.getFirstToken().getStr().toUpperCase() === \"NOT\") {\r\n return [];\r\n }\r\n const i = c.findDirectExpression(Expressions.Cond);\r\n if (i === undefined) {\r\n return [];\r\n }\r\n current = this.findComparator(i);\r\n }\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (comparator !== current) {\r\n return [];\r\n }\r\n }\r\n if (comparator !== \"\" && comparator !== \"MIXED\") {\r\n const message = \"Too many parentheses, complex\";\r\n const issue = issue_1.Issue.atToken(file, cond.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n findComparator(cond) {\r\n let comparator = \"\";\r\n const children = cond.getChildren();\r\n for (const c of children) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const current = c.get().getStr().toUpperCase();\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (current !== comparator) {\r\n return \"MIXED\";\r\n }\r\n }\r\n }\r\n return comparator;\r\n }\r\n}\r\nexports.ManyParentheses = ManyParentheses;\r\n//# sourceMappingURL=many_parentheses.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/many_parentheses.js?");
|
|
12053
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ManyParentheses = exports.ManyParenthesesConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass ManyParenthesesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ManyParenthesesConf = ManyParenthesesConf;\r\nclass ManyParentheses extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ManyParenthesesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"many_parentheses\",\r\n title: \"Too many parentheses\",\r\n shortDescription: `Searches for expressions where extra parentheses can safely be removed`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n badExample: `\r\nIF ( destination IS INITIAL ).\r\nENDIF.\r\nIF foo = boo AND ( bar = lar AND moo = loo ).\r\nENDIF.\r\n`,\r\n goodExample: `\r\nIF destination IS INITIAL.\r\nENDIF.\r\nIF foo = boo AND bar = lar AND moo = loo.\r\nENDIF.\r\n`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const structure = file.getStructure();\r\n if (structure === undefined) {\r\n return [];\r\n }\r\n for (const cond of structure.findAllExpressions(Expressions.Cond)) {\r\n issues.push(...this.analyze(file, cond));\r\n }\r\n for (const sub of structure.findAllExpressions(Expressions.CondSub)) {\r\n const cond = sub.findDirectExpressions(Expressions.Cond);\r\n if (cond.length !== 1) {\r\n continue;\r\n }\r\n if (cond[0].getChildren().length === 1) {\r\n const message = \"Too many parentheses, simple\";\r\n const fixText = sub.getChildren()[1].concatTokens();\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, sub.getFirstToken().getStart(), sub.getLastToken().getEnd(), fixText);\r\n const issue = issue_1.Issue.atToken(file, sub.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const m of structure.findAllStatements(Statements.Move)) {\r\n issues.push(...this.analyzeMove(file, m));\r\n }\r\n return issues;\r\n }\r\n ////////////////////\r\n analyzeMove(file, m) {\r\n const issues = [];\r\n const children = m.getChildren();\r\n const last = children[children.length - 2];\r\n const lastChildren = last.getChildren();\r\n if (lastChildren.length === 3\r\n && lastChildren[0].getFirstToken().getStr() === \"(\"\r\n && lastChildren[2].getFirstToken().getStr() === \")\") {\r\n const issue = issue_1.Issue.atToken(file, last.getFirstToken(), \"Too many parentheses\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n analyze(file, cond) {\r\n const issues = [];\r\n let comparator = \"\";\r\n for (const c of cond.getChildren()) {\r\n let current = \"\";\r\n if (c instanceof nodes_1.TokenNode) {\r\n current = c.get().getStr().toUpperCase();\r\n }\r\n else if (c instanceof nodes_1.ExpressionNode && c.get() instanceof Expressions.CondSub) {\r\n if (c.getFirstToken().getStr().toUpperCase() === \"NOT\") {\r\n return [];\r\n }\r\n const i = c.findDirectExpression(Expressions.Cond);\r\n if (i === undefined) {\r\n return [];\r\n }\r\n current = this.findComparator(i);\r\n }\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (comparator !== current) {\r\n return [];\r\n }\r\n }\r\n if (comparator !== \"\" && comparator !== \"MIXED\") {\r\n const message = \"Too many parentheses, complex\";\r\n const issue = issue_1.Issue.atToken(file, cond.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n findComparator(cond) {\r\n let comparator = \"\";\r\n const children = cond.getChildren();\r\n for (const c of children) {\r\n if (c instanceof nodes_1.TokenNode) {\r\n const current = c.get().getStr().toUpperCase();\r\n if (comparator === \"\") {\r\n comparator = current;\r\n }\r\n else if (current !== comparator) {\r\n return \"MIXED\";\r\n }\r\n }\r\n }\r\n return comparator;\r\n }\r\n}\r\nexports.ManyParentheses = ManyParentheses;\r\n//# sourceMappingURL=many_parentheses.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/many_parentheses.js?");
|
|
12021
12054
|
|
|
12022
12055
|
/***/ }),
|
|
12023
12056
|
|
|
@@ -12028,7 +12061,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12028
12061
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12029
12062
|
|
|
12030
12063
|
"use strict";
|
|
12031
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneMethodParameterPerLine = exports.MaxOneMethodParameterPerLineConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MaxOneMethodParameterPerLineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneMethodParameterPerLineConf = MaxOneMethodParameterPerLineConf;\r\nclass MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneMethodParameterPerLineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_method_parameter_per_line\",\r\n title: \"Max one method parameter definition per line\",\r\n shortDescription: `Keep max one method parameter description per line`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],\r\n badExample: `\nMETHODS apps_scope_token\n IMPORTING\n body TYPE bodyapps_scope_token client_id TYPE str.`,\r\n goodExample: `\nMETHODS apps_scope_token\n IMPORTING\n body TYPE bodyapps_scope_token\n client_id TYPE str.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const statement of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {\r\n let prev = undefined;\r\n for (const p of statement.findAllExpressions(Expressions.MethodParam)) {\r\n if (prev === undefined) {\r\n prev = p;\r\n continue;\r\n }\r\n if (prev.getFirstToken().getStart().getRow() === p.getFirstToken().getStart().getRow()) {\r\n const issue = issue_1.Issue.atToken(file, prev.getFirstToken(), this.getMetadata().title, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n prev = p;\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneMethodParameterPerLine = MaxOneMethodParameterPerLine;\r\n//# sourceMappingURL=max_one_method_parameter_per_line.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js?");
|
|
12064
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneMethodParameterPerLine = exports.MaxOneMethodParameterPerLineConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass MaxOneMethodParameterPerLineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneMethodParameterPerLineConf = MaxOneMethodParameterPerLineConf;\r\nclass MaxOneMethodParameterPerLine extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneMethodParameterPerLineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_method_parameter_per_line\",\r\n title: \"Max one method parameter definition per line\",\r\n shortDescription: `Keep max one method parameter description per line`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Whitespace],\r\n badExample: `\r\nMETHODS apps_scope_token\r\n IMPORTING\r\n body TYPE bodyapps_scope_token client_id TYPE str.`,\r\n goodExample: `\r\nMETHODS apps_scope_token\r\n IMPORTING\r\n body TYPE bodyapps_scope_token\r\n client_id TYPE str.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const statement of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllStatements(Statements.MethodDef)) || []) {\r\n let prev = undefined;\r\n for (const p of statement.findAllExpressions(Expressions.MethodParam)) {\r\n if (prev === undefined) {\r\n prev = p;\r\n continue;\r\n }\r\n if (prev.getFirstToken().getStart().getRow() === p.getFirstToken().getStart().getRow()) {\r\n const issue = issue_1.Issue.atToken(file, prev.getFirstToken(), this.getMetadata().title, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n prev = p;\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneMethodParameterPerLine = MaxOneMethodParameterPerLine;\r\n//# sourceMappingURL=max_one_method_parameter_per_line.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_method_parameter_per_line.js?");
|
|
12032
12065
|
|
|
12033
12066
|
/***/ }),
|
|
12034
12067
|
|
|
@@ -12039,7 +12072,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12039
12072
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12040
12073
|
|
|
12041
12074
|
"use strict";
|
|
12042
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneStatement = exports.MaxOneStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass MaxOneStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneStatementConf = MaxOneStatementConf;\r\nclass MaxOneStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_statement\",\r\n title: \"Max one statement per line\",\r\n shortDescription: `Checks that each line contains only a single statement.`,\r\n extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line\nhttps://docs.abapopenchecks.org/checks/11/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE foo. WRITE bar.`,\r\n goodExample: `WRITE foo.\\nWRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Only one statement is allowed per line\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = 0;\r\n let reported = 0;\r\n for (const statement of file.getStatements()) {\r\n const term = statement.getTerminator();\r\n if (statement.get() instanceof _statement_1.Comment\r\n || statement.get() instanceof _statement_1.NativeSQL\r\n || term === \",\") {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (pos instanceof position_1.VirtualPosition) {\r\n continue;\r\n }\r\n const row = pos.getRow();\r\n if (prev === row && row !== reported && statement.getFirstToken().getStr() !== \".\") {\r\n const fix = edit_helper_1.EditHelper.insertAt(file, pos, \"\\n\");\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n reported = row;\r\n }\r\n prev = row;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneStatement = MaxOneStatement;\r\n//# sourceMappingURL=max_one_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_statement.js?");
|
|
12075
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.MaxOneStatement = exports.MaxOneStatementConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass MaxOneStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.MaxOneStatementConf = MaxOneStatementConf;\r\nclass MaxOneStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new MaxOneStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"max_one_statement\",\r\n title: \"Max one statement per line\",\r\n shortDescription: `Checks that each line contains only a single statement.`,\r\n extendedInformation: `Does not report empty statements, use rule empty_statement for detecting empty statements.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#no-more-than-one-statement-per-line\r\nhttps://docs.abapopenchecks.org/checks/11/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE foo. WRITE bar.`,\r\n goodExample: `WRITE foo.\\nWRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Only one statement is allowed per line\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let prev = 0;\r\n let reported = 0;\r\n for (const statement of file.getStatements()) {\r\n const term = statement.getTerminator();\r\n if (statement.get() instanceof _statement_1.Comment\r\n || statement.get() instanceof _statement_1.NativeSQL\r\n || term === \",\") {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (pos instanceof position_1.VirtualPosition) {\r\n continue;\r\n }\r\n const row = pos.getRow();\r\n if (prev === row && row !== reported && statement.getFirstToken().getStr() !== \".\") {\r\n const fix = edit_helper_1.EditHelper.insertAt(file, pos, \"\\n\");\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n reported = row;\r\n }\r\n prev = row;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.MaxOneStatement = MaxOneStatement;\r\n//# sourceMappingURL=max_one_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/max_one_statement.js?");
|
|
12043
12076
|
|
|
12044
12077
|
/***/ }),
|
|
12045
12078
|
|
|
@@ -12149,7 +12182,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12149
12182
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12150
12183
|
|
|
12151
12184
|
"use strict";
|
|
12152
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Nesting = exports.NestingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NestingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum allowed nesting depth */\r\n this.depth = 5;\r\n }\r\n}\r\nexports.NestingConf = NestingConf;\r\nclass Nesting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NestingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nesting\",\r\n title: \"Check nesting depth\",\r\n shortDescription: `Checks for methods exceeding a maximum nesting depth`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low\nhttps://docs.abapopenchecks.org/checks/74/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(max) {\r\n return \"Reduce nesting depth to max \" + max;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let depth = 0;\r\n for (const statement of file.getStatements()) {\r\n const type = statement.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.Try) {\r\n depth = depth + 1;\r\n }\r\n else if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndCase\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndDo\r\n || type instanceof Statements.EndTry) {\r\n depth = depth - 1;\r\n }\r\n if (depth > this.conf.depth) {\r\n const pos = statement.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getDescription(this.conf.depth.toString()), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Nesting = Nesting;\r\n//# sourceMappingURL=nesting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nesting.js?");
|
|
12185
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Nesting = exports.NestingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NestingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Maximum allowed nesting depth */\r\n this.depth = 5;\r\n }\r\n}\r\nexports.NestingConf = NestingConf;\r\nclass Nesting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NestingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"nesting\",\r\n title: \"Check nesting depth\",\r\n shortDescription: `Checks for methods exceeding a maximum nesting depth`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#keep-the-nesting-depth-low\r\nhttps://docs.abapopenchecks.org/checks/74/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(max) {\r\n return \"Reduce nesting depth to max \" + max;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let depth = 0;\r\n for (const statement of file.getStatements()) {\r\n const type = statement.get();\r\n if (type instanceof Statements.If\r\n || type instanceof Statements.Case\r\n || type instanceof Statements.While\r\n || type instanceof Statements.Loop\r\n || type instanceof Statements.SelectLoop\r\n || type instanceof Statements.Do\r\n || type instanceof Statements.Try) {\r\n depth = depth + 1;\r\n }\r\n else if (type instanceof Statements.EndIf\r\n || type instanceof Statements.EndCase\r\n || type instanceof Statements.EndWhile\r\n || type instanceof Statements.EndLoop\r\n || type instanceof Statements.EndSelect\r\n || type instanceof Statements.EndDo\r\n || type instanceof Statements.EndTry) {\r\n depth = depth - 1;\r\n }\r\n if (depth > this.conf.depth) {\r\n const pos = statement.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getDescription(this.conf.depth.toString()), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n break; // only one finding per file\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Nesting = Nesting;\r\n//# sourceMappingURL=nesting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/nesting.js?");
|
|
12153
12186
|
|
|
12154
12187
|
/***/ }),
|
|
12155
12188
|
|
|
@@ -12182,7 +12215,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12182
12215
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12183
12216
|
|
|
12184
12217
|
"use strict";
|
|
12185
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoChainedAssignment = exports.NoChainedAssignmentConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoChainedAssignmentConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoChainedAssignmentConf = NoChainedAssignmentConf;\r\nclass NoChainedAssignment extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoChainedAssignmentConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_chained_assignment\",\r\n title: \"No chained assignment\",\r\n shortDescription: `Find chained assingments and reports issues`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `var1 = var2 = var3.`,\r\n goodExample: `var2 = var3.\nvar1 = var2.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n if (!(s.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n if (s.findDirectExpressions(Expressions.Target).length >= 2) {\r\n const message = \"No chained assignment\";\r\n const issue = issue_1.Issue.atStatement(file, s, message, this.getMetadata().key);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoChainedAssignment = NoChainedAssignment;\r\n//# sourceMappingURL=no_chained_assignment.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js?");
|
|
12218
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoChainedAssignment = exports.NoChainedAssignmentConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoChainedAssignmentConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.NoChainedAssignmentConf = NoChainedAssignmentConf;\r\nclass NoChainedAssignment extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoChainedAssignmentConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_chained_assignment\",\r\n title: \"No chained assignment\",\r\n shortDescription: `Find chained assingments and reports issues`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#dont-chain-assignments`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide],\r\n badExample: `var1 = var2 = var3.`,\r\n goodExample: `var2 = var3.\r\nvar1 = var2.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n if (!(s.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n if (s.findDirectExpressions(Expressions.Target).length >= 2) {\r\n const message = \"No chained assignment\";\r\n const issue = issue_1.Issue.atStatement(file, s, message, this.getMetadata().key);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoChainedAssignment = NoChainedAssignment;\r\n//# sourceMappingURL=no_chained_assignment.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_chained_assignment.js?");
|
|
12186
12219
|
|
|
12187
12220
|
/***/ }),
|
|
12188
12221
|
|
|
@@ -12193,7 +12226,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12193
12226
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12194
12227
|
|
|
12195
12228
|
"use strict";
|
|
12196
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoPublicAttributes = exports.NoPublicAttributesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _abap_file_information_1 = __webpack_require__(/*! ../abap/4_file_information/_abap_file_information */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_abap_file_information.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoPublicAttributesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows public attributes, if they are declared as READ-ONLY. */\r\n this.allowReadOnly = false;\r\n }\r\n}\r\nexports.NoPublicAttributesConf = NoPublicAttributesConf;\r\nclass NoPublicAttributes extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoPublicAttributesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_public_attributes\",\r\n title: \"No public attributes\",\r\n shortDescription: `Checks that classes and interfaces don't contain any public attributes.\nExceptions are excluded from this rule.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"Public attributes are not allowed, attribute \\\"\" + name + \"\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n this.file = file;\r\n const attributes = this.getAllPublicAttributes(obj);\r\n return this.findAllIssues(attributes);\r\n }\r\n getAllPublicAttributes(obj) {\r\n let attributes = [];\r\n attributes = attributes.concat(this.getAllPublicClassAttributes(obj));\r\n attributes = attributes.concat(this.getAllPublicInterfaceAttributes());\r\n return attributes;\r\n }\r\n getAllPublicClassAttributes(obj) {\r\n let attributes = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const classDef of this.file.getInfo().listClassDefinitions()) {\r\n if (ddic.isException(classDef, obj)) {\r\n continue;\r\n }\r\n attributes = attributes.concat(classDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n getAllPublicInterfaceAttributes() {\r\n let attributes = [];\r\n for (const interfaceDef of this.file.getInfo().listInterfaceDefinitions()) {\r\n attributes = attributes.concat(interfaceDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n findAllIssues(attributes) {\r\n const issues = [];\r\n for (const attr of attributes) {\r\n if (this.conf.allowReadOnly === true && attr.readOnly) {\r\n continue;\r\n }\r\n else if (attr.level === _abap_file_information_1.AttributeLevel.Constant) {\r\n continue;\r\n }\r\n const issue = issue_1.Issue.atIdentifier(attr.identifier, this.getDescription(attr.name), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoPublicAttributes = NoPublicAttributes;\r\n//# sourceMappingURL=no_public_attributes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js?");
|
|
12229
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoPublicAttributes = exports.NoPublicAttributesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst _abap_file_information_1 = __webpack_require__(/*! ../abap/4_file_information/_abap_file_information */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/_abap_file_information.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoPublicAttributesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Allows public attributes, if they are declared as READ-ONLY. */\r\n this.allowReadOnly = false;\r\n /** Option to ignore test classes for this check. */\r\n this.ignoreTestClasses = false;\r\n }\r\n}\r\nexports.NoPublicAttributesConf = NoPublicAttributesConf;\r\nclass NoPublicAttributes extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoPublicAttributesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_public_attributes\",\r\n title: \"No public attributes\",\r\n shortDescription: `Checks that classes and interfaces don't contain any public attributes.\r\nExceptions are excluded from this rule.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#members-private-by-default-protected-only-if-needed`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"Public attributes are not allowed, attribute \\\"\" + name + \"\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n this.file = file;\r\n const attributes = this.getAllPublicAttributes(obj);\r\n return this.findAllIssues(attributes);\r\n }\r\n getAllPublicAttributes(obj) {\r\n let attributes = [];\r\n attributes = attributes.concat(this.getAllPublicClassAttributes(obj));\r\n attributes = attributes.concat(this.getAllPublicInterfaceAttributes());\r\n return attributes;\r\n }\r\n getAllPublicClassAttributes(obj) {\r\n let attributes = [];\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n for (const classDef of this.file.getInfo().listClassDefinitions()) {\r\n if (ddic.isException(classDef, obj)) {\r\n continue;\r\n }\r\n attributes = attributes.concat(classDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n getAllPublicInterfaceAttributes() {\r\n let attributes = [];\r\n for (const interfaceDef of this.file.getInfo().listInterfaceDefinitions()) {\r\n attributes = attributes.concat(interfaceDef.attributes.filter(a => a.visibility === visibility_1.Visibility.Public));\r\n }\r\n return attributes;\r\n }\r\n findAllIssues(attributes) {\r\n const issues = [];\r\n for (const attr of attributes) {\r\n if (this.conf.allowReadOnly === true && attr.readOnly) {\r\n continue;\r\n }\r\n else if (attr.level === _abap_file_information_1.AttributeLevel.Constant) {\r\n continue;\r\n }\r\n else if ((this.conf.ignoreTestClasses === true)\r\n && this.file.getFilename().includes(\".testclasses.\")) {\r\n continue;\r\n }\r\n const issue = issue_1.Issue.atIdentifier(attr.identifier, this.getDescription(attr.name), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.NoPublicAttributes = NoPublicAttributes;\r\n//# sourceMappingURL=no_public_attributes.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_public_attributes.js?");
|
|
12197
12230
|
|
|
12198
12231
|
/***/ }),
|
|
12199
12232
|
|
|
@@ -12204,7 +12237,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12204
12237
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12205
12238
|
|
|
12206
12239
|
"use strict";
|
|
12207
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoYodaConditions = exports.NoYodaConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoYodaConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Only report issues where the left side is a constant */\r\n this.onlyConstants = false;\r\n }\r\n}\r\nexports.NoYodaConditionsConf = NoYodaConditionsConf;\r\nclass NoYodaConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoYodaConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_yoda_conditions\",\r\n title: \"No Yoda conditions\",\r\n shortDescription: `Finds Yoda conditions and reports issues`,\r\n extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions\n\nConditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF 0 <> sy-subrc.\nENDIF.`,\r\n goodExample: `IF sy-subrc <> 0.\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n for (const c of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Compare)) || []) {\r\n const operator = (_b = c.findDirectExpression(Expressions.CompareOperator)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n if (operator === undefined\r\n || operator === \"CP\"\r\n || operator === \"NP\"\r\n || operator === \"CS\"\r\n || operator === \"NS\"\r\n || operator === \"CA\"\r\n || operator === \"NA\"\r\n || operator === \"CO\"\r\n || operator === \"CN\") {\r\n continue;\r\n }\r\n const sources = c.findDirectExpressions(Expressions.Source);\r\n if (sources.length !== 2) {\r\n continue;\r\n }\r\n if (this.conf.onlyConstants === true) {\r\n if (this.isConstant(sources[0]) === true && this.isConstant(sources[1]) === false) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n // Scenarios:\r\n // constant COMPARE chain\r\n // constant COMPARE multiple tokens with spaces\r\n // fieldChain COMPARE multiple tokens with spaces\r\n if ((this.withoutSpaces(sources[0]) === false && this.withoutSpaces(sources[1]) === true) || ((this.isConstant(sources[0]) === true && this.isFieldChain(sources[1]) === true))) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n isConstant(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant;\r\n }\r\n isFieldChain(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.FieldChain;\r\n }\r\n withoutSpaces(node) {\r\n return node.concatTokensWithoutStringsAndComments().includes(\" \");\r\n }\r\n}\r\nexports.NoYodaConditions = NoYodaConditions;\r\n//# sourceMappingURL=no_yoda_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js?");
|
|
12240
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.NoYodaConditions = exports.NoYodaConditionsConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass NoYodaConditionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Only report issues where the left side is a constant */\r\n this.onlyConstants = false;\r\n }\r\n}\r\nexports.NoYodaConditionsConf = NoYodaConditionsConf;\r\nclass NoYodaConditions extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new NoYodaConditionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"no_yoda_conditions\",\r\n title: \"No Yoda conditions\",\r\n shortDescription: `Finds Yoda conditions and reports issues`,\r\n extendedInformation: `https://en.wikipedia.org/wiki/Yoda_conditions\r\n\r\nConditions with operators CP, NP, CS, NS, CA, NA, CO, CN are ignored`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `IF 0 <> sy-subrc.\r\nENDIF.`,\r\n goodExample: `IF sy-subrc <> 0.\r\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b;\r\n const issues = [];\r\n for (const c of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Compare)) || []) {\r\n const operator = (_b = c.findDirectExpression(Expressions.CompareOperator)) === null || _b === void 0 ? void 0 : _b.concatTokens().toUpperCase();\r\n if (operator === undefined\r\n || operator === \"CP\"\r\n || operator === \"NP\"\r\n || operator === \"CS\"\r\n || operator === \"NS\"\r\n || operator === \"CA\"\r\n || operator === \"NA\"\r\n || operator === \"CO\"\r\n || operator === \"CN\") {\r\n continue;\r\n }\r\n const sources = c.findDirectExpressions(Expressions.Source);\r\n if (sources.length !== 2) {\r\n continue;\r\n }\r\n if (this.conf.onlyConstants === true) {\r\n if (this.isConstant(sources[0]) === true && this.isConstant(sources[1]) === false) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n // Scenarios:\r\n // constant COMPARE chain\r\n // constant COMPARE multiple tokens with spaces\r\n // fieldChain COMPARE multiple tokens with spaces\r\n if ((this.withoutSpaces(sources[0]) === false && this.withoutSpaces(sources[1]) === true) || ((this.isConstant(sources[0]) === true && this.isFieldChain(sources[1]) === true))) {\r\n const start = sources[0].getFirstToken().getStart();\r\n const end = sources[1].getLastToken().getEnd();\r\n const issue = issue_1.Issue.atRange(file, start, end, \"No Yoda conditions\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n isConstant(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.Constant;\r\n }\r\n isFieldChain(node) {\r\n var _a;\r\n if (node.getChildren().length > 1) {\r\n return false;\r\n }\r\n return ((_a = node.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.FieldChain;\r\n }\r\n withoutSpaces(node) {\r\n return node.concatTokensWithoutStringsAndComments().includes(\" \");\r\n }\r\n}\r\nexports.NoYodaConditions = NoYodaConditions;\r\n//# sourceMappingURL=no_yoda_conditions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/no_yoda_conditions.js?");
|
|
12208
12241
|
|
|
12209
12242
|
/***/ }),
|
|
12210
12243
|
|
|
@@ -12226,7 +12259,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12226
12259
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12227
12260
|
|
|
12228
12261
|
"use strict";
|
|
12229
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\n\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\n\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\n\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\n\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\n\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\n\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\n\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\n\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\n\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\n\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\n\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\n\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\n\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\nSELECT COUNT(*) is considered okay\n\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\n\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\n\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\n\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\n\nOCCURENCES: check for OCCURENCES vs OCCURRENCES`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getFirstToken();\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
|
|
12262
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ObsoleteStatement = exports.ObsoleteStatementConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nclass ObsoleteStatementConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Check for REFRESH statement */\r\n this.refresh = true;\r\n /** Check for COMPUTE statement */\r\n this.compute = true;\r\n /** Check for ADD statement */\r\n this.add = true;\r\n /** Check for SUBTRACT statement */\r\n this.subtract = true;\r\n /** Check for MULTIPLY statement */\r\n this.multiply = true;\r\n /** Check for DIVIDE statement */\r\n this.divide = true;\r\n /** Check for MOVE statement */\r\n this.move = true;\r\n /** Checks for usages of IS REQUESTED */\r\n this.requested = true;\r\n /** Checks for usages of OCCURS */\r\n this.occurs = true;\r\n /** Checks for SET EXTENDED CHECK */\r\n this.setExtended = true;\r\n /** Checks for WITH HEADER LINE */\r\n this.withHeaderLine = true;\r\n /** Checks for FIELD-SYMBOLS ... STRUCTURE */\r\n this.fieldSymbolStructure = true;\r\n /** Checks for TYPE-POOLS */\r\n this.typePools = true;\r\n /** Checks for addition LOAD */\r\n this.load = true;\r\n /** Checks for PARAMETER */\r\n this.parameter = true;\r\n /** Checks for RANGES */\r\n this.ranges = true;\r\n /** Checks for COMMUNICATION */\r\n this.communication = true;\r\n /** Checks for PACK */\r\n this.pack = true;\r\n /** Checks for SELECT without INTO */\r\n this.selectWithoutInto = true;\r\n /** FREE MEMORY, without ID */\r\n this.freeMemory = true;\r\n /** Checks for EXIT FROM SQL */\r\n this.exitFromSQL = true;\r\n /** Checks for SORT itab BY <fs> */\r\n this.sortByFS = true;\r\n /** Checks for CALL TRANSFORMATION OBJECTS */\r\n this.callTransformation = true;\r\n /** Check for POSIX REGEX usage */\r\n this.regex = true;\r\n /** Check for OCCURENCES vs OCCURRENCES usage */\r\n this.occurences = true;\r\n }\r\n}\r\nexports.ObsoleteStatementConf = ObsoleteStatementConf;\r\nclass ObsoleteStatement extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ObsoleteStatementConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"obsolete_statement\",\r\n title: \"Obsolete statements\",\r\n shortDescription: `Checks for usages of certain obsolete statements`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-functional-to-procedural-language-constructs\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#avoid-obsolete-language-elements\r\n\r\nSET EXTENDED CHECK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapset_extended_check.htm\r\n\r\nIS REQUESTED: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenlogexp_requested.htm\r\n\r\nWITH HEADER LINE: https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abapdata_header_line.htm\r\n\r\nFIELD-SYMBOLS STRUCTURE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapfield-symbols_obsolete_typing.htm\r\n\r\nTYPE-POOLS: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nLOAD addition: from 702, https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abennews-71-program_load.htm\r\n\r\nCOMMUICATION: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapcommunication.htm\r\n\r\nOCCURS: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapdata_occurs.htm\r\n\r\nPARAMETER: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-US/abapparameter.htm\r\n\r\nRANGES: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapranges.htm\r\n\r\nPACK: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abappack.htm\r\n\r\nMOVE: https://help.sap.com/doc/abapdocu_751_index_htm/7.51/en-us/abapmove_obs.htm\r\n\r\nSELECT without INTO: https://help.sap.com/doc/abapdocu_731_index_htm/7.31/en-US/abapselect_obsolete.htm\r\nSELECT COUNT(*) is considered okay\r\n\r\nFREE MEMORY: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-us/abapfree_mem_id_obsolete.htm\r\n\r\nSORT BY FS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapsort_itab_obsolete.htm\r\n\r\nCALL TRANSFORMATION OBJECTS: https://help.sap.com/doc/abapdocu_752_index_htm/7.52/en-US/abapcall_transformation_objects.htm\r\n\r\nPOSIX REGEX: https://help.sap.com/doc/abapdocu_755_index_htm/7.55/en-US/index.htm\r\n\r\nOCCURENCES: check for OCCURENCES vs OCCURRENCES`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c;\r\n const issues = [];\r\n const statements = file.getStatements();\r\n let prev = undefined;\r\n const configVersion = this.reg.getConfig().getVersion();\r\n for (const staNode of statements) {\r\n const sta = staNode.get();\r\n if ((sta instanceof Statements.Refresh && this.conf.refresh)\r\n || (sta instanceof Statements.Compute && this.conf.compute)\r\n || (sta instanceof Statements.Add && this.conf.add)\r\n || (sta instanceof Statements.Subtract && this.conf.subtract)\r\n || (sta instanceof Statements.ClassDefinitionLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.InterfaceLoad && this.conf.load && configVersion >= version_1.Version.v702)\r\n || (sta instanceof Statements.Multiply && this.conf.multiply)\r\n || (sta instanceof Statements.Divide && this.conf.divide)\r\n || (sta instanceof Statements.Move && this.conf.move\r\n && staNode.getTokens()[0].getStr().toUpperCase() === \"MOVE\"\r\n && staNode.getTokens()[1].getStr() !== \"-\"\r\n && staNode.getTokens()[1].getStr().toUpperCase() !== \"EXACT\")) {\r\n if (prev === undefined || staNode.getStart().getCol() !== prev.getCol() || staNode.getStart().getRow() !== prev.getRow()) {\r\n const message = \"Statement \\\"\" + staNode.getFirstToken().getStr() + \"\\\" is obsolete\";\r\n const fix = this.getFix(file, sta, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, message, this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = staNode.getStart();\r\n }\r\n if (this.conf.setExtended && sta instanceof Statements.SetExtendedCheck) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SET EXTENDED CHECK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.communication && sta instanceof Statements.Communication) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"COMMUNICATION is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.pack && sta instanceof Statements.Pack) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"PACK is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n if (this.conf.parameter && sta instanceof Statements.Parameter) {\r\n const token = staNode.getFirstToken();\r\n if (token.getStr().toUpperCase() === \"PARAMETER\") {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"PARAMETERS\");\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of PARAMETER\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.ranges && sta instanceof Statements.Ranges) {\r\n const children = staNode.getChildren();\r\n let fix = undefined;\r\n if (children.length === 5) {\r\n const simpleNameString = children[1].concatTokens();\r\n const fieldSubString = children[3].concatTokens();\r\n const replacement = \"TYPES \" + simpleNameString + \" LIKE RANGE OF \" + fieldSubString + \".\";\r\n fix = edit_helper_1.EditHelper.replaceRange(file, staNode.getStart(), staNode.getEnd(), replacement);\r\n }\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use LIKE RANGE OF instead of RANGES\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.selectWithoutInto\r\n && (sta instanceof Statements.Select || sta instanceof Statements.SelectLoop)\r\n && staNode.findFirstExpression(Expressions.SQLIntoStructure) === undefined\r\n && staNode.findFirstExpression(Expressions.SQLIntoTable) === undefined) {\r\n const concat = (_a = staNode.findFirstExpression(Expressions.SQLFieldList)) === null || _a === void 0 ? void 0 : _a.concatTokens().toUpperCase();\r\n if (concat !== \"COUNT(*)\" && concat !== \"COUNT( * )\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"SELECT without INTO\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.requested && sta instanceof Statements.If) {\r\n for (const compare of staNode.findAllExpressions(Expressions.Compare)) {\r\n const token = compare.findDirectTokenByText(\"REQUESTED\");\r\n if (token) {\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"SUPPLIED\");\r\n const issue = issue_1.Issue.atToken(file, token, \"IS REQUESTED is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.occurs) {\r\n if ((sta instanceof Statements.Describe)\r\n || (sta instanceof Statements.Ranges)\r\n || (sta instanceof Statements.DataBegin)\r\n || (sta instanceof Statements.TypeBegin)) {\r\n const token = staNode.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n for (const dataDef of staNode.findAllExpressions(Expressions.DataDefinition)) {\r\n const token = (_b = dataDef.findDirectExpression(Expressions.TypeTable)) === null || _b === void 0 ? void 0 : _b.findDirectTokenByText(\"OCCURS\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"OCCURS is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.withHeaderLine === true && sta instanceof Statements.Data) {\r\n if (staNode.concatTokens().toUpperCase().includes(\"WITH HEADER LINE\")) {\r\n const token = staNode.getFirstToken();\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"WITH HEADER LINE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n if (this.conf.fieldSymbolStructure && sta instanceof Statements.FieldSymbol) {\r\n const token = staNode.findDirectTokenByText(\"STRUCTURE\");\r\n if (token) {\r\n const issue = issue_1.Issue.atToken(file, token, \"FIELD-SYMBOLS ... STRUCTURE is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.typePools && sta instanceof Statements.TypePools && configVersion >= version_1.Version.v702) {\r\n const fix = edit_helper_1.EditHelper.deleteStatement(file, staNode);\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"TYPE-POOLS\\\" is obsolete\", this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n if (this.conf.freeMemory && sta instanceof Statements.FreeMemory) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"FREE MEMORY.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"FREE MEMORY\\\" without ID is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.exitFromSQL && sta instanceof Statements.Exit) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat === \"EXIT FROM SQL.\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"EXIT FROM SQL\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.sortByFS && sta instanceof Statements.Sort) {\r\n const afterBy = staNode.findExpressionAfterToken(\"BY\");\r\n if (afterBy instanceof nodes_1.ExpressionNode && afterBy.get() instanceof expressions_1.SourceFieldSymbol) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Statement \\\"SORT itab BY <fs>\\\" is obsolete\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.callTransformation && sta instanceof Statements.CallTransformation) {\r\n const objects = staNode.findExpressionAfterToken(\"OBJECTS\");\r\n if (objects) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use PARAMETERS instead of OBJECTS\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.conf.occurences && sta instanceof Statements.Replace) {\r\n const concat = staNode.concatTokens().toUpperCase();\r\n if (concat.includes(\" OCCURENCES \")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"Use \\\"OCCURRENCES\\\"\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (configVersion >= version_1.Version.v756 && this.conf.regex) {\r\n if (sta instanceof Statements.Find || sta instanceof Statements.Replace) {\r\n if ((_c = staNode.findFirstExpression(Expressions.FindType)) === null || _c === void 0 ? void 0 : _c.concatTokens().includes(\"REGEX\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"REGEX obsolete, use PCRE\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else {\r\n const classNameExpression = staNode.findAllExpressions(Expressions.ClassName);\r\n const methodNameExpression = staNode.findAllExpressions(Expressions.MethodName);\r\n if (classNameExpression.length !== 0 && methodNameExpression.length !== 0) {\r\n const className = classNameExpression[0].concatTokens();\r\n const methodName = methodNameExpression[0].concatTokens();\r\n if (className === \"cl_abap_regex\") {\r\n if (methodName === \"create_posix\") {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"create_posix obsolete, use create_pcre\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n else if (className === \"cl_abap_matcher\") {\r\n if (methodName.includes(\"posix\")) {\r\n const issue = issue_1.Issue.atStatement(file, staNode, \"posix methods obsolete, use pcre methods\", this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, statementNode) {\r\n if (statement instanceof Statements.Refresh) {\r\n if (statementNode.getChildren().length === 6) {\r\n return undefined;\r\n }\r\n return edit_helper_1.EditHelper.replaceToken(file, statementNode.getFirstToken(), \"CLEAR\");\r\n }\r\n else if (statement instanceof Statements.Compute) {\r\n const children = statementNode.getChildren();\r\n if (children.length === 5) {\r\n const tokenForDeletion = statementNode.getFirstToken();\r\n let endPosition = tokenForDeletion.getEnd();\r\n endPosition = new position_1.Position(endPosition.getRow(), endPosition.getCol() + 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, tokenForDeletion.getStart(), endPosition);\r\n }\r\n else {\r\n const targetString = children[2].concatTokens();\r\n const sourceString = children[4].concatTokens();\r\n const replacement = targetString + \" = EXACT #( \" + sourceString + \" ).\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n }\r\n else if (statement instanceof Statements.Add ||\r\n statement instanceof Statements.Subtract) {\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Add) {\r\n replacement = targetString + \" = \" + targetString + \" + \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Subtract) {\r\n replacement = targetString + \" = \" + targetString + \" - \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Multiply ||\r\n statement instanceof Statements.Divide) {\r\n const children = statementNode.getChildren();\r\n const targetString = children[1].concatTokens();\r\n const sourceString = children[3].concatTokens();\r\n let replacement = \"\";\r\n if (statement instanceof Statements.Multiply) {\r\n replacement = targetString + \" = \" + targetString + \" * \" + sourceString + \".\";\r\n }\r\n else if (statement instanceof Statements.Divide) {\r\n replacement = targetString + \" = \" + targetString + \" / \" + sourceString + \".\";\r\n }\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.Move) {\r\n if (statementNode.getColon() !== undefined) {\r\n return undefined;\r\n }\r\n const children = statementNode.getChildren();\r\n const sourceString = children[1].concatTokens();\r\n const targetString = children[3].concatTokens();\r\n let operator = children[2].concatTokens();\r\n if (operator === \"TO\") {\r\n operator = \" = \";\r\n }\r\n else {\r\n operator = \" ?= \";\r\n }\r\n const replacement = targetString + operator + sourceString + \".\";\r\n return edit_helper_1.EditHelper.replaceRange(file, statementNode.getStart(), statementNode.getEnd(), replacement);\r\n }\r\n else if (statement instanceof Statements.ClassDefinitionLoad ||\r\n statement instanceof Statements.InterfaceLoad) {\r\n let token = undefined;\r\n if (statement instanceof Statements.ClassDefinitionLoad) {\r\n token = statementNode.getChildren()[3].getFirstToken();\r\n }\r\n else {\r\n token = statementNode.getChildren()[2].getFirstToken();\r\n }\r\n let startPosition = token.getStart();\r\n startPosition = new position_1.Position(startPosition.getRow(), startPosition.getCol() - 1);\r\n return edit_helper_1.EditHelper.deleteRange(file, startPosition, token.getEnd());\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ObsoleteStatement = ObsoleteStatement;\r\n//# sourceMappingURL=obsolete_statement.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/obsolete_statement.js?");
|
|
12230
12263
|
|
|
12231
12264
|
/***/ }),
|
|
12232
12265
|
|
|
@@ -12237,7 +12270,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12237
12270
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12238
12271
|
|
|
12239
12272
|
"use strict";
|
|
12240
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\n\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.getParameters().getDefaultImporting();\r\n if (i === undefined) {\r\n continue;\r\n }\r\n const p = (_a = parameters[0].findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if ((p === null || p === void 0 ? void 0 : p.getStr().toUpperCase()) === i.toUpperCase()) {\r\n const message = \"Omit default parameter name \\\"\" + i + \"\\\"\";\r\n let fix = undefined;\r\n const end = (_b = parameters[0].findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStart();\r\n if (end) {\r\n fix = edit_helper_1.EditHelper.deleteRange(file, p.getStart(), end);\r\n }\r\n issues.push(issue_1.Issue.atToken(file, name.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////\r\n findMethodReference(token, spaghetti, filename) {\r\n const scope = spaghetti.lookupPosition(token.getStart(), filename);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference) {\r\n continue;\r\n }\r\n else if (r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof method_definition_1.MethodDefinition) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.OmitParameterName = OmitParameterName;\r\n//# sourceMappingURL=omit_parameter_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js?");
|
|
12273
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitParameterName = exports.OmitParameterNameConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst method_definition_1 = __webpack_require__(/*! ../abap/types/method_definition */ \"./node_modules/@abaplint/core/build/src/abap/types/method_definition.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass OmitParameterNameConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitParameterNameConf = OmitParameterNameConf;\r\nclass OmitParameterName {\r\n constructor() {\r\n this.conf = new OmitParameterNameConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_parameter_name\",\r\n title: \"Omit parameter name\",\r\n shortDescription: `Omit the parameter name in single parameter calls`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-the-parameter-name-in-single-parameter-calls\r\n\r\nEXPORTING must already be omitted for this rule to take effect, https://rules.abaplint.org/exporting/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix],\r\n badExample: `method( param = 2 ).`,\r\n goodExample: `method( 2 ).`,\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a, _b;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n continue;\r\n }\r\n for (const c of stru.findAllExpressions(Expressions.MethodCall)) {\r\n if (c.findFirstExpression(Expressions.MethodParameters)) {\r\n continue;\r\n }\r\n // hmm, this will break for nested method calls?\r\n const parameters = c.findAllExpressions(Expressions.ParameterS);\r\n if (parameters.length > 1 || parameters.length === 0) {\r\n continue;\r\n }\r\n const name = c.findDirectExpression(Expressions.MethodName);\r\n if (name === undefined) {\r\n continue;\r\n }\r\n const param = c.findDirectExpression(Expressions.MethodCallParam);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n const ref = this.findMethodReference(name.getFirstToken(), spaghetti, file.getFilename());\r\n if (ref === undefined) {\r\n continue;\r\n }\r\n const i = ref.getParameters().getDefaultImporting();\r\n if (i === undefined) {\r\n continue;\r\n }\r\n const p = (_a = parameters[0].findDirectExpression(Expressions.ParameterName)) === null || _a === void 0 ? void 0 : _a.getFirstToken();\r\n if ((p === null || p === void 0 ? void 0 : p.getStr().toUpperCase()) === i.toUpperCase()) {\r\n const message = \"Omit default parameter name \\\"\" + i + \"\\\"\";\r\n let fix = undefined;\r\n const end = (_b = parameters[0].findDirectExpression(Expressions.Source)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStart();\r\n if (end) {\r\n fix = edit_helper_1.EditHelper.deleteRange(file, p.getStart(), end);\r\n }\r\n issues.push(issue_1.Issue.atToken(file, name.getFirstToken(), message, this.getMetadata().key, this.getConfig().severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////\r\n findMethodReference(token, spaghetti, filename) {\r\n const scope = spaghetti.lookupPosition(token.getStart(), filename);\r\n if (scope === undefined) {\r\n return undefined;\r\n }\r\n for (const r of scope.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.MethodReference) {\r\n continue;\r\n }\r\n else if (r.position.getStart().equals(token.getStart())\r\n && r.resolved instanceof method_definition_1.MethodDefinition) {\r\n return r.resolved;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.OmitParameterName = OmitParameterName;\r\n//# sourceMappingURL=omit_parameter_name.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_parameter_name.js?");
|
|
12241
12274
|
|
|
12242
12275
|
/***/ }),
|
|
12243
12276
|
|
|
@@ -12259,7 +12292,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12259
12292
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12260
12293
|
|
|
12261
12294
|
"use strict";
|
|
12262
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitReceiving = exports.OmitReceivingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nclass OmitReceivingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitReceivingConf = OmitReceivingConf;\r\nclass OmitReceiving extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new OmitReceivingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_receiving\",\r\n title: \"Omit RECEIVING\",\r\n shortDescription: `Omit RECEIVING`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `\n upload_pack(\n EXPORTING\n io_client = lo_client\n iv_url = iv_url\n iv_deepen_level = iv_deepen_level\n it_hashes = lt_hashes\n RECEIVING\n rt_objects = et_objects ).`,\r\n goodExample: `\n et_objects = upload_pack(\n io_client = lo_client\n iv_url = iv_url\n iv_deepen_level = iv_deepen_level\n it_hashes = lt_hashes ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const e of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.MethodCallParam)) || []) {\r\n const p = e.findDirectExpression(Expressions.MethodParameters);\r\n if (p === undefined) {\r\n continue;\r\n }\r\n const r = p.findDirectTokenByText(\"RECEIVING\");\r\n if (r === undefined) {\r\n continue;\r\n }\r\n const ex = p.findDirectTokenByText(\"EXCEPTIONS\");\r\n if (ex !== undefined) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atToken(file, r, \"Omit RECEIVING\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.OmitReceiving = OmitReceiving;\r\n//# sourceMappingURL=omit_receiving.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_receiving.js?");
|
|
12295
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.OmitReceiving = exports.OmitReceivingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nclass OmitReceivingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.OmitReceivingConf = OmitReceivingConf;\r\nclass OmitReceiving extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new OmitReceivingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"omit_receiving\",\r\n title: \"Omit RECEIVING\",\r\n shortDescription: `Omit RECEIVING`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#omit-receiving`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `\r\n upload_pack(\r\n EXPORTING\r\n io_client = lo_client\r\n iv_url = iv_url\r\n iv_deepen_level = iv_deepen_level\r\n it_hashes = lt_hashes\r\n RECEIVING\r\n rt_objects = et_objects ).`,\r\n goodExample: `\r\n et_objects = upload_pack(\r\n io_client = lo_client\r\n iv_url = iv_url\r\n iv_deepen_level = iv_deepen_level\r\n it_hashes = lt_hashes ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n for (const e of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.MethodCallParam)) || []) {\r\n const p = e.findDirectExpression(Expressions.MethodParameters);\r\n if (p === undefined) {\r\n continue;\r\n }\r\n const r = p.findDirectTokenByText(\"RECEIVING\");\r\n if (r === undefined) {\r\n continue;\r\n }\r\n const ex = p.findDirectTokenByText(\"EXCEPTIONS\");\r\n if (ex !== undefined) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atToken(file, r, \"Omit RECEIVING\", this.getMetadata().key, this.getConfig().severity));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.OmitReceiving = OmitReceiving;\r\n//# sourceMappingURL=omit_receiving.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/omit_receiving.js?");
|
|
12263
12296
|
|
|
12264
12297
|
/***/ }),
|
|
12265
12298
|
|
|
@@ -12270,7 +12303,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12270
12303
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12271
12304
|
|
|
12272
12305
|
"use strict";
|
|
12273
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Parser702Chaining = exports.Parser702ChainingConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Parser702ChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.Parser702ChainingConf = Parser702ChainingConf;\r\nclass Parser702Chaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new Parser702ChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_702_chaining\",\r\n title: \"Parser Error, bad chanining on 702\",\r\n shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,\nthis rule finds these and reports errors.\nOnly active on target version 702 and below.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() !== version_1.Version.v702\r\n && this.reg.getConfig().getVersion() !== version_1.Version.v700) {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const chain of stru.findAllExpressions(Expressions.MethodCallChain)) {\r\n const calls = chain.findDirectExpressions(Expressions.MethodCall);\r\n if (calls.length < 2) {\r\n continue;\r\n }\r\n for (const call of calls) {\r\n const callParam = call.findDirectExpression(Expressions.MethodCallParam);\r\n if (callParam === undefined) {\r\n continue;\r\n }\r\n const param = callParam.findDirectExpression(Expressions.MethodParameters);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n if (param.findDirectTokenByText(\"IMPORTING\")\r\n || param.findDirectTokenByText(\"CHANGING\")\r\n || param.findDirectTokenByText(\"EXCEPTIONS\")) {\r\n const message = \"This kind of method chaining not possible in 702\";\r\n const issue = issue_1.Issue.atPosition(file, param.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Parser702Chaining = Parser702Chaining;\r\n//# sourceMappingURL=parser_702_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js?");
|
|
12306
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.Parser702Chaining = exports.Parser702ChainingConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass Parser702ChainingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.Parser702ChainingConf = Parser702ChainingConf;\r\nclass Parser702Chaining extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new Parser702ChainingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_702_chaining\",\r\n title: \"Parser Error, bad chanining on 702\",\r\n shortDescription: `ABAP on 702 does not allow for method chaining with IMPORTING/EXPORTING/CHANGING keywords,\r\nthis rule finds these and reports errors.\r\nOnly active on target version 702 and below.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() !== version_1.Version.v702\r\n && this.reg.getConfig().getVersion() !== version_1.Version.v700) {\r\n return [];\r\n }\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const chain of stru.findAllExpressions(Expressions.MethodCallChain)) {\r\n const calls = chain.findDirectExpressions(Expressions.MethodCall);\r\n if (calls.length < 2) {\r\n continue;\r\n }\r\n for (const call of calls) {\r\n const callParam = call.findDirectExpression(Expressions.MethodCallParam);\r\n if (callParam === undefined) {\r\n continue;\r\n }\r\n const param = callParam.findDirectExpression(Expressions.MethodParameters);\r\n if (param === undefined) {\r\n continue;\r\n }\r\n if (param.findDirectTokenByText(\"IMPORTING\")\r\n || param.findDirectTokenByText(\"CHANGING\")\r\n || param.findDirectTokenByText(\"EXCEPTIONS\")) {\r\n const message = \"This kind of method chaining not possible in 702\";\r\n const issue = issue_1.Issue.atPosition(file, param.getFirstToken().getStart(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.Parser702Chaining = Parser702Chaining;\r\n//# sourceMappingURL=parser_702_chaining.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_702_chaining.js?");
|
|
12274
12307
|
|
|
12275
12308
|
/***/ }),
|
|
12276
12309
|
|
|
@@ -12281,7 +12314,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12281
12314
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12282
12315
|
|
|
12283
12316
|
"use strict";
|
|
12284
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserError = exports.ParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst statement_parser_1 = __webpack_require__(/*! ../abap/2_statements/statement_parser */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statement_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserErrorConf = ParserErrorConf;\r\nclass ParserError extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_error\",\r\n title: \"Parser error\",\r\n shortDescription: `Checks for syntax not recognized by abaplint.\n\nSee recognized syntax at https://syntax.abaplint.org`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (!(statement.get() instanceof _statement_1.Unknown)) {\r\n continue;\r\n }\r\n if (statement.getTokens().length > statement_parser_1.STATEMENT_MAX_TOKENS) {\r\n const message = \"Statement too long, refactor statement\";\r\n const issue = issue_1.Issue.atToken(file, statement.getTokens()[0], message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else {\r\n const tok = statement.getFirstToken();\r\n const message = \"Statement does not exist in ABAP\" + this.reg.getConfig().getVersion() + \"(or a parser error), \\\"\" + tok.getStr() + \"\\\"\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.reg.getConfig().getVersion() === version_1.Version.v700) {\r\n for (const statement of file.getStatements()) {\r\n if (statement.getPragmas().length > 0) {\r\n const message = \"Pragmas not allowed in v700\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ParserError = ParserError;\r\n//# sourceMappingURL=parser_error.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_error.js?");
|
|
12317
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserError = exports.ParserErrorConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst statement_parser_1 = __webpack_require__(/*! ../abap/2_statements/statement_parser */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statement_parser.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nclass ParserErrorConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserErrorConf = ParserErrorConf;\r\nclass ParserError extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserErrorConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_error\",\r\n title: \"Parser error\",\r\n shortDescription: `Checks for syntax not recognized by abaplint.\r\n\r\nSee recognized syntax at https://syntax.abaplint.org`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (!(statement.get() instanceof _statement_1.Unknown)) {\r\n continue;\r\n }\r\n if (statement.getTokens().length > statement_parser_1.STATEMENT_MAX_TOKENS) {\r\n const message = \"Statement too long, refactor statement\";\r\n const issue = issue_1.Issue.atToken(file, statement.getTokens()[0], message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n else {\r\n const tok = statement.getFirstToken();\r\n const message = \"Statement does not exist in ABAP\" + this.reg.getConfig().getVersion() + \"(or a parser error), \\\"\" + tok.getStr() + \"\\\"\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n if (this.reg.getConfig().getVersion() === version_1.Version.v700) {\r\n for (const statement of file.getStatements()) {\r\n if (statement.getPragmas().length > 0) {\r\n const message = \"Pragmas not allowed in v700\";\r\n const issue = issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.ParserError = ParserError;\r\n//# sourceMappingURL=parser_error.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_error.js?");
|
|
12285
12318
|
|
|
12286
12319
|
/***/ }),
|
|
12287
12320
|
|
|
@@ -12292,7 +12325,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12292
12325
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12293
12326
|
|
|
12294
12327
|
"use strict";
|
|
12295
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserMissingSpace = exports.ParserMissingSpaceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\n// todo: this rule needs refactoring\r\nclass ParserMissingSpaceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserMissingSpaceConf = ParserMissingSpaceConf;\r\nclass ParserMissingSpace extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserMissingSpaceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_missing_space\",\r\n title: \"Parser Error, missing space\",\r\n shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.\nThis rule makes sure the spaces are consistently required across the language.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF ( foo = 'bar').`,\r\n goodExample: `IF ( foo = 'bar' ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let start = new position_1.Position(0, 0);\r\n for (const statement of file.getStatements()) {\r\n const missing = this.missingSpace(statement);\r\n if (missing) {\r\n const message = \"Missing space between string or character literal and parentheses\";\r\n start = missing;\r\n const issue = issue_1.Issue.atPosition(file, start, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n missingSpace(statement) {\r\n const found = statement.findAllExpressionsMulti([Expressions.CondSub, Expressions.SQLCond,\r\n Expressions.ValueBody, Expressions.NewObject, Expressions.Cond,\r\n Expressions.ComponentCond, Expressions.MethodCallParam], true);\r\n let pos = undefined;\r\n for (const f of found) {\r\n const type = f.get();\r\n if (type instanceof Expressions.CondSub) {\r\n pos = this.checkCondSub(f);\r\n }\r\n else if (type instanceof Expressions.ValueBody) {\r\n pos = this.checkValueBody(f);\r\n }\r\n else if (type instanceof Expressions.Cond) {\r\n pos = this.checkCond(f);\r\n }\r\n else if (type instanceof Expressions.ComponentCond) {\r\n pos = this.checkComponentCond(f);\r\n }\r\n else if (type instanceof Expressions.SQLCond) {\r\n pos = this.checkSQLCond(f);\r\n }\r\n else if (type instanceof Expressions.NewObject) {\r\n pos = this.checkNewObject(f);\r\n }\r\n else if (type instanceof Expressions.MethodCallParam) {\r\n pos = this.checkMethodCallParam(f);\r\n }\r\n if (pos) {\r\n return pos;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkSQLCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.SQLCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkNewObject(cond) {\r\n const children = cond.getChildren();\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCondSub(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.Cond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkComponentCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.ComponentCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkValueBody(vb) {\r\n var _a, _b;\r\n const children = vb.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const current = children[i];\r\n if (current instanceof nodes_1.TokenNode) {\r\n const prev = (_a = children[i - 1]) === null || _a === void 0 ? void 0 : _a.getLastToken();\r\n const next = (_b = children[i + 1]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n if (current.getFirstToken().getStr() === \"(\"\r\n && next\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (current.getFirstToken().getStr() === \")\"\r\n && prev\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getEnd().getCol() === current.getFirstToken().getStart().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCond(cond) {\r\n const children = cond.getAllTokens();\r\n for (let i = 0; i < children.length - 1; i++) {\r\n const current = children[i];\r\n const next = children[i + 1];\r\n if (next.getStr().startsWith(\"'\")\r\n && next.getRow() === current.getRow()\r\n && next.getCol() === current.getEnd().getCol()) {\r\n return current.getEnd();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkMethodCallParam(call) {\r\n const children = call.getChildren();\r\n {\r\n const first = children[0].getFirstToken();\r\n const second = children[1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getCol() + 1 === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ParserMissingSpace = ParserMissingSpace;\r\n//# sourceMappingURL=parser_missing_space.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js?");
|
|
12328
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.ParserMissingSpace = exports.ParserMissingSpaceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst nodes_1 = __webpack_require__(/*! ../abap/nodes */ \"./node_modules/@abaplint/core/build/src/abap/nodes/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\n// todo: this rule needs refactoring\r\nclass ParserMissingSpaceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.ParserMissingSpaceConf = ParserMissingSpaceConf;\r\nclass ParserMissingSpace extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new ParserMissingSpaceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"parser_missing_space\",\r\n title: \"Parser Error, missing space\",\r\n shortDescription: `In special cases the ABAP language allows for not having spaces before or after string literals.\r\nThis rule makes sure the spaces are consistently required across the language.`,\r\n tags: [_irule_1.RuleTag.Syntax, _irule_1.RuleTag.Whitespace, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF ( foo = 'bar').`,\r\n goodExample: `IF ( foo = 'bar' ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let start = new position_1.Position(0, 0);\r\n for (const statement of file.getStatements()) {\r\n const missing = this.missingSpace(statement);\r\n if (missing) {\r\n const message = \"Missing space between string or character literal and parentheses\";\r\n start = missing;\r\n const issue = issue_1.Issue.atPosition(file, start, message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n missingSpace(statement) {\r\n const found = statement.findAllExpressionsMulti([Expressions.CondSub, Expressions.SQLCond,\r\n Expressions.ValueBody, Expressions.NewObject, Expressions.Cond,\r\n Expressions.ComponentCond, Expressions.MethodCallParam], true);\r\n let pos = undefined;\r\n for (const f of found) {\r\n const type = f.get();\r\n if (type instanceof Expressions.CondSub) {\r\n pos = this.checkCondSub(f);\r\n }\r\n else if (type instanceof Expressions.ValueBody) {\r\n pos = this.checkValueBody(f);\r\n }\r\n else if (type instanceof Expressions.Cond) {\r\n pos = this.checkCond(f);\r\n }\r\n else if (type instanceof Expressions.ComponentCond) {\r\n pos = this.checkComponentCond(f);\r\n }\r\n else if (type instanceof Expressions.SQLCond) {\r\n pos = this.checkSQLCond(f);\r\n }\r\n else if (type instanceof Expressions.NewObject) {\r\n pos = this.checkNewObject(f);\r\n }\r\n else if (type instanceof Expressions.MethodCallParam) {\r\n pos = this.checkMethodCallParam(f);\r\n }\r\n if (pos) {\r\n return pos;\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkSQLCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.SQLCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkNewObject(cond) {\r\n const children = cond.getChildren();\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCondSub(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.Cond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkComponentCond(cond) {\r\n const children = cond.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n if (children[i].get() instanceof Expressions.ComponentCond) {\r\n const current = children[i];\r\n const prev = children[i - 1].getLastToken();\r\n const next = children[i + 1].getFirstToken();\r\n if (prev.getStr() === \"(\"\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getCol() + 1 === current.getFirstToken().getStart().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (next.getStr() === \")\"\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkValueBody(vb) {\r\n var _a, _b;\r\n const children = vb.getChildren();\r\n for (let i = 0; i < children.length; i++) {\r\n const current = children[i];\r\n if (current instanceof nodes_1.TokenNode) {\r\n const prev = (_a = children[i - 1]) === null || _a === void 0 ? void 0 : _a.getLastToken();\r\n const next = (_b = children[i + 1]) === null || _b === void 0 ? void 0 : _b.getFirstToken();\r\n if (current.getFirstToken().getStr() === \"(\"\r\n && next\r\n && next.getRow() === current.getLastToken().getRow()\r\n && next.getCol() === current.getLastToken().getEnd().getCol()) {\r\n return current.getFirstToken().getStart();\r\n }\r\n if (current.getFirstToken().getStr() === \")\"\r\n && prev\r\n && prev.getRow() === current.getFirstToken().getRow()\r\n && prev.getEnd().getCol() === current.getFirstToken().getStart().getCol()) {\r\n return current.getLastToken().getEnd();\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkCond(cond) {\r\n const children = cond.getAllTokens();\r\n for (let i = 0; i < children.length - 1; i++) {\r\n const current = children[i];\r\n const next = children[i + 1];\r\n if (next.getStr().startsWith(\"'\")\r\n && next.getRow() === current.getRow()\r\n && next.getCol() === current.getEnd().getCol()) {\r\n return current.getEnd();\r\n }\r\n }\r\n return undefined;\r\n }\r\n checkMethodCallParam(call) {\r\n const children = call.getChildren();\r\n {\r\n const first = children[0].getFirstToken();\r\n const second = children[1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getCol() + 1 === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n {\r\n const first = children[children.length - 2].getLastToken();\r\n const second = children[children.length - 1].getFirstToken();\r\n if (first.getRow() === second.getRow()\r\n && first.getEnd().getCol() === second.getStart().getCol()) {\r\n return second.getStart();\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.ParserMissingSpace = ParserMissingSpace;\r\n//# sourceMappingURL=parser_missing_space.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/parser_missing_space.js?");
|
|
12296
12329
|
|
|
12297
12330
|
/***/ }),
|
|
12298
12331
|
|
|
@@ -12325,7 +12358,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12325
12358
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12326
12359
|
|
|
12327
12360
|
"use strict";
|
|
12328
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferInline = exports.PreferInlineConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferInlineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferInlineConf = PreferInlineConf;\r\nclass PreferInline {\r\n constructor() {\r\n this.conf = new PreferInlineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_inline\",\r\n title: \"Prefer Inline Declarations\",\r\n shortDescription: `Prefer inline to up-front declarations.`,\r\n extendedInformation: `EXPERIMENTAL\n\nActivates if language version is v740sp02 or above.\n\nVariables must be local(METHOD or FORM).\n\nNo generic or void typed variables.\n\nFirst position used must be a full/pure write.\n\nMove statment is not a cast(?=)\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],\r\n badExample: `DATA foo TYPE i.\nfoo = 2.\nDATA percentage TYPE decfloat34.\npercentage = ( comment_number / abs_statement_number ) * 100.`,\r\n goodExample: `DATA(foo) = 2.\nDATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n else if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const scopes = this.findScopeCandidates(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const ret = [];\r\n for (const s of scopes) {\r\n ret.push(...this.analyzeScope(s, obj));\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////\r\n analyzeScope(node, obj) {\r\n var _a, _b;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n if (this.isLocalDefinition(node, identifier) === false\r\n || identifier.getMeta().includes(\"inline\" /* InlineDefinition */)\r\n || identifier.getMeta().includes(\"form_parameter\" /* FormParameter */)) {\r\n continue;\r\n }\r\n else if (identifier.getType().isGeneric() === true) {\r\n continue;\r\n }\r\n else if (identifier.getType().containsVoid() === true) {\r\n continue;\r\n }\r\n const write = this.firstUseIsWrite(node, identifier);\r\n if (write === undefined) {\r\n continue;\r\n }\r\n // check that it is a pure write, eg not sub component assignment\r\n const next = this.findNextToken(write, obj);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n else if ((next === null || next === void 0 ? void 0 : next.getStart().equals(write.position.getEnd())) && next.getStr() !== \".\" && next.getStr() !== \",\") {\r\n continue;\r\n }\r\n const file = obj.getABAPFileByName(identifier.getFilename());\r\n const writeStatement = edit_helper_1.EditHelper.findStatement(next, file);\r\n const statementType = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.get();\r\n if (statementType === undefined) {\r\n continue;\r\n }\r\n // for now only allow some specific target statements, todo refactor\r\n if (!(statementType instanceof Statements.Move\r\n || statementType instanceof Statements.Catch\r\n || statementType instanceof Statements.ReadTable\r\n || statementType instanceof Statements.Loop)\r\n || ((_a = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _a === void 0 ? void 0 : _a.includes(\"?=\"))\r\n || ((_b = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _b === void 0 ? void 0 : _b.includes(\" #(\"))) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(identifier.getToken(), file);\r\n const concat = statement === null || statement === void 0 ? void 0 : statement.concatTokens().toUpperCase();\r\n if (concat === null || concat === void 0 ? void 0 : concat.includes(\"BEGIN OF\")) {\r\n continue;\r\n }\r\n let fix = undefined;\r\n if (file && statement) {\r\n const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n const name = identifier.getName();\r\n const replace = name.startsWith(\"<\") ? \"FIELD-SYMBOL(\" + name + \")\" : \"DATA(\" + name + \")\";\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(file, write.position.getStart(), write.position.getEnd(), replace);\r\n fix = edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n const message = this.getMetadata().title + \", \" + name;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n ////////////////////////\r\n findNextToken(ref, obj) {\r\n const file = obj.getABAPFileByName(ref.resolved.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getStart().isAfter(ref.position.getEnd())) {\r\n return t;\r\n }\r\n }\r\n return undefined;\r\n }\r\n firstUseIsWrite(node, identifier) {\r\n // assumption: variables are local, so only the current scope must be searched\r\n var _a, _b, _c;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && ((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.getStart().equals(identifier.getStart())) === true) {\r\n return undefined;\r\n }\r\n }\r\n let firstRead = undefined;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.DataReadReference\r\n || ((_b = r.resolved) === null || _b === void 0 ? void 0 : _b.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (r.resolved) {\r\n firstRead = { position: r.position, resolved: r.resolved };\r\n break;\r\n }\r\n }\r\n let firstWrite = undefined;\r\n for (const w of node.getData().references) {\r\n if (w.referenceType !== _reference_1.ReferenceType.DataWriteReference\r\n || ((_c = w.resolved) === null || _c === void 0 ? void 0 : _c.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (w.resolved) {\r\n firstWrite = { position: w.position, resolved: w.resolved };\r\n break;\r\n }\r\n }\r\n if (firstRead === undefined) {\r\n return firstWrite;\r\n }\r\n else if (firstWrite === undefined) {\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().getRow() === firstRead.position.getStart().getRow()) {\r\n // if the same statement both reads and write the same variable\r\n // note that currently just the line number is compared, this is not correct, it should check if its the same statement\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().isBefore(firstRead.position.getStart())) {\r\n return firstWrite;\r\n }\r\n return undefined;\r\n }\r\n isLocalDefinition(node, identifier) {\r\n const { start, end } = node.calcCoverage();\r\n if (identifier.getStart().isAfter(start) && identifier.getStart().isBefore(end)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n findScopeCandidates(node) {\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.Form\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Method) {\r\n return [node];\r\n }\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.findScopeCandidates(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferInline = PreferInline;\r\n//# sourceMappingURL=prefer_inline.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_inline.js?");
|
|
12361
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferInline = exports.PreferInlineConf = void 0;\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferInlineConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferInlineConf = PreferInlineConf;\r\nclass PreferInline {\r\n constructor() {\r\n this.conf = new PreferInlineConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_inline\",\r\n title: \"Prefer Inline Declarations\",\r\n shortDescription: `Prefer inline to up-front declarations.`,\r\n extendedInformation: `EXPERIMENTAL\r\n\r\nActivates if language version is v740sp02 or above.\r\n\r\nVariables must be local(METHOD or FORM).\r\n\r\nNo generic or void typed variables.\r\n\r\nFirst position used must be a full/pure write.\r\n\r\nMove statment is not a cast(?=)\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-inline-to-up-front-declarations`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Experimental, _irule_1.RuleTag.Quickfix],\r\n badExample: `DATA foo TYPE i.\r\nfoo = 2.\r\nDATA percentage TYPE decfloat34.\r\npercentage = ( comment_number / abs_statement_number ) * 100.`,\r\n goodExample: `DATA(foo) = 2.\r\nDATA(percentage) = CONV decfloat34( comment_number / abs_statement_number ) * 100.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n else if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const scopes = this.findScopeCandidates(new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti.getTop());\r\n const ret = [];\r\n for (const s of scopes) {\r\n ret.push(...this.analyzeScope(s, obj));\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////\r\n analyzeScope(node, obj) {\r\n var _a, _b;\r\n const ret = [];\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const identifier = vars[name];\r\n if (this.isLocalDefinition(node, identifier) === false\r\n || identifier.getMeta().includes(\"inline\" /* InlineDefinition */)\r\n || identifier.getMeta().includes(\"form_parameter\" /* FormParameter */)) {\r\n continue;\r\n }\r\n else if (identifier.getType().isGeneric() === true) {\r\n continue;\r\n }\r\n else if (identifier.getType().containsVoid() === true) {\r\n continue;\r\n }\r\n const write = this.firstUseIsWrite(node, identifier);\r\n if (write === undefined) {\r\n continue;\r\n }\r\n // check that it is a pure write, eg not sub component assignment\r\n const next = this.findNextToken(write, obj);\r\n if (next === undefined) {\r\n continue;\r\n }\r\n else if ((next === null || next === void 0 ? void 0 : next.getStart().equals(write.position.getEnd())) && next.getStr() !== \".\" && next.getStr() !== \",\") {\r\n continue;\r\n }\r\n const file = obj.getABAPFileByName(identifier.getFilename());\r\n const writeStatement = edit_helper_1.EditHelper.findStatement(next, file);\r\n const statementType = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.get();\r\n if (statementType === undefined) {\r\n continue;\r\n }\r\n // for now only allow some specific target statements, todo refactor\r\n if (!(statementType instanceof Statements.Move\r\n || statementType instanceof Statements.Catch\r\n || statementType instanceof Statements.ReadTable\r\n || statementType instanceof Statements.Loop)\r\n || ((_a = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _a === void 0 ? void 0 : _a.includes(\"?=\"))\r\n || ((_b = writeStatement === null || writeStatement === void 0 ? void 0 : writeStatement.concatTokens()) === null || _b === void 0 ? void 0 : _b.includes(\" #(\"))) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(identifier.getToken(), file);\r\n const concat = statement === null || statement === void 0 ? void 0 : statement.concatTokens().toUpperCase();\r\n if (concat === null || concat === void 0 ? void 0 : concat.includes(\"BEGIN OF\")) {\r\n continue;\r\n }\r\n let fix = undefined;\r\n if (file && statement) {\r\n const fix1 = edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n const name = identifier.getName();\r\n const replace = name.startsWith(\"<\") ? \"FIELD-SYMBOL(\" + name + \")\" : \"DATA(\" + name + \")\";\r\n const fix2 = edit_helper_1.EditHelper.replaceRange(file, write.position.getStart(), write.position.getEnd(), replace);\r\n fix = edit_helper_1.EditHelper.merge(fix1, fix2);\r\n }\r\n const message = this.getMetadata().title + \", \" + name;\r\n ret.push(issue_1.Issue.atIdentifier(identifier, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n ////////////////////////\r\n findNextToken(ref, obj) {\r\n const file = obj.getABAPFileByName(ref.resolved.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getStart().isAfter(ref.position.getEnd())) {\r\n return t;\r\n }\r\n }\r\n return undefined;\r\n }\r\n firstUseIsWrite(node, identifier) {\r\n // assumption: variables are local, so only the current scope must be searched\r\n var _a, _b, _c;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.TypeReference\r\n && ((_a = r.resolved) === null || _a === void 0 ? void 0 : _a.getStart().equals(identifier.getStart())) === true) {\r\n return undefined;\r\n }\r\n }\r\n let firstRead = undefined;\r\n for (const r of node.getData().references) {\r\n if (r.referenceType !== _reference_1.ReferenceType.DataReadReference\r\n || ((_b = r.resolved) === null || _b === void 0 ? void 0 : _b.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (r.resolved) {\r\n firstRead = { position: r.position, resolved: r.resolved };\r\n break;\r\n }\r\n }\r\n let firstWrite = undefined;\r\n for (const w of node.getData().references) {\r\n if (w.referenceType !== _reference_1.ReferenceType.DataWriteReference\r\n || ((_c = w.resolved) === null || _c === void 0 ? void 0 : _c.getStart().equals(identifier.getStart())) === false) {\r\n continue;\r\n }\r\n if (w.resolved) {\r\n firstWrite = { position: w.position, resolved: w.resolved };\r\n break;\r\n }\r\n }\r\n if (firstRead === undefined) {\r\n return firstWrite;\r\n }\r\n else if (firstWrite === undefined) {\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().getRow() === firstRead.position.getStart().getRow()) {\r\n // if the same statement both reads and write the same variable\r\n // note that currently just the line number is compared, this is not correct, it should check if its the same statement\r\n return undefined;\r\n }\r\n else if (firstWrite.position.getStart().isBefore(firstRead.position.getStart())) {\r\n return firstWrite;\r\n }\r\n return undefined;\r\n }\r\n isLocalDefinition(node, identifier) {\r\n const { start, end } = node.calcCoverage();\r\n if (identifier.getStart().isAfter(start) && identifier.getStart().isBefore(end)) {\r\n return true;\r\n }\r\n else {\r\n return false;\r\n }\r\n }\r\n findScopeCandidates(node) {\r\n if (node.getIdentifier().stype === _scope_type_1.ScopeType.Form\r\n || node.getIdentifier().stype === _scope_type_1.ScopeType.Method) {\r\n return [node];\r\n }\r\n let ret = [];\r\n for (const c of node.getChildren()) {\r\n ret = ret.concat(this.findScopeCandidates(c));\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferInline = PreferInline;\r\n//# sourceMappingURL=prefer_inline.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_inline.js?");
|
|
12329
12362
|
|
|
12330
12363
|
/***/ }),
|
|
12331
12364
|
|
|
@@ -12336,7 +12369,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12336
12369
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12337
12370
|
|
|
12338
12371
|
"use strict";
|
|
12339
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferIsNot = exports.PreferIsNotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass PreferIsNotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferIsNotConf = PreferIsNotConf;\r\nclass PreferIsNot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferIsNotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_is_not\",\r\n title: \"Prefer IS NOT to NOT IS\",\r\n shortDescription: `Prefer IS NOT to NOT IS`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is\n\n\"if not is_valid( ).\" examples are skipped`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n goodExample: `IF variable IS NOT INITIAL.\nIF variable NP 'TODO*'.\nIF variable <> 42.`,\r\n badExample: `IF NOT variable IS INITIAL.\nIF NOT variable CP 'TODO*'.\nIF NOT variable = 42.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n for (const c of s.findAllExpressions(Expressions.Compare)) {\r\n if (c.concatTokens().toUpperCase().startsWith(\"NOT \") === false) {\r\n continue;\r\n }\r\n else if (c.getChildren().length === 2 && c.getChildren()[1].get() instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const message = \"Prefer IS NOT to NOT IS\";\r\n const fix = this.getFix(file, c);\r\n issues.push(issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, c) {\r\n let insertFix;\r\n if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IS\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[2].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IN\" || c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"BETWEEN\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[1].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<>\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<>\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<=\");\r\n }\r\n else {\r\n return;\r\n }\r\n const endCol = c.getChildren()[0].getFirstToken().getEnd().getCol() + 1;\r\n const endPosition = new position_1.Position(c.getChildren()[0].getFirstToken().getEnd().getRow(), endCol);\r\n const deleteFix = edit_helper_1.EditHelper.deleteRange(file, c.getChildren()[0].getFirstToken().getStart(), endPosition);\r\n const finalFix = edit_helper_1.EditHelper.merge(insertFix, deleteFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.PreferIsNot = PreferIsNot;\r\n//# sourceMappingURL=prefer_is_not.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js?");
|
|
12372
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferIsNot = exports.PreferIsNotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass PreferIsNotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferIsNotConf = PreferIsNotConf;\r\nclass PreferIsNot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferIsNotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_is_not\",\r\n title: \"Prefer IS NOT to NOT IS\",\r\n shortDescription: `Prefer IS NOT to NOT IS`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-is-not-to-not-is\r\n\r\n\"if not is_valid( ).\" examples are skipped`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n goodExample: `IF variable IS NOT INITIAL.\r\nIF variable NP 'TODO*'.\r\nIF variable <> 42.`,\r\n badExample: `IF NOT variable IS INITIAL.\r\nIF NOT variable CP 'TODO*'.\r\nIF NOT variable = 42.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n for (const s of file.getStatements()) {\r\n for (const c of s.findAllExpressions(Expressions.Compare)) {\r\n if (c.concatTokens().toUpperCase().startsWith(\"NOT \") === false) {\r\n continue;\r\n }\r\n else if (c.getChildren().length === 2 && c.getChildren()[1].get() instanceof Expressions.MethodCallChain) {\r\n continue;\r\n }\r\n const message = \"Prefer IS NOT to NOT IS\";\r\n const fix = this.getFix(file, c);\r\n issues.push(issue_1.Issue.atToken(file, c.getFirstToken(), message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, c) {\r\n let insertFix;\r\n if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IS\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[2].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"IN\" || c.getChildren()[2].getFirstToken().getStr().toUpperCase() === \"BETWEEN\") {\r\n const tokenPositionBeforeDelete = c.getChildren()[1].getLastToken().getEnd();\r\n const tokenPosition = new position_1.Position(tokenPositionBeforeDelete.getRow(), tokenPositionBeforeDelete.getCol() + 1);\r\n insertFix = edit_helper_1.EditHelper.insertAt(file, tokenPosition, \"NOT \");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<>\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<>\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \"<=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \">=\");\r\n }\r\n else if (c.getChildren()[2].getFirstToken().getStr() === \">=\") {\r\n insertFix = edit_helper_1.EditHelper.replaceToken(file, c.getChildren()[2].getLastToken(), \"<=\");\r\n }\r\n else {\r\n return;\r\n }\r\n const endCol = c.getChildren()[0].getFirstToken().getEnd().getCol() + 1;\r\n const endPosition = new position_1.Position(c.getChildren()[0].getFirstToken().getEnd().getRow(), endCol);\r\n const deleteFix = edit_helper_1.EditHelper.deleteRange(file, c.getChildren()[0].getFirstToken().getStart(), endPosition);\r\n const finalFix = edit_helper_1.EditHelper.merge(insertFix, deleteFix);\r\n return finalFix;\r\n }\r\n}\r\nexports.PreferIsNot = PreferIsNot;\r\n//# sourceMappingURL=prefer_is_not.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_is_not.js?");
|
|
12340
12373
|
|
|
12341
12374
|
/***/ }),
|
|
12342
12375
|
|
|
@@ -12347,7 +12380,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12347
12380
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12348
12381
|
|
|
12349
12382
|
"use strict";
|
|
12350
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferRaiseExceptionNew = exports.PreferRaiseExceptionNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass PreferRaiseExceptionNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferRaiseExceptionNewConf = PreferRaiseExceptionNewConf;\r\nclass PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferRaiseExceptionNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_raise_exception_new\",\r\n title: \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\",\r\n shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,\r\n extendedInformation: `\n https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,\r\n badExample: `RAISE EXCEPTION TYPE cx_generation_error\n EXPORTING\n previous = exception.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n if (this.reg.getConfig().getVersion() < __1.Version.v752) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof __1.Statements.Raise) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" MESSAGE\")) {\r\n continue;\r\n }\r\n if (concat.startsWith(\"RAISE EXCEPTION TYPE \")) {\r\n const message = \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\";\r\n const fix = this.getFix(file, statement, concat.includes(\" EXPORTING\") ? true : false);\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, withExporting) {\r\n const children = statement.getChildren();\r\n let contentFix = undefined;\r\n if (withExporting) {\r\n const fixText = \"( \" + children[5].concatTokens() + \" ).\";\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), fixText);\r\n }\r\n else {\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), \"( ).\");\r\n }\r\n const replaceType = edit_helper_1.EditHelper.replaceToken(file, children[2].getFirstToken(), \"NEW\");\r\n return edit_helper_1.EditHelper.merge(contentFix, replaceType);\r\n }\r\n}\r\nexports.PreferRaiseExceptionNew = PreferRaiseExceptionNew;\r\n//# sourceMappingURL=prefer_raise_exception_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js?");
|
|
12383
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferRaiseExceptionNew = exports.PreferRaiseExceptionNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst __1 = __webpack_require__(/*! .. */ \"./node_modules/@abaplint/core/build/src/index.js\");\r\nclass PreferRaiseExceptionNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferRaiseExceptionNewConf = PreferRaiseExceptionNewConf;\r\nclass PreferRaiseExceptionNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferRaiseExceptionNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_raise_exception_new\",\r\n title: \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\",\r\n shortDescription: `Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE`,\r\n extendedInformation: `\r\n https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-raise-exception-new-to-raise-exception-type`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Quickfix],\r\n goodExample: `RAISE EXCEPTION NEW cx_generation_error( previous = exception ).`,\r\n badExample: `RAISE EXCEPTION TYPE cx_generation_error\r\n EXPORTING\r\n previous = exception.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n if (this.reg.getConfig().getVersion() < __1.Version.v752) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof __1.Statements.Raise) {\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" MESSAGE\")) {\r\n continue;\r\n }\r\n if (concat.startsWith(\"RAISE EXCEPTION TYPE \")) {\r\n const message = \"Prefer RAISE EXCEPTION NEW to RAISE EXCEPTION TYPE\";\r\n const fix = this.getFix(file, statement, concat.includes(\" EXPORTING\") ? true : false);\r\n issues.push(issue_1.Issue.atStatement(file, statement, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getFix(file, statement, withExporting) {\r\n const children = statement.getChildren();\r\n let contentFix = undefined;\r\n if (withExporting) {\r\n const fixText = \"( \" + children[5].concatTokens() + \" ).\";\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), fixText);\r\n }\r\n else {\r\n contentFix = edit_helper_1.EditHelper.replaceRange(file, children[3].getLastToken().getEnd(), statement.getEnd(), \"( ).\");\r\n }\r\n const replaceType = edit_helper_1.EditHelper.replaceToken(file, children[2].getFirstToken(), \"NEW\");\r\n return edit_helper_1.EditHelper.merge(contentFix, replaceType);\r\n }\r\n}\r\nexports.PreferRaiseExceptionNew = PreferRaiseExceptionNew;\r\n//# sourceMappingURL=prefer_raise_exception_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_raise_exception_new.js?");
|
|
12351
12384
|
|
|
12352
12385
|
/***/ }),
|
|
12353
12386
|
|
|
@@ -12358,7 +12391,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12358
12391
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12359
12392
|
|
|
12360
12393
|
"use strict";
|
|
12361
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferReturningToExporting = exports.PreferReturningToExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass PreferReturningToExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferReturningToExportingConf = PreferReturningToExportingConf;\r\nclass PreferReturningToExporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferReturningToExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_returning_to_exporting\",\r\n title: \"Prefer RETURNING to EXPORTING\",\r\n shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting\nhttps://docs.abapopenchecks.org/checks/44/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const def of stru.findAllStatements(Statements.MethodDef)) {\r\n if (def.findFirstExpression(Expressions.MethodDefChanging)) {\r\n continue;\r\n }\r\n const exporting = def.findFirstExpression(Expressions.MethodDefExporting);\r\n if (exporting === undefined) {\r\n continue;\r\n }\r\n const returning = def.findFirstExpression(Expressions.MethodDefReturning);\r\n if (returning !== undefined) {\r\n continue;\r\n }\r\n const params = exporting.findDirectExpressions(Expressions.MethodParam);\r\n if (params.length !== 1) {\r\n continue;\r\n }\r\n const concat = params[0].concatTokens().toUpperCase();\r\n if (concat.endsWith(\"TYPE ANY\")\r\n || concat.endsWith(\"TYPE ANY TABLE\")\r\n || concat.endsWith(\"TYPE C\")\r\n || concat.endsWith(\"TYPE CLIKE\")\r\n || concat.endsWith(\"TYPE CSEQUENCE\")\r\n || concat.endsWith(\"TYPE DATA\")\r\n || concat.endsWith(\"TYPE DECFLOAT\")\r\n || concat.endsWith(\"TYPE HASHED TABLE\")\r\n || concat.endsWith(\"TYPE INDEX TABLE\")\r\n || concat.endsWith(\"TYPE N\")\r\n || concat.endsWith(\"TYPE NUMERIC\")\r\n || concat.endsWith(\"TYPE OBJECT\")\r\n || concat.endsWith(\"TYPE P\")\r\n || concat.endsWith(\"TYPE SIMPLE\")\r\n || concat.endsWith(\"TYPE SORTED TABLE\")\r\n || concat.endsWith(\"TYPE STANDARD TABLE\")\r\n || concat.endsWith(\"TYPE TABLE\")\r\n || concat.endsWith(\"TYPE X\")\r\n || concat.endsWith(\"TYPE XSEQUENCE\")) {\r\n continue;\r\n }\r\n const token = params[0].getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, \"Prefer RETURNING to EXPORTING\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferReturningToExporting = PreferReturningToExporting;\r\n//# sourceMappingURL=prefer_returning_to_exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js?");
|
|
12394
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferReturningToExporting = exports.PreferReturningToExportingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass PreferReturningToExportingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferReturningToExportingConf = PreferReturningToExportingConf;\r\nclass PreferReturningToExporting extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferReturningToExportingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_returning_to_exporting\",\r\n title: \"Prefer RETURNING to EXPORTING\",\r\n shortDescription: `Prefer RETURNING to EXPORTING. Generic types cannot be RETURNING.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-returning-to-exporting\r\nhttps://docs.abapopenchecks.org/checks/44/`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const ret = [];\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return [];\r\n }\r\n for (const def of stru.findAllStatements(Statements.MethodDef)) {\r\n if (def.findFirstExpression(Expressions.MethodDefChanging)) {\r\n continue;\r\n }\r\n const exporting = def.findFirstExpression(Expressions.MethodDefExporting);\r\n if (exporting === undefined) {\r\n continue;\r\n }\r\n const returning = def.findFirstExpression(Expressions.MethodDefReturning);\r\n if (returning !== undefined) {\r\n continue;\r\n }\r\n const params = exporting.findDirectExpressions(Expressions.MethodParam);\r\n if (params.length !== 1) {\r\n continue;\r\n }\r\n const concat = params[0].concatTokens().toUpperCase();\r\n if (concat.endsWith(\"TYPE ANY\")\r\n || concat.endsWith(\"TYPE ANY TABLE\")\r\n || concat.endsWith(\"TYPE C\")\r\n || concat.endsWith(\"TYPE CLIKE\")\r\n || concat.endsWith(\"TYPE CSEQUENCE\")\r\n || concat.endsWith(\"TYPE DATA\")\r\n || concat.endsWith(\"TYPE DECFLOAT\")\r\n || concat.endsWith(\"TYPE HASHED TABLE\")\r\n || concat.endsWith(\"TYPE INDEX TABLE\")\r\n || concat.endsWith(\"TYPE N\")\r\n || concat.endsWith(\"TYPE NUMERIC\")\r\n || concat.endsWith(\"TYPE OBJECT\")\r\n || concat.endsWith(\"TYPE P\")\r\n || concat.endsWith(\"TYPE SIMPLE\")\r\n || concat.endsWith(\"TYPE SORTED TABLE\")\r\n || concat.endsWith(\"TYPE STANDARD TABLE\")\r\n || concat.endsWith(\"TYPE TABLE\")\r\n || concat.endsWith(\"TYPE X\")\r\n || concat.endsWith(\"TYPE XSEQUENCE\")) {\r\n continue;\r\n }\r\n const token = params[0].getFirstToken();\r\n const issue = issue_1.Issue.atToken(file, token, \"Prefer RETURNING to EXPORTING\", this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.PreferReturningToExporting = PreferReturningToExporting;\r\n//# sourceMappingURL=prefer_returning_to_exporting.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_returning_to_exporting.js?");
|
|
12362
12395
|
|
|
12363
12396
|
/***/ }),
|
|
12364
12397
|
|
|
@@ -12369,7 +12402,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12369
12402
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12370
12403
|
|
|
12371
12404
|
"use strict";
|
|
12372
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferXsdbool = exports.PreferXsdboolConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferXsdboolConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferXsdboolConf = PreferXsdboolConf;\r\nclass PreferXsdbool extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferXsdboolConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_xsdbool\",\r\n title: \"Prefer xsdbool over boolc\",\r\n shortDescription: `Prefer xsdbool over boolc`,\r\n extendedInformation: `Activates if language version is v740sp08 or above.\n\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA(sdf) = boolc( 1 = 2 ).`,\r\n goodExample: `DATA(sdf) = xsdbool( 1 = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp08 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {\r\n if (s.concatTokens().toUpperCase().startsWith(\"BOOLC( \") === false) {\r\n continue;\r\n }\r\n const token = s.getFirstToken();\r\n const message = \"Prefer xsdbool over boolc\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"xsdbool\");\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferXsdbool = PreferXsdbool;\r\n//# sourceMappingURL=prefer_xsdbool.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js?");
|
|
12405
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.PreferXsdbool = exports.PreferXsdboolConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass PreferXsdboolConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.PreferXsdboolConf = PreferXsdboolConf;\r\nclass PreferXsdbool extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new PreferXsdboolConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"prefer_xsdbool\",\r\n title: \"Prefer xsdbool over boolc\",\r\n shortDescription: `Prefer xsdbool over boolc`,\r\n extendedInformation: `Activates if language version is v740sp08 or above.\r\n\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Upport, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `DATA(sdf) = boolc( 1 = 2 ).`,\r\n goodExample: `DATA(sdf) = xsdbool( 1 = 2 ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a;\r\n const issues = [];\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp08 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const s of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Source)) || []) {\r\n if (s.concatTokens().toUpperCase().startsWith(\"BOOLC( \") === false) {\r\n continue;\r\n }\r\n const token = s.getFirstToken();\r\n const message = \"Prefer xsdbool over boolc\";\r\n const fix = edit_helper_1.EditHelper.replaceToken(file, token, \"xsdbool\");\r\n issues.push(issue_1.Issue.atToken(file, token, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.PreferXsdbool = PreferXsdbool;\r\n//# sourceMappingURL=prefer_xsdbool.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/prefer_xsdbool.js?");
|
|
12373
12406
|
|
|
12374
12407
|
/***/ }),
|
|
12375
12408
|
|
|
@@ -12424,7 +12457,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12424
12457
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12425
12458
|
|
|
12426
12459
|
"use strict";
|
|
12427
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RemoveDescriptions = exports.RemoveDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ \"./node_modules/fast-xml-parser/src/fxp.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nclass RemoveDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = false;\r\n /** Ignore global workflow classes */\r\n this.ignoreWorkflow = true;\r\n }\r\n}\r\nexports.RemoveDescriptionsConf = RemoveDescriptionsConf;\r\nclass RemoveDescriptions {\r\n constructor() {\r\n this.conf = new RemoveDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"remove_descriptions\",\r\n title: \"Remove descriptions\",\r\n shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.\n\nClass descriptions are required, see rule description_empty.\n\nConsider using ABAP Doc for documentation.`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n // plan is omitting knowledge about descriptions in abaplint, so this rule must parse the XML\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof Objects.Class) {\r\n let def;\r\n try {\r\n def = obj.getClassDefinition();\r\n }\r\n catch (_a) {\r\n return [];\r\n }\r\n if (def === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(def, obj)) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreWorkflow === true && def.interfaces.find(e => e.name.toUpperCase() === \"IF_WORKFLOW\")) {\r\n return [];\r\n }\r\n return this.checkClass(obj);\r\n }\r\n else if (obj instanceof Objects.Interface) {\r\n return this.checkInterface(obj);\r\n }\r\n return [];\r\n }\r\n //////////////\r\n checkInterface(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkClass(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkXML(xml, file) {\r\n const parsed = new fast_xml_parser_1.XMLParser({ parseTagValue: false, ignoreAttributes: true, trimValues: false }).parse(xml);\r\n if (parsed === undefined || parsed.abapGit[\"asx:abap\"][\"asx:values\"] === undefined) {\r\n return [];\r\n }\r\n const desc = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DESCRIPTIONS;\r\n if (desc === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const d of (0, xml_utils_1.xmlToArray)(desc.SEOCOMPOTX)) {\r\n const message = \"Remove description for \" + d.CMPNAME;\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.RemoveDescriptions = RemoveDescriptions;\r\n//# sourceMappingURL=remove_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js?");
|
|
12460
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RemoveDescriptions = exports.RemoveDescriptionsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst fast_xml_parser_1 = __webpack_require__(/*! fast-xml-parser */ \"./node_modules/fast-xml-parser/src/fxp.js\");\r\nconst Objects = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nconst xml_utils_1 = __webpack_require__(/*! ../xml_utils */ \"./node_modules/@abaplint/core/build/src/xml_utils.js\");\r\nclass RemoveDescriptionsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Ignore global exception classes */\r\n this.ignoreExceptions = false;\r\n /** Ignore global workflow classes */\r\n this.ignoreWorkflow = true;\r\n }\r\n}\r\nexports.RemoveDescriptionsConf = RemoveDescriptionsConf;\r\nclass RemoveDescriptions {\r\n constructor() {\r\n this.conf = new RemoveDescriptionsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"remove_descriptions\",\r\n title: \"Remove descriptions\",\r\n shortDescription: `Ensures you have no descriptions in metadata of methods, parameters, etc.\r\n\r\nClass descriptions are required, see rule description_empty.\r\n\r\nConsider using ABAP Doc for documentation.`,\r\n tags: [],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n // plan is omitting knowledge about descriptions in abaplint, so this rule must parse the XML\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (obj instanceof Objects.Class) {\r\n let def;\r\n try {\r\n def = obj.getClassDefinition();\r\n }\r\n catch (_a) {\r\n return [];\r\n }\r\n if (def === undefined) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreExceptions && ddic.isException(def, obj)) {\r\n return [];\r\n }\r\n else if (this.conf.ignoreWorkflow === true && def.interfaces.find(e => e.name.toUpperCase() === \"IF_WORKFLOW\")) {\r\n return [];\r\n }\r\n return this.checkClass(obj);\r\n }\r\n else if (obj instanceof Objects.Interface) {\r\n return this.checkInterface(obj);\r\n }\r\n return [];\r\n }\r\n //////////////\r\n checkInterface(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkClass(obj) {\r\n const xml = obj.getXML();\r\n if (xml === undefined) {\r\n return [];\r\n }\r\n const file = obj.getXMLFile();\r\n if (file === undefined) {\r\n return [];\r\n }\r\n return this.checkXML(xml, file);\r\n }\r\n checkXML(xml, file) {\r\n const parsed = new fast_xml_parser_1.XMLParser({ parseTagValue: false, ignoreAttributes: true, trimValues: false }).parse(xml);\r\n if (parsed === undefined || parsed.abapGit[\"asx:abap\"][\"asx:values\"] === undefined) {\r\n return [];\r\n }\r\n const desc = parsed.abapGit[\"asx:abap\"][\"asx:values\"].DESCRIPTIONS;\r\n if (desc === undefined) {\r\n return [];\r\n }\r\n const ret = [];\r\n for (const d of (0, xml_utils_1.xmlToArray)(desc.SEOCOMPOTX)) {\r\n const message = \"Remove description for \" + d.CMPNAME;\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(file, position, message, this.getMetadata().key, this.conf.severity);\r\n ret.push(issue);\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.RemoveDescriptions = RemoveDescriptions;\r\n//# sourceMappingURL=remove_descriptions.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/remove_descriptions.js?");
|
|
12428
12461
|
|
|
12429
12462
|
/***/ }),
|
|
12430
12463
|
|
|
@@ -12435,7 +12468,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12435
12468
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12436
12469
|
|
|
12437
12470
|
"use strict";
|
|
12438
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RFCErrorHandling = exports.RFCErrorHandlingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass RFCErrorHandlingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.RFCErrorHandlingConf = RFCErrorHandlingConf;\r\nclass RFCErrorHandling extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new RFCErrorHandlingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"rfc_error_handling\",\r\n title: \"RFC error handling\",\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,\r\n badExample: `\nCALL FUNCTION 'ZRFC'\n DESTINATION lv_rfc.`,\r\n goodExample: `\nCALL FUNCTION 'ZRFC'\n DESTINATION lv_rfc\n EXCEPTIONS\n system_failure = 1 MESSAGE msg\n communication_failure = 2 MESSAGE msg\n resource_failure = 3\n OTHERS = 4.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n for (const stat of file.getStatements()) {\r\n const token = stat.getFirstToken();\r\n if (!(stat.get() instanceof Statements.CallFunction)) {\r\n continue;\r\n }\r\n if (!stat.findFirstExpression(Expressions.Destination)) {\r\n continue;\r\n }\r\n const list = stat.findFirstExpression(Expressions.ParameterListExceptions);\r\n if (list === undefined) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n const parameters = list.findAllExpressions(Expressions.ParameterName);\r\n const names = [];\r\n for (const par of parameters) {\r\n names.push(par.getFirstToken().getStr().toUpperCase());\r\n }\r\n if (names.indexOf(\"SYSTEM_FAILURE\") < 0\r\n || names.indexOf(\"COMMUNICATION_FAILURE\") < 0\r\n || names.indexOf(\"RESOURCE_FAILURE\") < 0) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.RFCErrorHandling = RFCErrorHandling;\r\n//# sourceMappingURL=rfc_error_handling.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js?");
|
|
12471
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.RFCErrorHandling = exports.RFCErrorHandlingConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass RFCErrorHandlingConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.RFCErrorHandlingConf = RFCErrorHandlingConf;\r\nclass RFCErrorHandling extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new RFCErrorHandlingConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"rfc_error_handling\",\r\n title: \"RFC error handling\",\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n shortDescription: `Checks that exceptions 'system_failure' and 'communication_failure' are handled in RFC calls`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abenrfc_exception.htm`,\r\n badExample: `\r\nCALL FUNCTION 'ZRFC'\r\n DESTINATION lv_rfc.`,\r\n goodExample: `\r\nCALL FUNCTION 'ZRFC'\r\n DESTINATION lv_rfc\r\n EXCEPTIONS\r\n system_failure = 1 MESSAGE msg\r\n communication_failure = 2 MESSAGE msg\r\n resource_failure = 3\r\n OTHERS = 4.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"RFC error handling: At least one unhandled exception from SYSTEM_FAILURE, COMMUNICATION_FAILURE, RESOURCE_FAILURE.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const output = [];\r\n for (const stat of file.getStatements()) {\r\n const token = stat.getFirstToken();\r\n if (!(stat.get() instanceof Statements.CallFunction)) {\r\n continue;\r\n }\r\n if (!stat.findFirstExpression(Expressions.Destination)) {\r\n continue;\r\n }\r\n const list = stat.findFirstExpression(Expressions.ParameterListExceptions);\r\n if (list === undefined) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n const parameters = list.findAllExpressions(Expressions.ParameterName);\r\n const names = [];\r\n for (const par of parameters) {\r\n names.push(par.getFirstToken().getStr().toUpperCase());\r\n }\r\n if (names.indexOf(\"SYSTEM_FAILURE\") < 0\r\n || names.indexOf(\"COMMUNICATION_FAILURE\") < 0\r\n || names.indexOf(\"RESOURCE_FAILURE\") < 0) {\r\n const issue = issue_1.Issue.atToken(file, token, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n output.push(issue);\r\n continue;\r\n }\r\n }\r\n return output;\r\n }\r\n}\r\nexports.RFCErrorHandling = RFCErrorHandling;\r\n//# sourceMappingURL=rfc_error_handling.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/rfc_error_handling.js?");
|
|
12439
12472
|
|
|
12440
12473
|
/***/ }),
|
|
12441
12474
|
|
|
@@ -12446,7 +12479,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12446
12479
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12447
12480
|
|
|
12448
12481
|
"use strict";
|
|
12449
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectAddOrderBy = exports.SelectAddOrderByConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass SelectAddOrderByConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SelectAddOrderByConf = SelectAddOrderByConf;\r\nclass SelectAddOrderBy {\r\n constructor() {\r\n this.conf = new SelectAddOrderByConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_add_order_by\",\r\n title: \"SELECT add ORDER BY\",\r\n shortDescription: `SELECTs add ORDER BY clause`,\r\n extendedInformation: `\nThis will make sure that the SELECT statement returns results in the same sequence on different databases\n\nadd ORDER BY PRIMARY KEY if in doubt\n\nIf the target is a sorted/hashed table, no issue is reported`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const c = s.concatTokens();\r\n if (c.startsWith(\"SELECT SINGLE \")) {\r\n continue;\r\n }\r\n // skip COUNT(*)\r\n const list = s.findFirstExpression(Expressions.SQLFieldList);\r\n if ((list === null || list === void 0 ? void 0 : list.getChildren().length) === 1 && ((_a = list.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SQLAggregation) {\r\n continue;\r\n }\r\n else if (s.findFirstExpression(Expressions.SQLOrderBy)) {\r\n continue;\r\n }\r\n if (this.isTargetSortedOrHashed(s, spaghetti, file)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, s, \"Add ORDER BY\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n isTargetSortedOrHashed(s, spaghetti, file) {\r\n var _a, _b;\r\n const target = (_a = s.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);\r\n if (target) {\r\n const start = target.getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n let type = (_b = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _b === void 0 ? void 0 : _b.getType();\r\n const children = target.getChildren();\r\n if (type instanceof basic_1.StructureType && children.length >= 3 && children[1].concatTokens() === \"-\") {\r\n const found = type.getComponentByName(children[2].concatTokens());\r\n if (found === undefined) {\r\n return false;\r\n }\r\n type = found;\r\n }\r\n if (type instanceof basic_1.TableType\r\n && ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.SelectAddOrderBy = SelectAddOrderBy;\r\n//# sourceMappingURL=select_add_order_by.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js?");
|
|
12482
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectAddOrderBy = exports.SelectAddOrderByConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst basic_1 = __webpack_require__(/*! ../abap/types/basic */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/index.js\");\r\nclass SelectAddOrderByConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SelectAddOrderByConf = SelectAddOrderByConf;\r\nclass SelectAddOrderBy {\r\n constructor() {\r\n this.conf = new SelectAddOrderByConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_add_order_by\",\r\n title: \"SELECT add ORDER BY\",\r\n shortDescription: `SELECTs add ORDER BY clause`,\r\n extendedInformation: `\r\nThis will make sure that the SELECT statement returns results in the same sequence on different databases\r\n\r\nadd ORDER BY PRIMARY KEY if in doubt\r\n\r\nIf the target is a sorted/hashed table, no issue is reported`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n var _a;\r\n const issues = [];\r\n if (!(obj instanceof _abap_object_1.ABAPObject) || obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const c = s.concatTokens().toUpperCase();\r\n if (c.startsWith(\"SELECT SINGLE \")) {\r\n continue;\r\n }\r\n // skip COUNT(*)\r\n const list = s.findFirstExpression(Expressions.SQLFieldList);\r\n if ((list === null || list === void 0 ? void 0 : list.getChildren().length) === 1 && ((_a = list.getFirstChild()) === null || _a === void 0 ? void 0 : _a.get()) instanceof Expressions.SQLAggregation) {\r\n continue;\r\n }\r\n else if (s.findFirstExpression(Expressions.SQLOrderBy)) {\r\n continue;\r\n }\r\n if (this.isTargetSortedOrHashed(s, spaghetti, file)) {\r\n continue;\r\n }\r\n issues.push(issue_1.Issue.atStatement(file, s, \"Add ORDER BY\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n isTargetSortedOrHashed(s, spaghetti, file) {\r\n var _a, _b;\r\n const target = (_a = s.findFirstExpression(Expressions.SQLIntoTable)) === null || _a === void 0 ? void 0 : _a.findFirstExpression(Expressions.Target);\r\n if (target) {\r\n const start = target.getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n let type = (_b = scope === null || scope === void 0 ? void 0 : scope.findWriteReference(start)) === null || _b === void 0 ? void 0 : _b.getType();\r\n const children = target.getChildren();\r\n if (type instanceof basic_1.StructureType && children.length >= 3 && children[1].concatTokens() === \"-\") {\r\n const found = type.getComponentByName(children[2].concatTokens());\r\n if (found === undefined) {\r\n return false;\r\n }\r\n type = found;\r\n }\r\n if (type instanceof basic_1.TableType\r\n && ((type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.sorted || (type === null || type === void 0 ? void 0 : type.getAccessType()) === basic_1.TableAccessType.hashed)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.SelectAddOrderBy = SelectAddOrderBy;\r\n//# sourceMappingURL=select_add_order_by.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_add_order_by.js?");
|
|
12450
12483
|
|
|
12451
12484
|
/***/ }),
|
|
12452
12485
|
|
|
@@ -12457,7 +12490,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12457
12490
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12458
12491
|
|
|
12459
12492
|
"use strict";
|
|
12460
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectPerformance = exports.SelectPerformanceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../abap/types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst DEFAULT_COLUMNS = 10;\r\nclass SelectPerformanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects ENDSELECT */\r\n this.endSelect = true;\r\n /** Detects SELECT * */\r\n this.selectStar = true;\r\n /** \"SELECT\" * is considered okay if the table is less than X columns, the table must be known to the linter */\r\n this.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n}\r\nexports.SelectPerformanceConf = SelectPerformanceConf;\r\nclass SelectPerformance {\r\n constructor() {\r\n this.conf = new SelectPerformanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_performance\",\r\n title: \"SELECT performance\",\r\n shortDescription: `Various checks regarding SELECT performance.`,\r\n extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE\n\nSELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n if (this.conf.starOkayIfFewColumns === undefined) {\r\n this.conf.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n if (this.conf.endSelect) {\r\n for (const s of stru.findAllStructures(Structures.Select) || []) {\r\n const select = s.findDirectStatement(Statements.SelectLoop);\r\n if (select === undefined || select.concatTokens().toUpperCase().includes(\"PACKAGE SIZE\")) {\r\n continue;\r\n }\r\n const message = \"Avoid use of ENDSELECT\";\r\n issues.push(issue_1.Issue.atStatement(file, select, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (this.conf.selectStar) {\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const concat = s.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT * \") === false\r\n && concat.startsWith(\"SELECT SINGLE * \") === false) {\r\n continue;\r\n }\r\n else if (concat.includes(\" INTO CORRESPONDING FIELDS OF \")\r\n || concat.includes(\" APPENDING CORRESPONDING FIELDS OF \")) {\r\n continue;\r\n }\r\n const columnCount = this.findNumberOfColumns(s, file, spaghetti);\r\n if (columnCount\r\n && columnCount <= this.getConfig().starOkayIfFewColumns) {\r\n continue;\r\n }\r\n const message = \"Avoid use of SELECT *\";\r\n issues.push(issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findNumberOfColumns(s, file, spaghetti) {\r\n const dbnames = s.findAllExpressions(Expressions.DatabaseTable);\r\n if (dbnames.length === 1) {\r\n const start = dbnames[0].getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n const name = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n const parsed = tabl === null || tabl === void 0 ? void 0 : tabl.parseType(this.reg);\r\n if (parsed instanceof structure_type_1.StructureType) {\r\n return parsed.getComponents().length;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SelectPerformance = SelectPerformance;\r\n//# sourceMappingURL=select_performance.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_performance.js?");
|
|
12493
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SelectPerformance = exports.SelectPerformanceConf = void 0;\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst structure_type_1 = __webpack_require__(/*! ../abap/types/basic/structure_type */ \"./node_modules/@abaplint/core/build/src/abap/types/basic/structure_type.js\");\r\nconst DEFAULT_COLUMNS = 10;\r\nclass SelectPerformanceConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** Detects ENDSELECT */\r\n this.endSelect = true;\r\n /** Detects SELECT * */\r\n this.selectStar = true;\r\n /** \"SELECT\" * is considered okay if the table is less than X columns, the table must be known to the linter */\r\n this.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n}\r\nexports.SelectPerformanceConf = SelectPerformanceConf;\r\nclass SelectPerformance {\r\n constructor() {\r\n this.conf = new SelectPerformanceConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"select_performance\",\r\n title: \"SELECT performance\",\r\n shortDescription: `Various checks regarding SELECT performance.`,\r\n extendedInformation: `ENDSELECT: not reported when the corresponding SELECT has PACKAGE SIZE\r\n\r\nSELECT *: not reported if using INTO/APPENDING CORRESPONDING FIELDS OF`,\r\n tags: [_irule_1.RuleTag.SingleFile, _irule_1.RuleTag.Performance],\r\n };\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n getConfig() {\r\n if (this.conf.starOkayIfFewColumns === undefined) {\r\n this.conf.starOkayIfFewColumns = DEFAULT_COLUMNS;\r\n }\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n const issues = [];\r\n for (const file of obj.getABAPFiles()) {\r\n const stru = file.getStructure();\r\n if (stru === undefined) {\r\n return issues;\r\n }\r\n if (this.conf.endSelect) {\r\n for (const s of stru.findAllStructures(Structures.Select) || []) {\r\n const select = s.findDirectStatement(Statements.SelectLoop);\r\n if (select === undefined || select.concatTokens().toUpperCase().includes(\"PACKAGE SIZE\")) {\r\n continue;\r\n }\r\n const message = \"Avoid use of ENDSELECT\";\r\n issues.push(issue_1.Issue.atStatement(file, select, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n if (this.conf.selectStar) {\r\n const spaghetti = new syntax_1.SyntaxLogic(this.reg, obj).run().spaghetti;\r\n const selects = stru.findAllStatements(Statements.Select);\r\n selects.push(...stru.findAllStatements(Statements.SelectLoop));\r\n for (const s of selects) {\r\n const concat = s.concatTokens().toUpperCase();\r\n if (concat.startsWith(\"SELECT * \") === false\r\n && concat.startsWith(\"SELECT SINGLE * \") === false) {\r\n continue;\r\n }\r\n else if (concat.includes(\" INTO CORRESPONDING FIELDS OF \")\r\n || concat.includes(\" APPENDING CORRESPONDING FIELDS OF \")) {\r\n continue;\r\n }\r\n const columnCount = this.findNumberOfColumns(s, file, spaghetti);\r\n if (columnCount\r\n && columnCount <= this.getConfig().starOkayIfFewColumns) {\r\n continue;\r\n }\r\n const message = \"Avoid use of SELECT *\";\r\n issues.push(issue_1.Issue.atToken(file, s.getFirstToken(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n findNumberOfColumns(s, file, spaghetti) {\r\n const dbnames = s.findAllExpressions(Expressions.DatabaseTable);\r\n if (dbnames.length === 1) {\r\n const start = dbnames[0].getFirstToken().getStart();\r\n const scope = spaghetti.lookupPosition(start, file.getFilename());\r\n const name = scope === null || scope === void 0 ? void 0 : scope.findTableReference(start);\r\n const tabl = this.reg.getObject(\"TABL\", name);\r\n const parsed = tabl === null || tabl === void 0 ? void 0 : tabl.parseType(this.reg);\r\n if (parsed instanceof structure_type_1.StructureType) {\r\n return parsed.getComponents().length;\r\n }\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.SelectPerformance = SelectPerformance;\r\n//# sourceMappingURL=select_performance.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/select_performance.js?");
|
|
12461
12494
|
|
|
12462
12495
|
/***/ }),
|
|
12463
12496
|
|
|
@@ -12501,7 +12534,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12501
12534
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12502
12535
|
|
|
12503
12536
|
"use strict";
|
|
12504
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services:\n\n* Class defined in handler must exist\n* Class must not have any syntax errors\n* Class must implement interface IF_HTTP_EXTENSION`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
|
|
12537
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SICFConsistency = exports.SICFConsistencyConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass SICFConsistencyConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SICFConsistencyConf = SICFConsistencyConf;\r\nclass SICFConsistency {\r\n constructor() {\r\n this.conf = new SICFConsistencyConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sicf_consistency\",\r\n title: \"SICF consistency\",\r\n shortDescription: `Checks the validity of ICF services:\r\n\r\n* Class defined in handler must exist\r\n* Class must not have any syntax errors\r\n* Class must implement interface IF_HTTP_EXTENSION`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n const issues = [];\r\n if (!(obj instanceof objects_1.ICFService)) {\r\n return [];\r\n }\r\n const handlers = obj.getHandlerList();\r\n if (handlers === undefined) {\r\n return [];\r\n }\r\n for (const h of handlers) {\r\n const clas = this.reg.getObject(\"CLAS\", h);\r\n if (clas === undefined) {\r\n const pattern = new RegExp(this.reg.getConfig().getSyntaxSetttings().errorNamespace, \"i\");\r\n if (pattern.test(h) === true) {\r\n const message = \"Handler class \" + h + \" not found\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n continue;\r\n }\r\n const def = clas.getClassDefinition();\r\n if (def === undefined) {\r\n const message = \"Syntax error in class \" + h;\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n const implementing = this.findImplementing(def);\r\n if (implementing.findIndex((i) => { return i.name.toUpperCase() === \"IF_HTTP_EXTENSION\"; }) < 0) {\r\n const message = \"Handler class \" + h + \" must implement IF_HTTP_EXTENSION\";\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], new position_1.Position(1, 1), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n continue;\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////////\r\n findImplementing(def) {\r\n let ret = def.interfaces;\r\n let superName = def.superClassName;\r\n while (superName !== undefined) {\r\n const clas = this.reg.getObject(\"CLAS\", superName);\r\n if (clas === undefined) {\r\n break;\r\n }\r\n const superDef = clas.getClassDefinition();\r\n if (superDef === undefined) {\r\n break;\r\n }\r\n ret = ret.concat(superDef.interfaces);\r\n superName = superDef.superClassName;\r\n }\r\n return ret;\r\n }\r\n}\r\nexports.SICFConsistency = SICFConsistency;\r\n//# sourceMappingURL=sicf_consistency.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sicf_consistency.js?");
|
|
12505
12538
|
|
|
12506
12539
|
/***/ }),
|
|
12507
12540
|
|
|
@@ -12523,7 +12556,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12523
12556
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12524
12557
|
|
|
12525
12558
|
"use strict";
|
|
12526
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeDot = exports.SpaceBeforeDotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass SpaceBeforeDotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.ignoreGlobalDefinition = true;\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.SpaceBeforeDotConf = SpaceBeforeDotConf;\r\nclass SpaceBeforeDot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeDotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_dot\",\r\n title: \"Space before dot\",\r\n shortDescription: `Checks for extra spaces before dots at the ends of statements`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE bar .`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before \\\",\\\" or \\\".\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n let prev = undefined;\r\n let startRow = 0;\r\n if (file.getStructure() === undefined) {\r\n // some parser error exists in file\r\n return [];\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (this.conf.ignoreGlobalDefinition) {\r\n const structure = file.getStructure();\r\n if (obj instanceof objects_1.Class && structure !== undefined) {\r\n const endclass = structure.findFirstStatement(Statements.EndClass);\r\n if (endclass !== undefined) {\r\n startRow = endclass.getFirstToken().getRow();\r\n }\r\n const definition = obj.getClassDefinition();\r\n if (definition !== undefined && this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n else if (obj instanceof objects_1.Interface && structure !== undefined) {\r\n const endinterface = structure.findFirstStatement(Statements.EndInterface);\r\n if (endinterface !== undefined) {\r\n startRow = endinterface.getFirstToken().getRow();\r\n }\r\n }\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getRow() < startRow) {\r\n continue;\r\n }\r\n if (prev !== undefined && t instanceof tokens_1.Punctuation && prev.getCol() + prev.getStr().length < t.getCol()) {\r\n const start = new position_1.Position(t.getStart().getRow(), prev.getEnd().getCol());\r\n const end = new position_1.Position(t.getStart().getRow(), t.getStart().getCol());\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = t;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SpaceBeforeDot = SpaceBeforeDot;\r\n//# sourceMappingURL=space_before_dot.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/space_before_dot.js?");
|
|
12559
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SpaceBeforeDot = exports.SpaceBeforeDotConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst tokens_1 = __webpack_require__(/*! ../abap/1_lexer/tokens */ \"./node_modules/@abaplint/core/build/src/abap/1_lexer/tokens/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst ddic_1 = __webpack_require__(/*! ../ddic */ \"./node_modules/@abaplint/core/build/src/ddic.js\");\r\nclass SpaceBeforeDotConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n this.ignoreGlobalDefinition = true;\r\n this.ignoreExceptions = true;\r\n }\r\n}\r\nexports.SpaceBeforeDotConf = SpaceBeforeDotConf;\r\nclass SpaceBeforeDot extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SpaceBeforeDotConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"space_before_dot\",\r\n title: \"Space before dot\",\r\n shortDescription: `Checks for extra spaces before dots at the ends of statements`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#be-consistent\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#condense-your-code`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `WRITE bar .`,\r\n goodExample: `WRITE bar.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Remove space before \\\",\\\" or \\\".\\\"\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n let prev = undefined;\r\n let startRow = 0;\r\n if (file.getStructure() === undefined) {\r\n // some parser error exists in file\r\n return [];\r\n }\r\n const ddic = new ddic_1.DDIC(this.reg);\r\n if (this.conf.ignoreGlobalDefinition) {\r\n const structure = file.getStructure();\r\n if (obj instanceof objects_1.Class && structure !== undefined) {\r\n const endclass = structure.findFirstStatement(Statements.EndClass);\r\n if (endclass !== undefined) {\r\n startRow = endclass.getFirstToken().getRow();\r\n }\r\n const definition = obj.getClassDefinition();\r\n if (definition !== undefined && this.conf.ignoreExceptions && ddic.isException(definition, obj)) {\r\n return [];\r\n }\r\n }\r\n else if (obj instanceof objects_1.Interface && structure !== undefined) {\r\n const endinterface = structure.findFirstStatement(Statements.EndInterface);\r\n if (endinterface !== undefined) {\r\n startRow = endinterface.getFirstToken().getRow();\r\n }\r\n }\r\n }\r\n for (const t of file.getTokens()) {\r\n if (t.getRow() < startRow) {\r\n continue;\r\n }\r\n if (prev !== undefined && t instanceof tokens_1.Punctuation && prev.getCol() + prev.getStr().length < t.getCol()) {\r\n const start = new position_1.Position(t.getStart().getRow(), prev.getEnd().getCol());\r\n const end = new position_1.Position(t.getStart().getRow(), t.getStart().getCol());\r\n const fix = edit_helper_1.EditHelper.deleteRange(file, start, end);\r\n const issue = issue_1.Issue.atRange(file, start, end, this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n prev = t;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SpaceBeforeDot = SpaceBeforeDot;\r\n//# sourceMappingURL=space_before_dot.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/space_before_dot.js?");
|
|
12527
12560
|
|
|
12528
12561
|
/***/ }),
|
|
12529
12562
|
|
|
@@ -12545,7 +12578,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12545
12578
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12546
12579
|
|
|
12547
12580
|
"use strict";
|
|
12548
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StartAtTab = exports.StartAtTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass StartAtTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.StartAtTabConf = StartAtTabConf;\r\nclass StartAtTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StartAtTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"start_at_tab\",\r\n title: \"Start at tab\",\r\n shortDescription: `Checks that statements start at tabstops.`,\r\n extendedInformation: `Reports max 100 issues per file\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: ` WRITE a.`,\r\n goodExample: ` WRITE a.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Start statement at tab position\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let inType = false;\r\n let previous = undefined;\r\n const raw = file.getRawRows();\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeBegin) {\r\n inType = true;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeEnd) {\r\n inType = false;\r\n }\r\n else if (inType) {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (previous !== undefined && pos.getRow() === previous.getRow()) {\r\n continue;\r\n }\r\n // just skip rows that contains tabs, this will be reported by the contains_tab rule\r\n if ((pos.getCol() - 1) % 2 !== 0 && raw[pos.getRow() - 1].includes(\"\\t\") === false) {\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n if (issues.length >= 100) {\r\n return issues; // only max 100 issues perfile\r\n }\r\n }\r\n previous = pos;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.StartAtTab = StartAtTab;\r\n//# sourceMappingURL=start_at_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/start_at_tab.js?");
|
|
12581
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.StartAtTab = exports.StartAtTabConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass StartAtTabConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.StartAtTabConf = StartAtTabConf;\r\nclass StartAtTab extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new StartAtTabConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"start_at_tab\",\r\n title: \"Start at tab\",\r\n shortDescription: `Checks that statements start at tabstops.`,\r\n extendedInformation: `Reports max 100 issues per file\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#indent-and-snap-to-tab`,\r\n tags: [_irule_1.RuleTag.Whitespace, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: ` WRITE a.`,\r\n goodExample: ` WRITE a.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"Start statement at tab position\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n let inType = false;\r\n let previous = undefined;\r\n const raw = file.getRawRows();\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeBegin) {\r\n inType = true;\r\n }\r\n else if (statement.get() instanceof statements_1.TypeEnd) {\r\n inType = false;\r\n }\r\n else if (inType) {\r\n continue;\r\n }\r\n const pos = statement.getStart();\r\n if (previous !== undefined && pos.getRow() === previous.getRow()) {\r\n continue;\r\n }\r\n // just skip rows that contains tabs, this will be reported by the contains_tab rule\r\n if ((pos.getCol() - 1) % 2 !== 0 && raw[pos.getRow() - 1].includes(\"\\t\") === false) {\r\n const issue = issue_1.Issue.atPosition(file, pos, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n if (issues.length >= 100) {\r\n return issues; // only max 100 issues perfile\r\n }\r\n }\r\n previous = pos;\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.StartAtTab = StartAtTab;\r\n//# sourceMappingURL=start_at_tab.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/start_at_tab.js?");
|
|
12549
12582
|
|
|
12550
12583
|
/***/ }),
|
|
12551
12584
|
|
|
@@ -12578,7 +12611,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12578
12611
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12579
12612
|
|
|
12580
12613
|
"use strict";
|
|
12581
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyModification = exports.SyModificationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SyModificationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SyModificationConf = SyModificationConf;\r\nclass SyModification extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SyModificationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sy_modification\",\r\n title: \"Modification of SY fields\",\r\n shortDescription: `Finds modification of sy fields`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `\nsy-uname = 2.\nsy = sy.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const t of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Target)) || []) {\r\n const firstChild = t.getChildren()[0];\r\n if (firstChild.get() instanceof Expressions.TargetField\r\n && firstChild.getFirstToken().getStr().toUpperCase() === \"SY\") {\r\n const message = \"Modification of SY field\";\r\n const issue = issue_1.Issue.atToken(file, firstChild.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SyModification = SyModification;\r\n//# sourceMappingURL=sy_modification.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sy_modification.js?");
|
|
12614
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.SyModification = exports.SyModificationConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass SyModificationConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.SyModificationConf = SyModificationConf;\r\nclass SyModification extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new SyModificationConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"sy_modification\",\r\n title: \"Modification of SY fields\",\r\n shortDescription: `Finds modification of sy fields`,\r\n extendedInformation: `https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/abensystem_fields.htm`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `\r\nsy-uname = 2.\r\nsy = sy.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n for (const t of ((_a = file.getStructure()) === null || _a === void 0 ? void 0 : _a.findAllExpressions(Expressions.Target)) || []) {\r\n const firstChild = t.getChildren()[0];\r\n if (firstChild.get() instanceof Expressions.TargetField\r\n && firstChild.getFirstToken().getStr().toUpperCase() === \"SY\") {\r\n const message = \"Modification of SY field\";\r\n const issue = issue_1.Issue.atToken(file, firstChild.getFirstToken(), message, this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.SyModification = SyModification;\r\n//# sourceMappingURL=sy_modification.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/sy_modification.js?");
|
|
12582
12615
|
|
|
12583
12616
|
/***/ }),
|
|
12584
12617
|
|
|
@@ -12589,7 +12622,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12589
12622
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12590
12623
|
|
|
12591
12624
|
"use strict";
|
|
12592
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TABLEnhancementCategory = exports.TABLEnhancementCategoryConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass TABLEnhancementCategoryConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.TABLEnhancementCategoryConf = TABLEnhancementCategoryConf;\r\nclass TABLEnhancementCategory {\r\n constructor() {\r\n this.conf = new TABLEnhancementCategoryConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"tabl_enhancement_category\",\r\n title: \"TABL enhancement category must be set\",\r\n shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,\r\n extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.\n\nYou may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,\r\n tags: [],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"TABL enhancement category not classified in \" + name;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Table)) {\r\n return [];\r\n }\r\n if (obj.getEnhancementCategory() === objects_1.EnhancementCategory.NotClassified) {\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, this.getDescription(obj.getName()), this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.TABLEnhancementCategory = TABLEnhancementCategory;\r\n//# sourceMappingURL=tabl_enhancement_category.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js?");
|
|
12625
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.TABLEnhancementCategory = exports.TABLEnhancementCategoryConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nclass TABLEnhancementCategoryConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.TABLEnhancementCategoryConf = TABLEnhancementCategoryConf;\r\nclass TABLEnhancementCategory {\r\n constructor() {\r\n this.conf = new TABLEnhancementCategoryConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"tabl_enhancement_category\",\r\n title: \"TABL enhancement category must be set\",\r\n shortDescription: `Checks that tables do not have the enhancement category 'not classified'.`,\r\n extendedInformation: `SAP note 3063227 changes the default to 'Cannot be enhanced'.\r\n\r\nYou may use standard report RS_DDIC_CLASSIFICATION_FINAL for adjustment.`,\r\n tags: [],\r\n };\r\n }\r\n getDescription(name) {\r\n return \"TABL enhancement category not classified in \" + name;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(_reg) {\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof objects_1.Table)) {\r\n return [];\r\n }\r\n if (obj.getEnhancementCategory() === objects_1.EnhancementCategory.NotClassified) {\r\n const position = new position_1.Position(1, 1);\r\n const issue = issue_1.Issue.atPosition(obj.getFiles()[0], position, this.getDescription(obj.getName()), this.getMetadata().key, this.conf.severity);\r\n return [issue];\r\n }\r\n return [];\r\n }\r\n}\r\nexports.TABLEnhancementCategory = TABLEnhancementCategory;\r\n//# sourceMappingURL=tabl_enhancement_category.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/tabl_enhancement_category.js?");
|
|
12593
12626
|
|
|
12594
12627
|
/***/ }),
|
|
12595
12628
|
|
|
@@ -12699,7 +12732,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12699
12732
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12700
12733
|
|
|
12701
12734
|
"use strict";
|
|
12702
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedMethods = exports.UnusedMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnusedMethodsConf = UnusedMethodsConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.list = [];\r\n this.list = [];\r\n }\r\n push(id) {\r\n this.list.push(id);\r\n }\r\n removeIfExists(id) {\r\n for (let i = 0; i < this.list.length; i++) {\r\n if (id.equals(this.list[i].identifier)) {\r\n this.list.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n containsProteted() {\r\n for (const m of this.list) {\r\n if (m.visibility === visibility_1.Visibility.Protected) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getLength() {\r\n return this.list.length;\r\n }\r\n get() {\r\n return this.list;\r\n }\r\n}\r\n// todo: add possibility to also search public methods\r\n// todo: for protected methods, also search subclasses\r\nclass UnusedMethods {\r\n constructor() {\r\n this.conf = new UnusedMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_methods\",\r\n title: \"Unused methods\",\r\n shortDescription: `Checks for unused methods`,\r\n extendedInformation: `Checks private and protected methods.\n\nSkips:\n* methods FOR TESTING\n* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses\n* class_constructor + constructor methods\n* event handlers\n* methods that are redefined\n* INCLUDEs\n`,\r\n tags: [],\r\n pragma: \"##CALLED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n // dont report anything when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.wa = new WorkArea();\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n for (const method of def.methods) {\r\n if (method.isForTesting === true\r\n || method.isRedefinition === true\r\n || method.isEventHandler === true) {\r\n continue;\r\n }\r\n else if (def.isForTesting === true\r\n && (method.name.toUpperCase() === \"SETUP\"\r\n || method.name.toUpperCase() === \"CLASS_SETUP\"\r\n || method.name.toUpperCase() === \"TEARDOWN\"\r\n || method.name.toUpperCase() === \"CLASS_TEARDOWN\")) {\r\n continue;\r\n }\r\n else if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n || method.name.toUpperCase() === \"CLASS_CONSTRUCTOR\") {\r\n continue;\r\n }\r\n if (method.visibility === visibility_1.Visibility.Private\r\n || method.visibility === visibility_1.Visibility.Protected) {\r\n this.wa.push(method);\r\n }\r\n }\r\n }\r\n }\r\n this.traverse(syntax.spaghetti.getTop());\r\n this.searchGlobalSubclasses(obj);\r\n const issues = [];\r\n for (const i of this.wa.get()) {\r\n const file = obj.getABAPFileByName(i.identifier.getFilename());\r\n if (file === undefined) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(i.identifier.getToken(), file);\r\n if (statement === undefined) {\r\n continue;\r\n }\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n const message = \"Method \\\"\" + i.identifier.getName() + \"\\\" not used\";\r\n issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n searchGlobalSubclasses(obj) {\r\n var _a, _b;\r\n if (this.wa.getLength() === 0\r\n || !(obj instanceof objects_1.Class)\r\n || this.wa.containsProteted() === false) {\r\n return;\r\n }\r\n const sup = obj.getDefinition();\r\n if (sup === undefined) {\r\n return;\r\n }\r\n for (const r of this.reg.getObjects()) {\r\n if (r instanceof objects_1.Class\r\n && ((_b = (_a = r.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === sup.getName().toUpperCase()) {\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, r).run();\r\n this.traverse(syntax.spaghetti.getTop());\r\n // recurse to sub-sub-* classes\r\n this.searchGlobalSubclasses(r);\r\n }\r\n }\r\n }\r\n traverse(node) {\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n this.checkNode(node);\r\n }\r\n for (const c of node.getChildren()) {\r\n this.traverse(c);\r\n }\r\n }\r\n checkNode(node) {\r\n for (const v of node.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.MethodReference && v.resolved) {\r\n this.wa.removeIfExists(v.resolved);\r\n }\r\n }\r\n }\r\n}\r\nexports.UnusedMethods = UnusedMethods;\r\n//# sourceMappingURL=unused_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_methods.js?");
|
|
12735
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedMethods = exports.UnusedMethodsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nconst visibility_1 = __webpack_require__(/*! ../abap/4_file_information/visibility */ \"./node_modules/@abaplint/core/build/src/abap/4_file_information/visibility.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UnusedMethodsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UnusedMethodsConf = UnusedMethodsConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.list = [];\r\n this.list = [];\r\n }\r\n push(id) {\r\n this.list.push(id);\r\n }\r\n removeIfExists(id) {\r\n for (let i = 0; i < this.list.length; i++) {\r\n if (id.equals(this.list[i].identifier)) {\r\n this.list.splice(i, 1);\r\n return;\r\n }\r\n }\r\n }\r\n containsProteted() {\r\n for (const m of this.list) {\r\n if (m.visibility === visibility_1.Visibility.Protected) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n getLength() {\r\n return this.list.length;\r\n }\r\n get() {\r\n return this.list;\r\n }\r\n}\r\n// todo: add possibility to also search public methods\r\n// todo: for protected methods, also search subclasses\r\nclass UnusedMethods {\r\n constructor() {\r\n this.conf = new UnusedMethodsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_methods\",\r\n title: \"Unused methods\",\r\n shortDescription: `Checks for unused methods`,\r\n extendedInformation: `Checks private and protected methods.\r\n\r\nSkips:\r\n* methods FOR TESTING\r\n* methods SETUP + TEARDOWN + CLASS_SETUP + CLASS_TEARDOWN in testclasses\r\n* class_constructor + constructor methods\r\n* event handlers\r\n* methods that are redefined\r\n* INCLUDEs\r\n`,\r\n tags: [],\r\n pragma: \"##CALLED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Program && obj.isInclude() === true) {\r\n return [];\r\n }\r\n // dont report anything when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.wa = new WorkArea();\r\n for (const file of obj.getABAPFiles()) {\r\n for (const def of file.getInfo().listClassDefinitions()) {\r\n for (const method of def.methods) {\r\n if (method.isForTesting === true\r\n || method.isRedefinition === true\r\n || method.isEventHandler === true) {\r\n continue;\r\n }\r\n else if (def.isForTesting === true\r\n && (method.name.toUpperCase() === \"SETUP\"\r\n || method.name.toUpperCase() === \"CLASS_SETUP\"\r\n || method.name.toUpperCase() === \"TEARDOWN\"\r\n || method.name.toUpperCase() === \"CLASS_TEARDOWN\")) {\r\n continue;\r\n }\r\n else if (method.name.toUpperCase() === \"CONSTRUCTOR\"\r\n || method.name.toUpperCase() === \"CLASS_CONSTRUCTOR\") {\r\n continue;\r\n }\r\n if (method.visibility === visibility_1.Visibility.Private\r\n || method.visibility === visibility_1.Visibility.Protected) {\r\n this.wa.push(method);\r\n }\r\n }\r\n }\r\n }\r\n this.traverse(syntax.spaghetti.getTop());\r\n this.searchGlobalSubclasses(obj);\r\n const issues = [];\r\n for (const i of this.wa.get()) {\r\n const file = obj.getABAPFileByName(i.identifier.getFilename());\r\n if (file === undefined) {\r\n continue;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(i.identifier.getToken(), file);\r\n if (statement === undefined) {\r\n continue;\r\n }\r\n if (statement.getPragmas().some(t => t.getStr() === this.getMetadata().pragma)) {\r\n continue;\r\n }\r\n const message = \"Method \\\"\" + i.identifier.getName() + \"\\\" not used\";\r\n issues.push(issue_1.Issue.atIdentifier(i.identifier, message, this.getMetadata().key, this.conf.severity));\r\n }\r\n return issues;\r\n }\r\n searchGlobalSubclasses(obj) {\r\n var _a, _b;\r\n if (this.wa.getLength() === 0\r\n || !(obj instanceof objects_1.Class)\r\n || this.wa.containsProteted() === false) {\r\n return;\r\n }\r\n const sup = obj.getDefinition();\r\n if (sup === undefined) {\r\n return;\r\n }\r\n for (const r of this.reg.getObjects()) {\r\n if (r instanceof objects_1.Class\r\n && ((_b = (_a = r.getDefinition()) === null || _a === void 0 ? void 0 : _a.getSuperClass()) === null || _b === void 0 ? void 0 : _b.toUpperCase()) === sup.getName().toUpperCase()) {\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, r).run();\r\n this.traverse(syntax.spaghetti.getTop());\r\n // recurse to sub-sub-* classes\r\n this.searchGlobalSubclasses(r);\r\n }\r\n }\r\n }\r\n traverse(node) {\r\n if (node.getIdentifier().stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n this.checkNode(node);\r\n }\r\n for (const c of node.getChildren()) {\r\n this.traverse(c);\r\n }\r\n }\r\n checkNode(node) {\r\n for (const v of node.getData().references) {\r\n if (v.referenceType === _reference_1.ReferenceType.MethodReference && v.resolved) {\r\n this.wa.removeIfExists(v.resolved);\r\n }\r\n }\r\n }\r\n}\r\nexports.UnusedMethods = UnusedMethods;\r\n//# sourceMappingURL=unused_methods.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_methods.js?");
|
|
12703
12736
|
|
|
12704
12737
|
/***/ }),
|
|
12705
12738
|
|
|
@@ -12721,7 +12754,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12721
12754
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12722
12755
|
|
|
12723
12756
|
"use strict";
|
|
12724
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\n\nSkips event parameters.\n\nNote that this currently does not work if the source code uses macros.\n\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n var _a;\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.length) > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"event_parameter\" /* EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
12757
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UnusedVariables = exports.UnusedVariablesConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst syntax_1 = __webpack_require__(/*! ../abap/5_syntax/syntax */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/syntax.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst _scope_type_1 = __webpack_require__(/*! ../abap/5_syntax/_scope_type */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_scope_type.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nconst _reference_1 = __webpack_require__(/*! ../abap/5_syntax/_reference */ \"./node_modules/@abaplint/core/build/src/abap/5_syntax/_reference.js\");\r\nclass UnusedVariablesConf extends _basic_rule_config_1.BasicRuleConfig {\r\n constructor() {\r\n super(...arguments);\r\n /** skip specific names, case insensitive\r\n * @uniqueItems true\r\n */\r\n this.skipNames = [];\r\n }\r\n}\r\nexports.UnusedVariablesConf = UnusedVariablesConf;\r\nclass WorkArea {\r\n constructor() {\r\n this.workarea = [];\r\n }\r\n push(id, count = 1) {\r\n for (const w of this.workarea) {\r\n if (id.equals(w.id)) {\r\n return;\r\n }\r\n }\r\n this.workarea.push({ id, count });\r\n }\r\n removeIfExists(id) {\r\n if (id === undefined) {\r\n return;\r\n }\r\n for (let i = 0; i < this.workarea.length; i++) {\r\n if (id.equals(this.workarea[i].id)) {\r\n this.workarea[i].count--;\r\n if (this.workarea[i].count === 0) {\r\n this.workarea.splice(i, 1);\r\n }\r\n return;\r\n }\r\n }\r\n }\r\n get() {\r\n return this.workarea;\r\n }\r\n count() {\r\n return this.workarea.length;\r\n }\r\n}\r\nclass UnusedVariables {\r\n constructor() {\r\n this.conf = new UnusedVariablesConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"unused_variables\",\r\n title: \"Unused variables\",\r\n shortDescription: `Checks for unused variables and constants`,\r\n extendedInformation: `WARNING: slow\r\n\r\nSkips event parameters.\r\n\r\nNote that this currently does not work if the source code uses macros.\r\n\r\nUnused variables are not reported if the object contains syntax errors. Errors found in INCLUDES are reported for the main program.`,\r\n tags: [_irule_1.RuleTag.Quickfix],\r\n pragma: \"##NEEDED\",\r\n pseudoComment: \"EC NEEDED\",\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n if (this.conf.skipNames === undefined) {\r\n this.conf.skipNames = [];\r\n }\r\n }\r\n initialize(reg) {\r\n this.reg = reg;\r\n return this;\r\n }\r\n run(obj) {\r\n if (!(obj instanceof _abap_object_1.ABAPObject)) {\r\n return [];\r\n }\r\n else if (obj instanceof objects_1.Interface) { // todo, how to handle interfaces?\r\n return [];\r\n }\r\n // dont report unused variables when there are syntax errors\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, obj).run();\r\n if (syntax.issues.length > 0) {\r\n return [];\r\n }\r\n this.workarea = new WorkArea();\r\n const top = syntax.spaghetti.getTop();\r\n this.buildWorkarea(top, obj);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n this.findUses(top, obj);\r\n for (const o of this.reg.getObjects()) {\r\n if (o === obj) {\r\n continue;\r\n }\r\n else if (o instanceof _abap_object_1.ABAPObject) {\r\n if (this.reg.isDependency(o)) {\r\n continue; // do not search in dependencies\r\n }\r\n const syntax = new syntax_1.SyntaxLogic(this.reg, o).run();\r\n this.findUses(syntax.spaghetti.getTop(), o);\r\n if (this.workarea.count() === 0) {\r\n return this.buildIssues(obj); // exit early if all types are used\r\n }\r\n }\r\n }\r\n return this.buildIssues(obj);\r\n }\r\n findUses(node, obj) {\r\n for (const r of node.getData().references) {\r\n if (r.referenceType === _reference_1.ReferenceType.DataReadReference\r\n || r.referenceType === _reference_1.ReferenceType.DataWriteReference\r\n || r.referenceType === _reference_1.ReferenceType.TypeReference) {\r\n this.workarea.removeIfExists(r.resolved);\r\n }\r\n }\r\n for (const c of node.getChildren()) {\r\n this.findUses(c, obj);\r\n }\r\n }\r\n buildWorkarea(node, obj) {\r\n var _a;\r\n const stype = node.getIdentifier().stype;\r\n if (stype === _scope_type_1.ScopeType.OpenSQL) {\r\n return;\r\n }\r\n for (const c of node.getChildren()) {\r\n this.buildWorkarea(c, obj);\r\n }\r\n if (stype !== _scope_type_1.ScopeType.BuiltIn) {\r\n const vars = node.getData().vars;\r\n for (const name in vars) {\r\n const meta = vars[name].getMeta();\r\n if (((_a = this.conf.skipNames) === null || _a === void 0 ? void 0 : _a.length) > 0\r\n && this.conf.skipNames.some((a) => a.toUpperCase() === name)) {\r\n continue;\r\n }\r\n else if (name === \"ME\"\r\n || name === \"SUPER\"\r\n || meta.includes(\"event_parameter\" /* EventParameter */)) {\r\n // todo, workaround for \"me\" and \"super\", these should somehow be typed to built-in\r\n continue;\r\n }\r\n const isInline = meta.includes(\"inline\" /* InlineDefinition */);\r\n this.workarea.push(vars[name], isInline ? 2 : 1);\r\n }\r\n }\r\n }\r\n buildIssues(obj) {\r\n const ret = [];\r\n for (const w of this.workarea.get()) {\r\n const filename = w.id.getFilename();\r\n if (this.reg.isFileDependency(filename) === true) {\r\n continue;\r\n }\r\n else if (obj instanceof objects_1.Program === false && obj.containsFile(filename) === false) {\r\n continue;\r\n }\r\n const statement = this.findStatement(w.id);\r\n if (statement === null || statement === void 0 ? void 0 : statement.getPragmas().map(t => t.getStr()).includes(this.getMetadata().pragma + \"\")) {\r\n continue;\r\n }\r\n else if (this.suppressedbyPseudo(statement, w.id, obj)) {\r\n continue;\r\n }\r\n const name = w.id.getName();\r\n const message = \"Variable \\\"\" + name.toLowerCase() + \"\\\" not used\";\r\n const fix = this.buildFix(w.id, obj);\r\n ret.push(issue_1.Issue.atIdentifier(w.id, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n return ret;\r\n }\r\n suppressedbyPseudo(statement, v, obj) {\r\n if (statement === undefined) {\r\n return false;\r\n }\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return false;\r\n }\r\n let next = false;\r\n for (const s of file.getStatements()) {\r\n if (next === true && s.get() instanceof _statement_1.Comment) {\r\n return s.concatTokens().includes(this.getMetadata().pseudoComment + \"\");\r\n }\r\n if (s === statement) {\r\n next = true;\r\n }\r\n }\r\n return false;\r\n }\r\n findStatement(v) {\r\n const file = this.reg.getFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const object = this.reg.findObjectForFile(file);\r\n if (!(object instanceof _abap_object_1.ABAPObject)) {\r\n return undefined;\r\n }\r\n const abapfile = object.getABAPFileByName(v.getFilename());\r\n if (abapfile === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), abapfile);\r\n return statement;\r\n }\r\n buildFix(v, obj) {\r\n const file = obj.getABAPFileByName(v.getFilename());\r\n if (file === undefined) {\r\n return undefined;\r\n }\r\n const statement = edit_helper_1.EditHelper.findStatement(v.getToken(), file);\r\n if (statement === undefined) {\r\n return undefined;\r\n }\r\n else if (statement.get() instanceof Statements.Data) {\r\n return edit_helper_1.EditHelper.deleteStatement(file, statement);\r\n }\r\n return undefined;\r\n }\r\n}\r\nexports.UnusedVariables = UnusedVariables;\r\n//# sourceMappingURL=unused_variables.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/unused_variables.js?");
|
|
12725
12758
|
|
|
12726
12759
|
/***/ }),
|
|
12727
12760
|
|
|
@@ -12732,7 +12765,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12732
12765
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12733
12766
|
|
|
12734
12767
|
"use strict";
|
|
12735
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseBoolExpression = exports.UseBoolExpressionConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// note this rule assumes abap_true and abap_false is used for boolean variables\r\n// some other rule will in the future find assignments to abap_bool that are not abap_true/abap_false/abap_undefined\r\nclass UseBoolExpressionConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseBoolExpressionConf = UseBoolExpressionConf;\r\nclass UseBoolExpression extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseBoolExpressionConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_bool_expression\",\r\n title: \"Use boolean expression\",\r\n shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF line IS INITIAL.\n has_entries = abap_false.\nELSE.\n has_entries = abap_true.\nENDIF.\n\nDATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,\r\n goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).\n\nDATA(fsdf) = xsdbool( foo <> bar ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n const version = this.reg.getConfig().getVersion();\r\n if (stru === undefined || (version < version_1.Version.v702 && version !== version_1.Version.Cloud)) {\r\n return [];\r\n }\r\n for (const i of stru.findAllStructures(Structures.If)) {\r\n if (i.findDirectStructure(Structures.ElseIf) !== undefined) {\r\n continue;\r\n }\r\n const bodyNodes = (_a = i.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.findAllStatementNodes();\r\n if (bodyNodes === undefined || bodyNodes.length !== 1) {\r\n continue;\r\n }\r\n const bodyStatement = bodyNodes[0];\r\n if (!(bodyStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n const elseNodes = (_c = (_b = i.findDirectStructure(Structures.Else)) === null || _b === void 0 ? void 0 : _b.findDirectStructure(Structures.Body)) === null || _c === void 0 ? void 0 : _c.findAllStatementNodes();\r\n if (elseNodes === undefined || elseNodes.length !== 1) {\r\n continue;\r\n }\r\n const elseStatement = elseNodes[0];\r\n if (!(elseStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n let bodyTarget = (_d = bodyStatement.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n if (bodyTarget === null || bodyTarget === void 0 ? void 0 : bodyTarget.startsWith(\"DATA(\")) {\r\n bodyTarget = bodyTarget.substr(5, bodyTarget.length - 6);\r\n }\r\n const elseTarget = (_e = elseStatement.findFirstExpression(Expressions.Target)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (bodyTarget === undefined\r\n || elseTarget === undefined\r\n || bodyTarget.toUpperCase() !== elseTarget.toUpperCase()) {\r\n continue;\r\n }\r\n const bodySource = (_f = bodyStatement.findFirstExpression(Expressions.Source)) === null || _f === void 0 ? void 0 : _f.concatTokens().toUpperCase();\r\n const elseSource = (_g = elseStatement.findFirstExpression(Expressions.Source)) === null || _g === void 0 ? void 0 : _g.concatTokens().toUpperCase();\r\n if ((bodySource === \"ABAP_TRUE\" && elseSource === \"ABAP_FALSE\")\r\n || (bodySource === \"ABAP_FALSE\" && elseSource === \"ABAP_TRUE\")) {\r\n const func = (this.reg.getConfig().getVersion() >= version_1.Version.v740sp08\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud) ? \"xsdbool\" : \"boolc\";\r\n const negate = bodySource === \"ABAP_FALSE\";\r\n const message = `Use ${func} instead of IF` + (negate ? \", negate expression\" : \"\");\r\n const start = i.getFirstToken().getStart();\r\n const end = i.getLastToken().getEnd();\r\n const statement = bodyTarget + \" = \" + func + \"( \" +\r\n (negate ? \"NOT ( \" : \"\") +\r\n ((_j = (_h = i.findFirstStatement(Statements.If)) === null || _h === void 0 ? void 0 : _h.findFirstExpression(Expressions.Cond)) === null || _j === void 0 ? void 0 : _j.concatTokens()) +\r\n (negate ? \" )\" : \"\") +\r\n \" ).\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, start, end, statement);\r\n issues.push(issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n if (version >= version_1.Version.v740sp08 || version === version_1.Version.Cloud) {\r\n for (const b of stru.findAllExpressions(Expressions.CondBody)) {\r\n const concat = b.concatTokens().toUpperCase();\r\n if (concat.endsWith(\" THEN ABAP_TRUE ELSE ABAP_FALSE\")\r\n || concat.endsWith(\" THEN ABAP_TRUE\")\r\n || concat.endsWith(\" THEN ABAP_FALSE ELSE ABAP_TRUE\")) {\r\n const message = \"Use xsdbool\";\r\n // eslint-disable-next-line max-len\r\n issues.push(issue_1.Issue.atRange(file, b.getFirstToken().getStart(), b.getLastToken().getEnd(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UseBoolExpression = UseBoolExpression;\r\n//# sourceMappingURL=use_bool_expression.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js?");
|
|
12768
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseBoolExpression = exports.UseBoolExpressionConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\n// note this rule assumes abap_true and abap_false is used for boolean variables\r\n// some other rule will in the future find assignments to abap_bool that are not abap_true/abap_false/abap_undefined\r\nclass UseBoolExpressionConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseBoolExpressionConf = UseBoolExpressionConf;\r\nclass UseBoolExpression extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseBoolExpressionConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_bool_expression\",\r\n title: \"Use boolean expression\",\r\n shortDescription: `Use boolean expression, xsdbool from 740sp08 and up, boolc from 702 and up`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#use-xsdbool-to-set-boolean-variables`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n badExample: `IF line IS INITIAL.\r\n has_entries = abap_false.\r\nELSE.\r\n has_entries = abap_true.\r\nENDIF.\r\n\r\nDATA(fsdf) = COND #( WHEN foo <> bar THEN abap_true ELSE abap_false ).`,\r\n goodExample: `DATA(has_entries) = xsdbool( line IS NOT INITIAL ).\r\n\r\nDATA(fsdf) = xsdbool( foo <> bar ).`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file) {\r\n var _a, _b, _c, _d, _e, _f, _g, _h, _j;\r\n const issues = [];\r\n const stru = file.getStructure();\r\n const version = this.reg.getConfig().getVersion();\r\n if (stru === undefined || (version < version_1.Version.v702 && version !== version_1.Version.Cloud)) {\r\n return [];\r\n }\r\n for (const i of stru.findAllStructures(Structures.If)) {\r\n if (i.findDirectStructure(Structures.ElseIf) !== undefined) {\r\n continue;\r\n }\r\n const bodyNodes = (_a = i.findDirectStructure(Structures.Body)) === null || _a === void 0 ? void 0 : _a.findAllStatementNodes();\r\n if (bodyNodes === undefined || bodyNodes.length !== 1) {\r\n continue;\r\n }\r\n const bodyStatement = bodyNodes[0];\r\n if (!(bodyStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n const elseNodes = (_c = (_b = i.findDirectStructure(Structures.Else)) === null || _b === void 0 ? void 0 : _b.findDirectStructure(Structures.Body)) === null || _c === void 0 ? void 0 : _c.findAllStatementNodes();\r\n if (elseNodes === undefined || elseNodes.length !== 1) {\r\n continue;\r\n }\r\n const elseStatement = elseNodes[0];\r\n if (!(elseStatement.get() instanceof Statements.Move)) {\r\n continue;\r\n }\r\n let bodyTarget = (_d = bodyStatement.findFirstExpression(Expressions.Target)) === null || _d === void 0 ? void 0 : _d.concatTokens();\r\n if (bodyTarget === null || bodyTarget === void 0 ? void 0 : bodyTarget.startsWith(\"DATA(\")) {\r\n bodyTarget = bodyTarget.substr(5, bodyTarget.length - 6);\r\n }\r\n const elseTarget = (_e = elseStatement.findFirstExpression(Expressions.Target)) === null || _e === void 0 ? void 0 : _e.concatTokens();\r\n if (bodyTarget === undefined\r\n || elseTarget === undefined\r\n || bodyTarget.toUpperCase() !== elseTarget.toUpperCase()) {\r\n continue;\r\n }\r\n const bodySource = (_f = bodyStatement.findFirstExpression(Expressions.Source)) === null || _f === void 0 ? void 0 : _f.concatTokens().toUpperCase();\r\n const elseSource = (_g = elseStatement.findFirstExpression(Expressions.Source)) === null || _g === void 0 ? void 0 : _g.concatTokens().toUpperCase();\r\n if ((bodySource === \"ABAP_TRUE\" && elseSource === \"ABAP_FALSE\")\r\n || (bodySource === \"ABAP_FALSE\" && elseSource === \"ABAP_TRUE\")) {\r\n const func = (this.reg.getConfig().getVersion() >= version_1.Version.v740sp08\r\n || this.reg.getConfig().getVersion() === version_1.Version.Cloud) ? \"xsdbool\" : \"boolc\";\r\n const negate = bodySource === \"ABAP_FALSE\";\r\n const message = `Use ${func} instead of IF` + (negate ? \", negate expression\" : \"\");\r\n const start = i.getFirstToken().getStart();\r\n const end = i.getLastToken().getEnd();\r\n const statement = bodyTarget + \" = \" + func + \"( \" +\r\n (negate ? \"NOT ( \" : \"\") +\r\n ((_j = (_h = i.findFirstStatement(Statements.If)) === null || _h === void 0 ? void 0 : _h.findFirstExpression(Expressions.Cond)) === null || _j === void 0 ? void 0 : _j.concatTokens()) +\r\n (negate ? \" )\" : \"\") +\r\n \" ).\";\r\n const fix = edit_helper_1.EditHelper.replaceRange(file, start, end, statement);\r\n issues.push(issue_1.Issue.atRange(file, start, end, message, this.getMetadata().key, this.conf.severity, fix));\r\n }\r\n }\r\n if (version >= version_1.Version.v740sp08 || version === version_1.Version.Cloud) {\r\n for (const b of stru.findAllExpressions(Expressions.CondBody)) {\r\n const concat = b.concatTokens().toUpperCase();\r\n if (concat.endsWith(\" THEN ABAP_TRUE ELSE ABAP_FALSE\")\r\n || concat.endsWith(\" THEN ABAP_TRUE\")\r\n || concat.endsWith(\" THEN ABAP_FALSE ELSE ABAP_TRUE\")) {\r\n const message = \"Use xsdbool\";\r\n // eslint-disable-next-line max-len\r\n issues.push(issue_1.Issue.atRange(file, b.getFirstToken().getStart(), b.getLastToken().getEnd(), message, this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n}\r\nexports.UseBoolExpression = UseBoolExpression;\r\n//# sourceMappingURL=use_bool_expression.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_bool_expression.js?");
|
|
12736
12769
|
|
|
12737
12770
|
/***/ }),
|
|
12738
12771
|
|
|
@@ -12754,7 +12787,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12754
12787
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12755
12788
|
|
|
12756
12789
|
"use strict";
|
|
12757
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseLineExists = exports.UseLineExistsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UseLineExistsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseLineExistsConf = UseLineExistsConf;\r\nclass UseLineExists extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseLineExistsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_line_exists\",\r\n title: \"Use line_exists\",\r\n shortDescription: `Use line_exists, from 740sp02 and up`,\r\n extendedInformation: `\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at\n\nNot reported if the READ TABLE statement contains BINARY SEARCH.`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.\nIF sy-subrc = 0.\nENDIF.`,\r\n goodExample: `IF line_exists( my_table[ key = 'A' ] ).\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const vers = this.reg.getConfig().getVersion();\r\n if (vers === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n else if (vers < version_1.Version.v740sp02 && vers !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (!(statement.get() instanceof Statements.ReadTable)) {\r\n continue;\r\n }\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" TRANSPORTING NO FIELDS\") === true\r\n && concat.includes(\" BINARY SEARCH\") === false\r\n && this.checksSubrc(i, statements) === true\r\n && this.usesTabix(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, \"Use line_exists\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////\r\n checksSubrc(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n for (const c of statement.findAllExpressions(Expressions.Cond)) {\r\n for (const s of c.findAllExpressions(Expressions.Source)) {\r\n if (s.concatTokens().toUpperCase() === \"SY-SUBRC\") {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n // this is a heuristic, data flow analysis is required to get the correct result\r\n usesTabix(index, statements) {\r\n for (let i = index + 1; i < index + 5; i++) {\r\n const statement = statements[i];\r\n if (statement === undefined) {\r\n break;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.concatTokens().toUpperCase().includes(\" SY-TABIX\")) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UseLineExists = UseLineExists;\r\n//# sourceMappingURL=use_line_exists.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_line_exists.js?");
|
|
12790
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseLineExists = exports.UseLineExistsConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst _statement_1 = __webpack_require__(/*! ../abap/2_statements/statements/_statement */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/_statement.js\");\r\nclass UseLineExistsConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseLineExistsConf = UseLineExistsConf;\r\nclass UseLineExists extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseLineExistsConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_line_exists\",\r\n title: \"Use line_exists\",\r\n shortDescription: `Use line_exists, from 740sp02 and up`,\r\n extendedInformation: `\r\nhttps://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-line_exists-to-read-table-or-loop-at\r\n\r\nNot reported if the READ TABLE statement contains BINARY SEARCH.`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.SingleFile],\r\n badExample: `READ TABLE my_table TRANSPORTING NO FIELDS WITH KEY key = 'A'.\r\nIF sy-subrc = 0.\r\nENDIF.`,\r\n goodExample: `IF line_exists( my_table[ key = 'A' ] ).\r\nENDIF.`,\r\n };\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n const vers = this.reg.getConfig().getVersion();\r\n if (vers === version_1.Version.OpenABAP) {\r\n return [];\r\n }\r\n else if (vers < version_1.Version.v740sp02 && vers !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n const statements = file.getStatements();\r\n for (let i = 0; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (!(statement.get() instanceof Statements.ReadTable)) {\r\n continue;\r\n }\r\n const concat = statement.concatTokens().toUpperCase();\r\n if (concat.includes(\" TRANSPORTING NO FIELDS\") === true\r\n && concat.includes(\" BINARY SEARCH\") === false\r\n && this.checksSubrc(i, statements) === true\r\n && this.usesTabix(i, statements) === false) {\r\n issues.push(issue_1.Issue.atStatement(file, statement, \"Use line_exists\", this.getMetadata().key, this.conf.severity));\r\n }\r\n }\r\n return issues;\r\n }\r\n ///////////////////////\r\n checksSubrc(index, statements) {\r\n for (let i = index + 1; i < statements.length; i++) {\r\n const statement = statements[i];\r\n if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n for (const c of statement.findAllExpressions(Expressions.Cond)) {\r\n for (const s of c.findAllExpressions(Expressions.Source)) {\r\n if (s.concatTokens().toUpperCase() === \"SY-SUBRC\") {\r\n return true;\r\n }\r\n }\r\n }\r\n return false;\r\n }\r\n return false;\r\n }\r\n // this is a heuristic, data flow analysis is required to get the correct result\r\n usesTabix(index, statements) {\r\n for (let i = index + 1; i < index + 5; i++) {\r\n const statement = statements[i];\r\n if (statement === undefined) {\r\n break;\r\n }\r\n else if (statement.get() instanceof _statement_1.Comment) {\r\n continue;\r\n }\r\n else if (statement.concatTokens().toUpperCase().includes(\" SY-TABIX\")) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n}\r\nexports.UseLineExists = UseLineExists;\r\n//# sourceMappingURL=use_line_exists.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_line_exists.js?");
|
|
12758
12791
|
|
|
12759
12792
|
/***/ }),
|
|
12760
12793
|
|
|
@@ -12765,7 +12798,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12765
12798
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12766
12799
|
|
|
12767
12800
|
"use strict";
|
|
12768
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseNew = exports.UseNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UseNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseNewConf = UseNewConf;\r\nclass UseNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_new\",\r\n title: \"Use NEW\",\r\n shortDescription: `Checks for deprecated CREATE OBJECT statements.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object\n\nIf the target variable is referenced in the CREATE OBJECT statement, no errors are issued\n\nApplicable from v740sp02 and up`,\r\n badExample: `CREATE OBJECT ref.`,\r\n goodExample: `ref = NEW #( ).`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Use NEW #( ) to instantiate object.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof Statements.CreateObject) {\r\n if (statement.findFirstExpression(expressions_1.Dynamic)) {\r\n continue;\r\n }\r\n else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {\r\n continue;\r\n }\r\n const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"->\";\r\n if (statement.concatTokens().includes(target)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(file, statement);\r\n const issue = issue_1.Issue.atPosition(file, statement.getStart(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n buildFix(file, statement) {\r\n var _a, _b;\r\n const target = (_a = statement.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const parameters = statement.findDirectExpression(Expressions.ParameterListS);\r\n const param = parameters ? parameters.concatTokens() + \" \" : \"\";\r\n let type = (_b = statement.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (type === undefined) {\r\n type = \"#\";\r\n }\r\n const string = `${target} = NEW ${type}( ${param}).`;\r\n return edit_helper_1.EditHelper.replaceRange(file, statement.getStart(), statement.getEnd(), string);\r\n }\r\n}\r\nexports.UseNew = UseNew;\r\n//# sourceMappingURL=use_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_new.js?");
|
|
12801
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.UseNew = exports.UseNewConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Expressions = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst version_1 = __webpack_require__(/*! ../version */ \"./node_modules/@abaplint/core/build/src/version.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nconst edit_helper_1 = __webpack_require__(/*! ../edit_helper */ \"./node_modules/@abaplint/core/build/src/edit_helper.js\");\r\nclass UseNewConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.UseNewConf = UseNewConf;\r\nclass UseNew extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new UseNewConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"use_new\",\r\n title: \"Use NEW\",\r\n shortDescription: `Checks for deprecated CREATE OBJECT statements.`,\r\n extendedInformation: `https://github.com/SAP/styleguides/blob/main/clean-abap/CleanABAP.md#prefer-new-to-create-object\r\n\r\nIf the target variable is referenced in the CREATE OBJECT statement, no errors are issued\r\n\r\nApplicable from v740sp02 and up`,\r\n badExample: `CREATE OBJECT ref.`,\r\n goodExample: `ref = NEW #( ).`,\r\n tags: [_irule_1.RuleTag.Upport, _irule_1.RuleTag.Styleguide, _irule_1.RuleTag.Quickfix, _irule_1.RuleTag.SingleFile],\r\n };\r\n }\r\n getMessage() {\r\n return \"Use NEW #( ) to instantiate object.\";\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n runParsed(file, obj) {\r\n var _a;\r\n const issues = [];\r\n if (obj.getType() === \"INTF\") {\r\n return [];\r\n }\r\n if (this.reg.getConfig().getVersion() < version_1.Version.v740sp02 && this.reg.getConfig().getVersion() !== version_1.Version.Cloud) {\r\n return [];\r\n }\r\n for (const statement of file.getStatements()) {\r\n if (statement.get() instanceof Statements.CreateObject) {\r\n if (statement.findFirstExpression(expressions_1.Dynamic)) {\r\n continue;\r\n }\r\n else if (statement.findDirectExpression(expressions_1.ParameterListExceptions)) {\r\n continue;\r\n }\r\n const target = ((_a = statement.findDirectExpression(expressions_1.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens()) + \"->\";\r\n if (statement.concatTokens().includes(target)) {\r\n continue;\r\n }\r\n const fix = this.buildFix(file, statement);\r\n const issue = issue_1.Issue.atPosition(file, statement.getStart(), this.getMessage(), this.getMetadata().key, this.conf.severity, fix);\r\n issues.push(issue);\r\n }\r\n }\r\n return issues;\r\n }\r\n buildFix(file, statement) {\r\n var _a, _b;\r\n const target = (_a = statement.findDirectExpression(Expressions.Target)) === null || _a === void 0 ? void 0 : _a.concatTokens();\r\n if (target === undefined) {\r\n return undefined;\r\n }\r\n const parameters = statement.findDirectExpression(Expressions.ParameterListS);\r\n const param = parameters ? parameters.concatTokens() + \" \" : \"\";\r\n let type = (_b = statement.findDirectExpression(Expressions.ClassName)) === null || _b === void 0 ? void 0 : _b.getFirstToken().getStr();\r\n if (type === undefined) {\r\n type = \"#\";\r\n }\r\n const string = `${target} = NEW ${type}( ${param}).`;\r\n return edit_helper_1.EditHelper.replaceRange(file, statement.getStart(), statement.getEnd(), string);\r\n }\r\n}\r\nexports.UseNew = UseNew;\r\n//# sourceMappingURL=use_new.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/use_new.js?");
|
|
12769
12802
|
|
|
12770
12803
|
/***/ }),
|
|
12771
12804
|
|
|
@@ -12776,7 +12809,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12776
12809
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12777
12810
|
|
|
12778
12811
|
"use strict";
|
|
12779
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhenOthersLast = exports.WhenOthersLastConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass WhenOthersLastConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.WhenOthersLastConf = WhenOthersLastConf;\r\nclass WhenOthersLast extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new WhenOthersLastConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"when_others_last\",\r\n title: \"WHEN OTHERS last\",\r\n shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `CASE bar.\n WHEN OTHERS.\n WHEN 2.\nENDCASE.`,\r\n goodExample: `CASE bar.\n WHEN 2.\n WHEN OTHERS.\nENDCASE.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"WHEN OTHERS should be the last branch in a CASE statement.\";\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n const cases = struc.findAllStructures(Structures.Case);\r\n for (const c of cases) {\r\n const whentop = c.findDirectStructures(Structures.When);\r\n for (let i = 0; i < whentop.length - 1; i++) {\r\n const whens = whentop[i].findDirectStatements(Statements.When).concat(whentop[i].findDirectStatements(Statements.WhenOthers));\r\n for (const when of whens) {\r\n if (when.get() instanceof Statements.WhenOthers) {\r\n const start = when.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, start, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n}\r\nexports.WhenOthersLast = WhenOthersLast;\r\n//# sourceMappingURL=when_others_last.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/when_others_last.js?");
|
|
12812
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.WhenOthersLast = exports.WhenOthersLastConf = void 0;\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_rule_1 = __webpack_require__(/*! ./_abap_rule */ \"./node_modules/@abaplint/core/build/src/rules/_abap_rule.js\");\r\nconst _basic_rule_config_1 = __webpack_require__(/*! ./_basic_rule_config */ \"./node_modules/@abaplint/core/build/src/rules/_basic_rule_config.js\");\r\nconst Statements = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst Structures = __webpack_require__(/*! ../abap/3_structures/structures */ \"./node_modules/@abaplint/core/build/src/abap/3_structures/structures/index.js\");\r\nconst _irule_1 = __webpack_require__(/*! ./_irule */ \"./node_modules/@abaplint/core/build/src/rules/_irule.js\");\r\nclass WhenOthersLastConf extends _basic_rule_config_1.BasicRuleConfig {\r\n}\r\nexports.WhenOthersLastConf = WhenOthersLastConf;\r\nclass WhenOthersLast extends _abap_rule_1.ABAPRule {\r\n constructor() {\r\n super(...arguments);\r\n this.conf = new WhenOthersLastConf();\r\n }\r\n getMetadata() {\r\n return {\r\n key: \"when_others_last\",\r\n title: \"WHEN OTHERS last\",\r\n shortDescription: `Checks that WHEN OTHERS is placed the last within a CASE statement.`,\r\n tags: [_irule_1.RuleTag.SingleFile],\r\n badExample: `CASE bar.\r\n WHEN OTHERS.\r\n WHEN 2.\r\nENDCASE.`,\r\n goodExample: `CASE bar.\r\n WHEN 2.\r\n WHEN OTHERS.\r\nENDCASE.`,\r\n };\r\n }\r\n getMessage() {\r\n return \"WHEN OTHERS should be the last branch in a CASE statement.\";\r\n }\r\n runParsed(file) {\r\n const issues = [];\r\n const struc = file.getStructure();\r\n if (struc === undefined) {\r\n return [];\r\n }\r\n const cases = struc.findAllStructures(Structures.Case);\r\n for (const c of cases) {\r\n const whentop = c.findDirectStructures(Structures.When);\r\n for (let i = 0; i < whentop.length - 1; i++) {\r\n const whens = whentop[i].findDirectStatements(Statements.When).concat(whentop[i].findDirectStatements(Statements.WhenOthers));\r\n for (const when of whens) {\r\n if (when.get() instanceof Statements.WhenOthers) {\r\n const start = when.getFirstToken().getStart();\r\n const issue = issue_1.Issue.atPosition(file, start, this.getMessage(), this.getMetadata().key, this.conf.severity);\r\n issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n return issues;\r\n }\r\n getConfig() {\r\n return this.conf;\r\n }\r\n setConfig(conf) {\r\n this.conf = conf;\r\n }\r\n}\r\nexports.WhenOthersLast = WhenOthersLast;\r\n//# sourceMappingURL=when_others_last.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/rules/when_others_last.js?");
|
|
12780
12813
|
|
|
12781
12814
|
/***/ }),
|
|
12782
12815
|
|
|
@@ -12864,7 +12897,7 @@ eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\n
|
|
|
12864
12897
|
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
|
|
12865
12898
|
|
|
12866
12899
|
"use strict";
|
|
12867
|
-
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IncludeGraph = void 0;\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst check_include_1 = __webpack_require__(/*! ../rules/check_include */ \"./node_modules/@abaplint/core/build/src/rules/check_include.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst severity_1 = __webpack_require__(/*! ../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\n// todo, check for cycles/circular dependencies, method findTop\r\n// todo, add configurable error for multiple use includes\r\nfunction getABAPObjects(reg) {\r\n const ret = [];\r\n for (const o of reg.getObjects()) {\r\n if (o instanceof _abap_object_1.ABAPObject) {\r\n ret.push(o);\r\n }\r\n }\r\n return ret;\r\n}\r\nclass Graph {\r\n constructor() {\r\n this.vertices = [];\r\n this.edges = [];\r\n }\r\n addVertex(vertex) {\r\n this.vertices.push(vertex);\r\n }\r\n findInclude(includeName) {\r\n for (const v of this.vertices) {\r\n if (v.includeName.toUpperCase() === includeName.toUpperCase()) {\r\n return v;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findVertex(filename) {\r\n for (const v of this.vertices) {\r\n if (v.filename.toUpperCase() === filename.toUpperCase()) {\r\n return v;\r\n }\r\n }\r\n return undefined;\r\n }\r\n addEdge(from, toFilename) {\r\n this.edges.push({ from: from.filename, to: toFilename });\r\n }\r\n findTop(filename) {\r\n const ret = [];\r\n for (const e of this.edges) {\r\n if (e.from === filename) {\r\n ret.push(...this.findTop(e.to));\r\n }\r\n }\r\n if (ret.length === 0) {\r\n const found = this.findVertex(filename);\r\n if (found !== undefined) {\r\n ret.push(found);\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nclass IncludeGraph {\r\n constructor(reg) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.graph = new Graph();\r\n this.build();\r\n }\r\n getIssues() {\r\n return this.issues;\r\n }\r\n listMainForInclude(filename) {\r\n const ret = [];\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n for (const f of this.graph.findTop(filename)) {\r\n if (f.include === false) {\r\n ret.push(f.filename);\r\n }\r\n }\r\n return ret;\r\n }\r\n getIssuesFile(file) {\r\n const ret = [];\r\n for (const i of this.issues) {\r\n if (i.getFilename() === file.getFilename()) {\r\n ret.push(i);\r\n }\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n build() {\r\n this.addVertices();\r\n for (const o of getABAPObjects(this.reg)) {\r\n for (const f of o.getABAPFiles()) {\r\n for (const s of f.getStatements()) {\r\n if (s.get() instanceof statements_1.Include) {\r\n const ifFound = s.concatTokens().toUpperCase().includes(\"IF FOUND\");\r\n const iexp = s.findFirstExpression(expressions_1.IncludeName);\r\n if (iexp === undefined) {\r\n throw new Error(\"unexpected Include node\");\r\n }\r\n const name = iexp.getFirstToken().getStr().toUpperCase();\r\n if (name.match(/^(\\/\\w+\\/)?L.+XX$/)) { // function module XX includes, possibily namespaced\r\n continue;\r\n }\r\n const found = this.graph.findInclude(name);\r\n if (found === undefined) {\r\n if (ifFound === false) {\r\n const issue = issue_1.Issue.atStatement(f, s, \"Include \" + name + \" not found\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n }\r\n else if (found.include === false) {\r\n const issue = issue_1.Issue.atStatement(f, s, \"Not possible to INCLUDE a main program\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n else {\r\n this.graph.addEdge(found, f.getFilename());\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.findUnusedIncludes();\r\n }\r\n findUnusedIncludes() {\r\n for (const v of this.graph.vertices) {\r\n if (v.include === true) {\r\n if (this.listMainForInclude(v.filename).length === 0) {\r\n const f = this.reg.getFileByName(v.filename);\r\n if (f === undefined) {\r\n throw new Error(\"findUnusedIncludes internal error\");\r\n }\r\n const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), \"INCLUDE not used anywhere\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n addVertices() {\r\n for (const o of getABAPObjects(this.reg)) {\r\n if (o instanceof objects_1.Program) {\r\n const file = o.getMainABAPFile();\r\n if (file) {\r\n this.graph.addVertex({\r\n filename: file.getFilename(),\r\n includeName: o.getName(),\r\n include: o.isInclude()\r\n });\r\n }\r\n }\r\n else if (o instanceof objects_1.Class) {\r\n for (const f of o.getSequencedFiles()) {\r\n this.graph.addVertex({\r\n filename: f.getFilename(),\r\n includeName: o.getName(),\r\n include: false\r\n });\r\n }\r\n }\r\n else if (o instanceof objects_1.FunctionGroup) {\r\n for (const i of o.getIncludeFiles()) {\r\n this.graph.addVertex({\r\n filename: i.file.getFilename(),\r\n includeName: i.name,\r\n include: true\r\n });\r\n }\r\n const file = o.getMainABAPFile();\r\n if (file) {\r\n this.graph.addVertex({\r\n filename: file.getFilename(),\r\n includeName: o.getName(),\r\n include: false\r\n });\r\n }\r\n }\r\n }\r\n }\r\n}\r\nexports.IncludeGraph = IncludeGraph;\r\n//# sourceMappingURL=include_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/utils/include_graph.js?");
|
|
12900
|
+
eval("\r\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\r\nexports.IncludeGraph = void 0;\r\nconst statements_1 = __webpack_require__(/*! ../abap/2_statements/statements */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/statements/index.js\");\r\nconst expressions_1 = __webpack_require__(/*! ../abap/2_statements/expressions */ \"./node_modules/@abaplint/core/build/src/abap/2_statements/expressions/index.js\");\r\nconst objects_1 = __webpack_require__(/*! ../objects */ \"./node_modules/@abaplint/core/build/src/objects/index.js\");\r\nconst check_include_1 = __webpack_require__(/*! ../rules/check_include */ \"./node_modules/@abaplint/core/build/src/rules/check_include.js\");\r\nconst position_1 = __webpack_require__(/*! ../position */ \"./node_modules/@abaplint/core/build/src/position.js\");\r\nconst issue_1 = __webpack_require__(/*! ../issue */ \"./node_modules/@abaplint/core/build/src/issue.js\");\r\nconst _abap_object_1 = __webpack_require__(/*! ../objects/_abap_object */ \"./node_modules/@abaplint/core/build/src/objects/_abap_object.js\");\r\nconst severity_1 = __webpack_require__(/*! ../severity */ \"./node_modules/@abaplint/core/build/src/severity.js\");\r\n// todo, check for cycles/circular dependencies, method findTop\r\n// todo, add configurable error for multiple use includes\r\nfunction getABAPObjects(reg) {\r\n const ret = [];\r\n for (const o of reg.getObjects()) {\r\n if (o instanceof _abap_object_1.ABAPObject) {\r\n ret.push(o);\r\n }\r\n }\r\n return ret;\r\n}\r\nclass Graph {\r\n constructor() {\r\n this.vertices = [];\r\n this.edges = [];\r\n }\r\n addVertex(vertex) {\r\n this.vertices.push(vertex);\r\n }\r\n findInclude(includeName) {\r\n for (const v of this.vertices) {\r\n if (v.includeName.toUpperCase() === includeName.toUpperCase()) {\r\n return v;\r\n }\r\n }\r\n return undefined;\r\n }\r\n findVertex(filename) {\r\n for (const v of this.vertices) {\r\n if (v.filename.toUpperCase() === filename.toUpperCase()) {\r\n return v;\r\n }\r\n }\r\n return undefined;\r\n }\r\n addEdge(from, toFilename) {\r\n this.edges.push({ from: from.filename, to: toFilename });\r\n }\r\n findTop(filename) {\r\n const ret = [];\r\n for (const e of this.edges) {\r\n if (e.from === filename) {\r\n ret.push(...this.findTop(e.to));\r\n }\r\n }\r\n if (ret.length === 0) {\r\n const found = this.findVertex(filename);\r\n if (found !== undefined) {\r\n ret.push(found);\r\n }\r\n }\r\n return ret;\r\n }\r\n}\r\nclass IncludeGraph {\r\n constructor(reg) {\r\n this.reg = reg;\r\n this.issues = [];\r\n this.graph = new Graph();\r\n this.build();\r\n }\r\n getIssues() {\r\n return this.issues;\r\n }\r\n listMainForInclude(filename) {\r\n const ret = [];\r\n if (filename === undefined) {\r\n return [];\r\n }\r\n for (const f of this.graph.findTop(filename)) {\r\n if (f.include === false) {\r\n ret.push(f.filename);\r\n }\r\n }\r\n return ret;\r\n }\r\n getIssuesFile(file) {\r\n const ret = [];\r\n for (const i of this.issues) {\r\n if (i.getFilename() === file.getFilename()) {\r\n ret.push(i);\r\n }\r\n }\r\n return ret;\r\n }\r\n ///////////////////////////////\r\n build() {\r\n this.addVertices();\r\n for (const o of getABAPObjects(this.reg)) {\r\n for (const f of o.getABAPFiles()) {\r\n for (const s of f.getStatements()) {\r\n if (s.get() instanceof statements_1.Include) {\r\n const ifFound = s.concatTokens().toUpperCase().includes(\"IF FOUND\");\r\n const iexp = s.findFirstExpression(expressions_1.IncludeName);\r\n if (iexp === undefined) {\r\n throw new Error(\"unexpected Include node\");\r\n }\r\n const name = iexp.getFirstToken().getStr().toUpperCase();\r\n if (name.match(/^(\\/\\w+\\/)?L.+XX$/)) { // function module XX includes, possibily namespaced\r\n continue;\r\n }\r\n const found = this.graph.findInclude(name);\r\n if (found === undefined) {\r\n if (ifFound === false) {\r\n const issue = issue_1.Issue.atStatement(f, s, \"Include \" + name + \" not found\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n }\r\n else if (found.include === false) {\r\n const issue = issue_1.Issue.atStatement(f, s, \"Not possible to INCLUDE a main program\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n else {\r\n this.graph.addEdge(found, f.getFilename());\r\n }\r\n }\r\n }\r\n }\r\n }\r\n this.findUnusedIncludes();\r\n }\r\n findUnusedIncludes() {\r\n for (const v of this.graph.vertices) {\r\n if (v.include === true) {\r\n if (this.listMainForInclude(v.filename).length === 0) {\r\n const f = this.reg.getFileByName(v.filename);\r\n if (f === undefined) {\r\n throw new Error(\"findUnusedIncludes internal error\");\r\n }\r\n const issue = issue_1.Issue.atPosition(f, new position_1.Position(1, 1), \"INCLUDE not used anywhere\", new check_include_1.CheckInclude().getMetadata().key, severity_1.Severity.Error);\r\n this.issues.push(issue);\r\n }\r\n }\r\n }\r\n }\r\n addVertices() {\r\n for (const o of getABAPObjects(this.reg)) {\r\n if (o instanceof objects_1.Program) {\r\n const file = o.getMainABAPFile();\r\n if (file) {\r\n this.graph.addVertex({\r\n filename: file.getFilename(),\r\n includeName: o.getName(),\r\n include: o.isInclude()\r\n });\r\n }\r\n }\r\n else if (o instanceof objects_1.TypePool) {\r\n const file = o.getMainABAPFile();\r\n if (file) {\r\n this.graph.addVertex({\r\n filename: file.getFilename(),\r\n includeName: o.getName(),\r\n include: false\r\n });\r\n }\r\n }\r\n else if (o instanceof objects_1.Class) {\r\n for (const f of o.getSequencedFiles()) {\r\n this.graph.addVertex({\r\n filename: f.getFilename(),\r\n includeName: o.getName(),\r\n include: false\r\n });\r\n }\r\n }\r\n else if (o instanceof objects_1.FunctionGroup) {\r\n for (const i of o.getIncludeFiles()) {\r\n this.graph.addVertex({\r\n filename: i.file.getFilename(),\r\n includeName: i.name,\r\n include: true\r\n });\r\n }\r\n const file = o.getMainABAPFile();\r\n if (file) {\r\n this.graph.addVertex({\r\n filename: file.getFilename(),\r\n includeName: o.getName(),\r\n include: false\r\n });\r\n }\r\n }\r\n }\r\n }\r\n}\r\nexports.IncludeGraph = IncludeGraph;\r\n//# sourceMappingURL=include_graph.js.map\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/@abaplint/core/build/src/utils/include_graph.js?");
|
|
12868
12901
|
|
|
12869
12902
|
/***/ }),
|
|
12870
12903
|
|
|
@@ -13068,7 +13101,7 @@ eval("\n\nconst util = __webpack_require__(/*! ./util */ \"./node_modules/fast-x
|
|
|
13068
13101
|
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
|
13069
13102
|
|
|
13070
13103
|
"use strict";
|
|
13071
|
-
eval("\n//parse Empty Node as self closing node\nconst buildFromOrderedJs = __webpack_require__(/*! ./orderedJs2Xml */ \"./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js\");\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataPropName: false,\n format: false,\n indentBy: ' ',\n suppressEmptyNode: false,\n suppressUnpairedNode: true,\n suppressBooleanAttributes: true,\n tagValueProcessor: function(key, a) {\n return a;\n },\n attributeValueProcessor: function(attrName, a) {\n return a;\n },\n preserveOrder: false,\n commentPropName: false,\n unpairedTags: [],\n entities: [\n { regex: new RegExp(\"&\", \"g\"), val: \"&\" },//it must be on top\n { regex: new RegExp(\">\", \"g\"), val: \">\" },\n { regex: new RegExp(\"<\", \"g\"), val: \"<\" },\n { regex: new RegExp(\"\\'\", \"g\"), val: \"'\" },\n { regex: new RegExp(\"\\\"\", \"g\"), val: \""\" }\n ],\n processEntities: true,\n stopNodes: []\n};\n\nfunction Builder(options) {\n this.options = Object.assign({}, defaultOptions, options);\n if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n this.isAttribute = function(/*a*/) {\n return false;\n };\n } else {\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n\n this.processTextOrObjNode = processTextOrObjNode\n\n if (this.options.format) {\n this.indentate = indentate;\n this.tagEndChar = '>\\n';\n this.newLine = '\\n';\n } else {\n this.indentate = function() {\n return '';\n };\n this.tagEndChar = '>';\n this.newLine = '';\n }\n\n if (this.options.suppressEmptyNode) {\n this.buildTextNode = buildEmptyTextNode;\n this.buildObjNode = buildEmptyObjNode;\n } else {\n this.buildTextNode = buildTextValNode;\n this.buildObjNode = buildObjectNode;\n }\n\n this.buildTextValNode = buildTextValNode;\n this.buildObjectNode = buildObjectNode;\n\n this.replaceEntitiesValue = replaceEntitiesValue;\n this.buildAttrPairStr = buildAttrPairStr;\n}\n\nBuilder.prototype.build = function(jObj) {\n if(this.options.preserveOrder){\n return buildFromOrderedJs(jObj, this.options);\n }else {\n if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){\n jObj = {\n [this.options.arrayNodeName] : jObj\n }\n }\n return this.j2x(jObj, 0).val;\n }\n};\n\nBuilder.prototype.j2x = function(jObj, level) {\n let attrStr = '';\n let val = '';\n for (let key in jObj) {\n if (typeof jObj[key] === 'undefined') {\n // supress undefined node\n } else if (jObj[key] === null) {\n if(key[0] === \"?\") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;\n else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (jObj[key] instanceof Date) {\n val += this.buildTextNode(jObj[key], key, '', level);\n } else if (typeof jObj[key] !== 'object') {\n //premitive type\n const attr = this.isAttribute(key);\n if (attr) {\n attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);\n }else {\n //tag value\n if (key === this.options.textNodeName) {\n let newval = this.options.tagValueProcessor(key, '' + jObj[key]);\n val += this.replaceEntitiesValue(newval);\n } else {\n val += this.buildTextNode(jObj[key], key, '', level);\n }\n }\n } else if (Array.isArray(jObj[key])) {\n //repeated nodes\n const arrLen = jObj[key].length;\n for (let j = 0; j < arrLen; j++) {\n const item = jObj[key][j];\n if (typeof item === 'undefined') {\n // supress undefined node\n } else if (item === null) {\n if(key[0] === \"?\") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;\n else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (typeof item === 'object') {\n val += this.processTextOrObjNode(item, key, level)\n } else {\n val += this.buildTextNode(item, key, '', level);\n }\n }\n } else {\n //nested node\n if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n const Ks = Object.keys(jObj[key]);\n const L = Ks.length;\n for (let j = 0; j < L; j++) {\n attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);\n }\n } else {\n val += this.processTextOrObjNode(jObj[key], key, level)\n }\n }\n }\n return {attrStr: attrStr, val: val};\n};\n\nfunction buildAttrPairStr(attrName, val){\n val = this.options.attributeValueProcessor(attrName, '' + val);\n val = this.replaceEntitiesValue(val);\n if (this.options.suppressBooleanAttributes && val === \"true\") {\n return ' ' + attrName;\n } else return ' ' + attrName + '=\"' + val + '\"';\n}\n\nfunction processTextOrObjNode (object, key, level) {\n const result = this.j2x(object, level + 1);\n if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {\n return this.buildTextNode(
|
|
13104
|
+
eval("\n//parse Empty Node as self closing node\nconst buildFromOrderedJs = __webpack_require__(/*! ./orderedJs2Xml */ \"./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js\");\n\nconst defaultOptions = {\n attributeNamePrefix: '@_',\n attributesGroupName: false,\n textNodeName: '#text',\n ignoreAttributes: true,\n cdataPropName: false,\n format: false,\n indentBy: ' ',\n suppressEmptyNode: false,\n suppressUnpairedNode: true,\n suppressBooleanAttributes: true,\n tagValueProcessor: function(key, a) {\n return a;\n },\n attributeValueProcessor: function(attrName, a) {\n return a;\n },\n preserveOrder: false,\n commentPropName: false,\n unpairedTags: [],\n entities: [\n { regex: new RegExp(\"&\", \"g\"), val: \"&\" },//it must be on top\n { regex: new RegExp(\">\", \"g\"), val: \">\" },\n { regex: new RegExp(\"<\", \"g\"), val: \"<\" },\n { regex: new RegExp(\"\\'\", \"g\"), val: \"'\" },\n { regex: new RegExp(\"\\\"\", \"g\"), val: \""\" }\n ],\n processEntities: true,\n stopNodes: []\n};\n\nfunction Builder(options) {\n this.options = Object.assign({}, defaultOptions, options);\n if (this.options.ignoreAttributes || this.options.attributesGroupName) {\n this.isAttribute = function(/*a*/) {\n return false;\n };\n } else {\n this.attrPrefixLen = this.options.attributeNamePrefix.length;\n this.isAttribute = isAttribute;\n }\n\n this.processTextOrObjNode = processTextOrObjNode\n\n if (this.options.format) {\n this.indentate = indentate;\n this.tagEndChar = '>\\n';\n this.newLine = '\\n';\n } else {\n this.indentate = function() {\n return '';\n };\n this.tagEndChar = '>';\n this.newLine = '';\n }\n\n if (this.options.suppressEmptyNode) {\n this.buildTextNode = buildEmptyTextNode;\n this.buildObjNode = buildEmptyObjNode;\n } else {\n this.buildTextNode = buildTextValNode;\n this.buildObjNode = buildObjectNode;\n }\n\n this.buildTextValNode = buildTextValNode;\n this.buildObjectNode = buildObjectNode;\n\n this.replaceEntitiesValue = replaceEntitiesValue;\n this.buildAttrPairStr = buildAttrPairStr;\n}\n\nBuilder.prototype.build = function(jObj) {\n if(this.options.preserveOrder){\n return buildFromOrderedJs(jObj, this.options);\n }else {\n if(Array.isArray(jObj) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1){\n jObj = {\n [this.options.arrayNodeName] : jObj\n }\n }\n return this.j2x(jObj, 0).val;\n }\n};\n\nBuilder.prototype.j2x = function(jObj, level) {\n let attrStr = '';\n let val = '';\n for (let key in jObj) {\n if (typeof jObj[key] === 'undefined') {\n // supress undefined node\n } else if (jObj[key] === null) {\n if(key[0] === \"?\") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;\n else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (jObj[key] instanceof Date) {\n val += this.buildTextNode(jObj[key], key, '', level);\n } else if (typeof jObj[key] !== 'object') {\n //premitive type\n const attr = this.isAttribute(key);\n if (attr) {\n attrStr += this.buildAttrPairStr(attr, '' + jObj[key]);\n }else {\n //tag value\n if (key === this.options.textNodeName) {\n let newval = this.options.tagValueProcessor(key, '' + jObj[key]);\n val += this.replaceEntitiesValue(newval);\n } else {\n val += this.buildTextNode(jObj[key], key, '', level);\n }\n }\n } else if (Array.isArray(jObj[key])) {\n //repeated nodes\n const arrLen = jObj[key].length;\n for (let j = 0; j < arrLen; j++) {\n const item = jObj[key][j];\n if (typeof item === 'undefined') {\n // supress undefined node\n } else if (item === null) {\n if(key[0] === \"?\") val += this.indentate(level) + '<' + key + '?' + this.tagEndChar;\n else val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n // val += this.indentate(level) + '<' + key + '/' + this.tagEndChar;\n } else if (typeof item === 'object') {\n val += this.processTextOrObjNode(item, key, level)\n } else {\n val += this.buildTextNode(item, key, '', level);\n }\n }\n } else {\n //nested node\n if (this.options.attributesGroupName && key === this.options.attributesGroupName) {\n const Ks = Object.keys(jObj[key]);\n const L = Ks.length;\n for (let j = 0; j < L; j++) {\n attrStr += this.buildAttrPairStr(Ks[j], '' + jObj[key][Ks[j]]);\n }\n } else {\n val += this.processTextOrObjNode(jObj[key], key, level)\n }\n }\n }\n return {attrStr: attrStr, val: val};\n};\n\nfunction buildAttrPairStr(attrName, val){\n val = this.options.attributeValueProcessor(attrName, '' + val);\n val = this.replaceEntitiesValue(val);\n if (this.options.suppressBooleanAttributes && val === \"true\") {\n return ' ' + attrName;\n } else return ' ' + attrName + '=\"' + val + '\"';\n}\n\nfunction processTextOrObjNode (object, key, level) {\n const result = this.j2x(object, level + 1);\n if (object[this.options.textNodeName] !== undefined && Object.keys(object).length === 1) {\n return this.buildTextNode(object[this.options.textNodeName], key, result.attrStr, level);\n } else {\n return this.buildObjNode(result.val, key, result.attrStr, level);\n }\n}\n\nfunction buildObjectNode(val, key, attrStr, level) {\n let tagEndExp = '</' + key + this.tagEndChar;\n let piClosingChar = \"\";\n \n if(key[0] === \"?\") {\n piClosingChar = \"?\";\n tagEndExp = \"\";\n }\n\n if (attrStr && val.indexOf('<') === -1) {\n return (\n this.indentate(level) + '<' + key + attrStr + piClosingChar + '>' +\n val +\n tagEndExp );\n } else {\n return (\n this.indentate(level) + '<' + key + attrStr + piClosingChar + this.tagEndChar +\n val +\n this.indentate(level) + tagEndExp );\n }\n}\n\nfunction buildEmptyObjNode(val, key, attrStr, level) {\n if (val !== '') {\n return this.buildObjectNode(val, key, attrStr, level);\n } else {\n if(key[0] === \"?\") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar;\n else return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar;\n }\n}\n\nfunction buildTextValNode(val, key, attrStr, level) {\n let textValue = this.options.tagValueProcessor(key, val);\n textValue = this.replaceEntitiesValue(textValue);\n\n if( textValue === '' && this.options.unpairedTags.indexOf(key) !== -1){ //unpaired\n if(this.options.suppressUnpairedNode){\n return this.indentate(level) + '<' + key + this.tagEndChar;\n }else{\n return this.indentate(level) + '<' + key + \"/\" + this.tagEndChar;\n }\n }else{\n return (\n this.indentate(level) + '<' + key + attrStr + '>' +\n textValue +\n '</' + key + this.tagEndChar );\n }\n}\n\nfunction replaceEntitiesValue(textValue){\n if(textValue && textValue.length > 0 && this.options.processEntities){\n for (let i=0; i<this.options.entities.length; i++) {\n const entity = this.options.entities[i];\n textValue = textValue.replace(entity.regex, entity.val);\n }\n }\n return textValue;\n}\n\nfunction buildEmptyTextNode(val, key, attrStr, level) {\n if( val === '' && this.options.unpairedTags.indexOf(key) !== -1){ //unpaired\n if(this.options.suppressUnpairedNode){\n return this.indentate(level) + '<' + key + this.tagEndChar;\n }else{\n return this.indentate(level) + '<' + key + \"/\" + this.tagEndChar;\n }\n }else if (val !== '') { //empty\n return this.buildTextValNode(val, key, attrStr, level);\n } else {\n if(key[0] === \"?\") return this.indentate(level) + '<' + key + attrStr+ '?' + this.tagEndChar; //PI tag\n else return this.indentate(level) + '<' + key + attrStr + '/' + this.tagEndChar; //normal\n }\n}\n\nfunction indentate(level) {\n return this.options.indentBy.repeat(level);\n}\n\nfunction isAttribute(name /*, options*/) {\n if (name.startsWith(this.options.attributeNamePrefix)) {\n return name.substr(this.attrPrefixLen);\n } else {\n return false;\n }\n}\n\nmodule.exports = Builder;\n\n\n//# sourceURL=webpack://@abaplint/cli/./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js?");
|
|
13072
13105
|
|
|
13073
13106
|
/***/ }),
|
|
13074
13107
|
|